new algorithm for spaceball movements

*consolidate motion3 event handeling.
*rotation about focal point.
*translation based on world to screen scale.
*cleanup axes map and constants.
This commit is contained in:
tanderson
2012-02-28 10:42:17 -05:00
parent c3647b3baa
commit 9ffdfbe485
7 changed files with 61 additions and 69 deletions

View File

@@ -285,16 +285,10 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
// Spaceball & Joystick handling
if (type.isDerivedFrom(SoMotion3Event::getClassTypeId())) {
SoMotion3Event * const event = (SoMotion3Event *) ev;
SoCamera * const camera = viewer->getCamera();
if (camera) {
SbVec3f dir = event->getTranslation();
camera->orientation.getValue().multVec(dir,dir);
camera->position = camera->position.getValue() + dir;
camera->orientation =
event->getRotation() * camera->orientation.getValue();
processed = TRUE;
}
const SoMotion3Event * const event = static_cast<const SoMotion3Event * const>(ev);
if (event)
this->processMotionEvent(event);
processed = TRUE;
}
enum {