History

Merge branch 'master' of https://github.com/worklist/hifi into fix_key_press_event

atlante45 committed 13 years ago

Commit 8c112cb2 parents 1b4cdc0 6f42bfb4 files · +48 −28Browse files

Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all

Unified · Split

interface/src/Application.cpp+16−10
@@ -933,7 +933,7 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 932 unmodified lines
933933
934934 const bool MAKE_SOUND_ON_VOXEL_HOVER = false;
935935 const bool MAKE_SOUND_ON_VOXEL_CLICK = true;
936−const float HOVER_VOXEL_FREQUENCY = 14080.f;
936+const float HOVER_VOXEL_FREQUENCY = 7040.f;
937937 const float HOVER_VOXEL_DECAY = 0.999f;
938938
939939 void Application::mousePressEvent(QMouseEvent* event) {
@@ -2249,15 +2249,21 @@ void Application::update(float deltaTime) { · 1309 unmodified lines
22492249 // If we have clicked on a voxel, update it's color
22502250 if (_isHoverVoxelSounding) {
22512251 VoxelNode* hoveredNode = _voxels.getVoxelAt(_hoverVoxel.x, _hoverVoxel.y, _hoverVoxel.z, _hoverVoxel.s);
2252− float bright = _audio.getCollisionSoundMagnitude();
2253− nodeColor clickColor = { 255 * bright + _hoverVoxelOriginalColor[0] * (1.f - bright),
2254− _hoverVoxelOriginalColor[1] * (1.f - bright),
2255− _hoverVoxelOriginalColor[2] * (1.f - bright), 1 };
2256− hoveredNode->setColor(clickColor);
2257− if (bright < 0.01f) {
2258− hoveredNode->setColor(_hoverVoxelOriginalColor);
2252+ if (hoveredNode) {
2253+ float bright = _audio.getCollisionSoundMagnitude();
2254+ nodeColor clickColor = { 255 * bright + _hoverVoxelOriginalColor[0] * (1.f - bright),
2255+ _hoverVoxelOriginalColor[1] * (1.f - bright),
2256+ _hoverVoxelOriginalColor[2] * (1.f - bright), 1 };
2257+ hoveredNode->setColor(clickColor);
2258+ if (bright < 0.01f) {
2259+ hoveredNode->setColor(_hoverVoxelOriginalColor);
2260+ _isHoverVoxelSounding = false;
2261+ }
2262+ } else {
2263+ // Voxel is not found, clear all
22592264 _isHoverVoxelSounding = false;
2260− }
2265+ _isHoverVoxel = false;
2266+ }
22612267 } else {
22622268 // Check for a new hover voxel
22632269 glm::vec4 oldVoxel(_hoverVoxel.x, _hoverVoxel.y, _hoverVoxel.z, _hoverVoxel.s);
@@ -2938,7 +2944,7 @@ void Application::displaySide(Camera& whichCamera) { · 674 unmodified lines
29382944 }
29392945
29402946 // Render the world box
2941− if (!_lookingInMirror->isChecked() && _renderStatsOn->isChecked()) { render_world_box(); }
2947+ if (!_lookingInMirror->isChecked() && _renderStatsOn->isChecked()) { renderWorldBox(); }
29422948
29432949 // brad's frustum for debugging
29442950 if (_frustumOn->isChecked()) renderViewFrustum(_viewFrustum);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t