Fixing assignment bug in VA quaternion from matlab getter, also fixing wrong...

Fixing assignment bug in VA quaternion from matlab getter, also fixing wrong rotation of head-above-torso (was not performed inverted)
parent 713678f1
......@@ -344,10 +344,10 @@ mxArray* matlabCreateQuaternion( const VAQuat& qOrient )
{
mxArray* q = mxCreateDoubleMatrix( 4, 1, mxREAL );
double* d = mxGetPr( q );
d[ 1 ] = qOrient.w;
d[ 2 ] = qOrient.x;
d[ 3 ] = qOrient.y;
d[ 4 ] = qOrient.z;
d[ 0 ] = qOrient.w;
d[ 1 ] = qOrient.x;
d[ 2 ] = qOrient.y;
d[ 3 ] = qOrient.z;
return q;
}
......
......@@ -67,7 +67,7 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
const sRigidBodyData& oBodyData( sFrame->RigidBodies[ iTrackedReceiverHATORigidBodyIndex - 1 ] );
VistaQuaternion qOrientRaw( oBodyData.qx, oBodyData.qy, oBodyData.qz, oBodyData.qw );
VistaQuaternion qHATOOrient = qOrientRaw * qOrientRigidBody;
VistaQuaternion qHATOOrient = qOrientRaw.GetInverted() * qOrientRigidBody;
VAQuat qFinalHATO = VAQuat( qHATOOrient[ Vista::X ], qHATOOrient[ Vista::Y ], qHATOOrient[ Vista::Z ], qHATOOrient[ Vista::W ] );
pVACore->SetSoundReceiverHeadAboveTorsoOrientation( iTrackedReceiverID, qFinalHATO );
......@@ -116,7 +116,7 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
const sRigidBodyData& oBodyData(sFrame->RigidBodies[iTrackedRealWorldSoundReceiverTorsoRigidBodyIndex - 1]);
const VistaQuaternion qTorsoOrientRaw( oBodyData.qx, oBodyData.qy, oBodyData.qz, oBodyData.qw );
const VistaQuaternion qTorsoOrient = qOrientRotation * qOrientRigidBody;
const VistaQuaternion qTorsoOrient = qTorsoOrientRaw.GetInverted() * qOrientRigidBody;
const VAQuat qFinalOrient( qTorsoOrient[ Vista::X ], qTorsoOrient[ Vista::Y ], qTorsoOrient[ Vista::Z ], qTorsoOrient[ Vista::W ] );
pVACore->SetSoundReceiverRealWorldHeadAboveTorsoOrientation( iTrackedReceiverID, qFinalOrient );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment