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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user