From Cory Riddell, "I added an _allowThrow bool and get / set accessors to

TrackballManipulator. The purpose of this is to disable throwing when
you release the mouse button while moving the mouse. The default
settings is true (ie, allow throw). The two source files are attached.
"
This commit is contained in:
Robert Osfield
2009-04-09 14:31:15 +00:00
parent fddaaf0d00
commit 4f72be65dc
2 changed files with 10 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ TrackballManipulator::TrackballManipulator()
{
_modelScale = 0.01f;
_minimumZoomScale = 0.05f;
_allowThrow = true;
_thrown = false;
_distance = 1.0f;
@@ -80,7 +81,7 @@ bool TrackballManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us
switch(ea.getEventType())
{
case(GUIEventAdapter::FRAME):
if (_thrown)
if (_thrown && _allowThrow)
{
if (calcMovement()) us.requestRedraw();
}
@@ -117,7 +118,7 @@ bool TrackballManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us
{
us.requestRedraw();
us.requestContinuousUpdate(true);
_thrown = true;
_thrown = _allowThrow;
}
}
else