Loading lib_rend/ivas_orient_trk.c +15 −7 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ *******************************************************************************************************/ #include "common_api_types.h" #include <stdint.h> #include "options.h" #include "ivas_prot.h" Loading Loading @@ -456,19 +457,26 @@ ivas_error ivas_orient_trk_Process( float alpha = pOTR->alpha; float ang; ivas_error result; IVAS_QUATERNION quat; if ( pOTR == NULL || pTrkRot == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } quat.w = 0.0f; quat.x = 0.0f; quat.y = 0.0f; quat.z = 0.0f; /* check for Euler angle signaling */ //if ( pOTR->refRot.w == -3.0f ) //{ // // convert to quaternion // // port https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles //} if ( pOTR->refRot.w == -3.0f ) { Euler2Quat(pOTR->refRot.x, pOTR->refRot.y, pOTR->refRot.z, &quat); } else { quat = pOTR->refRot; } result = IVAS_ERR_OK; Loading @@ -486,7 +494,7 @@ ivas_error ivas_orient_trk_Process( pOTR->alpha = sinf( 2.0f * EVS_PI * pOTR->centerAdaptationRate / updateRate ); /* Compute relative orientation = (absolute orientation) - (reference orientation) */ QuaternionInverse( pOTR->refRot, pTrkRot ); QuaternionInverse( quat, pTrkRot ); QuaternionProduct( *pTrkRot, *pAbsRot, pTrkRot ); break; Loading lib_rend/ivas_prot_rend.h +11 −0 Original line number Diff line number Diff line Loading @@ -796,12 +796,23 @@ void ivas_headTrack_close( ); #endif #ifndef FIX_I109_ORIENTATION_TRACKING void Quat2Euler( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ float *yaw, /* o : yaw */ float *pitch, /* o : pitch */ float *roll /* o : roll */ ); #endif #ifdef FIX_I109_ORIENTATION_TRACKING void Euler2Quat( const float yaw, /* i : yaw */ const float pitch, /* i : pitch */ const float roll, /* i : roll */ IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ ); #endif void QuatToRotMat( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ Loading lib_rend/ivas_rotation.c +24 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,30 @@ void Quat2Euler( } #endif #ifdef FIX_I109_ORIENTATION_TRACKING /*------------------------------------------------------------------------- * Euler2Quat() * * Quaternion handling: calculate corresponding Euler angles *------------------------------------------------------------------------*/ void Euler2Quat( const float yaw, /* i : yaw */ const float pitch, /* i : pitch */ const float roll, /* i : roll */ IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ ) { // @TODO implementation here quat->w = -3.0f; quat->x = yaw; quat->y = pitch; quat->z = roll; return; } #endif /*------------------------------------------------------------------------- * rotateAziEle() Loading Loading
lib_rend/ivas_orient_trk.c +15 −7 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ *******************************************************************************************************/ #include "common_api_types.h" #include <stdint.h> #include "options.h" #include "ivas_prot.h" Loading Loading @@ -456,19 +457,26 @@ ivas_error ivas_orient_trk_Process( float alpha = pOTR->alpha; float ang; ivas_error result; IVAS_QUATERNION quat; if ( pOTR == NULL || pTrkRot == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } quat.w = 0.0f; quat.x = 0.0f; quat.y = 0.0f; quat.z = 0.0f; /* check for Euler angle signaling */ //if ( pOTR->refRot.w == -3.0f ) //{ // // convert to quaternion // // port https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles //} if ( pOTR->refRot.w == -3.0f ) { Euler2Quat(pOTR->refRot.x, pOTR->refRot.y, pOTR->refRot.z, &quat); } else { quat = pOTR->refRot; } result = IVAS_ERR_OK; Loading @@ -486,7 +494,7 @@ ivas_error ivas_orient_trk_Process( pOTR->alpha = sinf( 2.0f * EVS_PI * pOTR->centerAdaptationRate / updateRate ); /* Compute relative orientation = (absolute orientation) - (reference orientation) */ QuaternionInverse( pOTR->refRot, pTrkRot ); QuaternionInverse( quat, pTrkRot ); QuaternionProduct( *pTrkRot, *pAbsRot, pTrkRot ); break; Loading
lib_rend/ivas_prot_rend.h +11 −0 Original line number Diff line number Diff line Loading @@ -796,12 +796,23 @@ void ivas_headTrack_close( ); #endif #ifndef FIX_I109_ORIENTATION_TRACKING void Quat2Euler( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ float *yaw, /* o : yaw */ float *pitch, /* o : pitch */ float *roll /* o : roll */ ); #endif #ifdef FIX_I109_ORIENTATION_TRACKING void Euler2Quat( const float yaw, /* i : yaw */ const float pitch, /* i : pitch */ const float roll, /* i : roll */ IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ ); #endif void QuatToRotMat( const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ Loading
lib_rend/ivas_rotation.c +24 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,30 @@ void Quat2Euler( } #endif #ifdef FIX_I109_ORIENTATION_TRACKING /*------------------------------------------------------------------------- * Euler2Quat() * * Quaternion handling: calculate corresponding Euler angles *------------------------------------------------------------------------*/ void Euler2Quat( const float yaw, /* i : yaw */ const float pitch, /* i : pitch */ const float roll, /* i : roll */ IVAS_QUATERNION *quat /* o : quaternion describing the rotation */ ) { // @TODO implementation here quat->w = -3.0f; quat->x = yaw; quat->y = pitch; quat->z = roll; return; } #endif /*------------------------------------------------------------------------- * rotateAziEle() Loading