Commit 24da0beb authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Remove duplicated code

parent ec843afa
Loading
Loading
Loading
Loading
Loading
+0 −63
Original line number Diff line number Diff line
@@ -7643,70 +7643,7 @@ ivas_error IVAS_REND_GetTrackedRotation(
    return IVAS_ERR_OK;
}
#endif
#ifdef IVAS_FLOAT_FIXED

/*---------------------------------------------------------------------*
 * IVAS_REND_SetReferenceVector( )
 *
 * Sets a reference vector spanning from listenerPos to refPos. Only
 * available in OTR_TRACKING_REF_VEC and OTR_TRACKING_REF_VEC_LEV modes.
 *---------------------------------------------------------------------*/

ivas_error IVAS_REND_SetReferenceVector(
    IVAS_REND_HANDLE hIvasRend,     /* i/o: Renderer handle             */
    const IVAS_VECTOR3 listenerPos, /* i  : Listener position           */
    const IVAS_VECTOR3 refPos       /* i  : Reference position          */
)
{
    IF( hIvasRend == NULL || hIvasRend->headRotData.hOrientationTracker == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    return ivas_orient_trk_SetReferenceVector_fx( hIvasRend->headRotData.hOrientationTracker, listenerPos, refPos );
}


/*---------------------------------------------------------------------*
 * IVAS_REND_SetExternalOrientation()
 *
 *
 *---------------------------------------------------------------------*/

ivas_error IVAS_REND_SetExternalOrientation(
    IVAS_REND_HANDLE hIvasRend,          /* i/o: Renderer handle                                                         */
    IVAS_QUATERNION *orientation,        /* i  : external orientation data                                               */
    Word8 enableHeadRotation,            /* i  : flag to enable head rotation for this frame                             */
    Word8 enableExternalOrientation,     /* i  : flag to enable external orientation for this frame                      */
    Word8 enableRotationInterpolation,   /* i  : flag to interpolate rotations from current and previous frames          */
    Word16 numFramesToTargetOrientation, /* i  : number of frames until target orientation is reached                    */
    const Word16 sf_idx                  /* i  : subframe index                                                          */
)
{
    /* Validate function arguments */
    IF( hIvasRend == NULL || hIvasRend->hExternalOrientationData == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    IF( orientation == NULL )
    {
        hIvasRend->hExternalOrientationData->enableExternalOrientation[sf_idx] = 0;
    }
    ELSE
    {
        QuaternionInverse_fx( *orientation, &hIvasRend->hExternalOrientationData->Quaternions[sf_idx] );

        hIvasRend->hExternalOrientationData->enableHeadRotation[sf_idx] = enableHeadRotation;
        hIvasRend->hExternalOrientationData->enableExternalOrientation[sf_idx] = enableExternalOrientation;
        hIvasRend->hExternalOrientationData->enableRotationInterpolation[sf_idx] = enableRotationInterpolation;
        hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[sf_idx] = numFramesToTargetOrientation;
        move16();
    }

    return IVAS_ERR_OK;
}
#else
/*---------------------------------------------------------------------*
 * IVAS_REND_SetReferenceVector( )
 *