History

added easier support for calculating multitouch rotating behavior including deltaAngle, isRotating, rotating(direction) properties

ZappoMan committed 12 years ago

Commit dca0b051 parent 3bf8dd85 files · +160 −31Browse files

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

Unified · Split

interface/src/Application.cpp+8−6
@@ -1218,6 +1218,11 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 1217 unmodified lines
1218 }1218 }
1219}1219}
1220 1220
1221const bool MAKE_SOUND_ON_VOXEL_HOVER = false;
1222const bool MAKE_SOUND_ON_VOXEL_CLICK = true;
1223const float HOVER_VOXEL_FREQUENCY = 7040.f;
1224const float HOVER_VOXEL_DECAY = 0.999f;
1225
1221void Application::mousePressEvent(QMouseEvent* event) {1226void Application::mousePressEvent(QMouseEvent* event) {
1222 _controllerScriptingInterface.emitMousePressEvent(event); // send events to any registered scripts1227 _controllerScriptingInterface.emitMousePressEvent(event); // send events to any registered scripts
1223 1228
@@ -1320,7 +1325,7 @@ void Application::touchUpdateEvent(QTouchEvent* event) { · 96 unmodified lines
1320}1325}
1321 1326
1322void Application::touchBeginEvent(QTouchEvent* event) {1327void Application::touchBeginEvent(QTouchEvent* event) {
1323 TouchEvent thisEvent(*event, _lastTouchEvent);1328 TouchEvent thisEvent(*event); // on touch begin, we don't compare to last event
1324 _controllerScriptingInterface.emitTouchBeginEvent(thisEvent); // send events to any registered scripts1329 _controllerScriptingInterface.emitTouchBeginEvent(thisEvent); // send events to any registered scripts
1325 touchUpdateEvent(event);1330 touchUpdateEvent(event);
1326 _lastTouchEvent = thisEvent;1331 _lastTouchEvent = thisEvent;
@@ -2007,12 +2012,9 @@ void Application::updateHoverVoxels(float deltaTime, float& distance, BoxFace& f · 680 unmodified lines
2007 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);2012 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2008 PerformanceWarning warn(showWarnings, "Application::updateHoverVoxels()");2013 PerformanceWarning warn(showWarnings, "Application::updateHoverVoxels()");
2009 2014
2010 // Check for a new hover voxel
2011 if (!_mousePressed) {2015 if (!_mousePressed) {
2012 {2016 PerformanceWarning warn(showWarnings, "Application::updateHoverVoxels() _voxels.findRayIntersection()");
2013 PerformanceWarning warn(showWarnings, "Application::updateHoverVoxels() _voxels.findRayIntersection()");2017 _isHoverVoxel = _voxels.findRayIntersection(_mouseRayOrigin, _mouseRayDirection, _hoverVoxel, distance, face);
2014 _isHoverVoxel = _voxels.findRayIntersection(_mouseRayOrigin, _mouseRayDirection, _hoverVoxel, distance, face);
2015 }
2016 }2018 }
2017}2019}
2018 2020

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