Show
Ignore:
Timestamp:
12/30/03 21:36:40 (5 years ago)
Author:
patrickh
Message:

Bug fixed: Rotations were not transformed correctly from the Trackd

coordinate frame into the VR Juggler coordinate frame.

This is merged from the mainline code with the necessary changes from GMTL
to VR Juggler 1.0 math. This change includes a switch from the use of
Euler angles to quaternions to avoid problems inherent in Euler angles.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/RELENG_1_0/juggler_1.0/Input/Multi/aTrackdSensor.cpp

    r2490 r14066  
     1#include <assert.h> 
     2#include <Math/vjQuat.h> 
    13#include <Input/Multi/aTrackdSensor.h> 
    2 #include <assert.h> 
    34 
    45int aTrackdSensor::numSensors() 
     
    1819   sensor_val = trackd_sensor(mMem, sensorNum); 
    1920 
    20    // XXX: This is untested and is probably wrong. :( 
     21   vjQuat rx, ry, rz, rt; 
     22 
     23   rx.makeRot(VJ_DEG2RAD(sensor_val->elev), 1.0, 0.0, 0.0); 
     24   ry.makeRot(VJ_DEG2RAD(sensor_val->azim), 0.0, 1.0, 0.0); 
     25   rz.makeRot(VJ_DEG2RAD(sensor_val->roll), 0.0, 0.0, 1.0); 
     26 
     27   rt = ry * rx * rz; 
     28 
    2129   vjMatrix ret_val; 
    22    ret_val.makeXYZEuler(sensor_val->elev, sensor_val->azim, sensor_val->roll); 
     30   ret_val.makeQuaternion(rt); 
    2331   ret_val.setTrans(sensor_val->x, sensor_val->y, sensor_val->z); 
    2432