Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtSlerp
[Math Tools]


Data Structures

struct  RtQuatSlerpArgandCache
struct  RtQuatSlerpCache
struct  RtSlerp

Functions

RtSlerpRtSlerpCreate (RwInt32 nMatRefMask)
RtSlerpRtSlerpInitialize (RtSlerp *spSlerp, RwMatrix *mpMat1, RwMatrix *mpMat2)
void RtSlerpDestroy (RtSlerp *spSlerp)
RwMatrixRtSlerpGetMatrix (RtSlerp *spSlerp, RwMatrix *mpResultMat, RwReal nDelta)
RtSlerpRtSlerpSetLerp (RtSlerp *spSlerp, RwBool bUseLerp)
void RtQuatSetupSlerpCache (RtQuat *qpFrom, RtQuat *qpTo, RtQuatSlerpCache *sCache)
void RtQuatSetupSlerpArgandCache (RtQuat *qpFrom, RtQuat *qpTo, RtQuatSlerpArgandCache *sArgandCache)
void RtQuatSlerp (RtQuat *qpResult, RtQuat *qpFrom, RtQuat *qpTo, RwReal rT, RtQuatSlerpCache *sCache)
void RtQuatSlerpArgand (RtQuat *qpResult, RtQuat *qpFrom, RtQuat *qpTo, RwReal rT, RtQuatSlerpArgandCache *sArgandCache)

Detailed Description

Slerp/Spherical Linear Interpolations Toolkit for RenderWare.

See also http://www.cis.ohio-state.edu/~parent/book/Full.html

RtSlerp Toolkit Overview

Requirements

Overview

The RtSlerp Toolkit provides support for interpolating rotations between two matrices.

After creating an RtSlerp object, the developer then specifies the start and end matrices for the interpolator to work on.

Once set, the developer can then specify an interpolation value and obtain a new matrix generated by interpolating between the supplied start and end matrices.


Function Documentation

void RtQuatSetupSlerpArgandCache RtQuat   qpFrom,
RtQuat   qpTo,
RtQuatSlerpArgandCache   sArgandCache
 

RtQuatSetupSlerpArgandCache sets up some cached values for Argand Quaternion slerping.

Parameters:
qpFrom  initial quaternion
qpTo  final quaternion,
sArgandCache  target slerp cache.
See also:
RtQuatConvertFromMatrix , RtQuatSetupSlerpCache , RtQuatSlerp , RtQuatSlerpArgand

void RtQuatSetupSlerpCache RtQuat   qpFrom,
RtQuat   qpTo,
RtQuatSlerpCache   sCache
 

RtQuatSetupSlerpCache sets up some cached values for Quaternion slerping.

Parameters:
qpFrom  initial quaternion
qpTo  final quaternion,
sCache  target slerp cache.
See also:
RtQuatConvertFromMatrix , RtQuatSetupSlerpArgandCache , RtQuatSlerp , RtQuatSlerpArgand

void RtQuatSlerp RtQuat   qpResult,
RtQuat   qpFrom,
RtQuat   qpTo,
RwReal    rT,
RtQuatSlerpCache   sCache
 

RtQuatSlerp spherically interpolates between two quaternions.

Parameters:
qpResult  target quaternion
qpFrom  initial quaternion
qpTo  final quaternion
rT  parameter for interplotion where
  • 0.0 denotes the initial quaterion
  • 1.0 denotes the final quaternion
sCache  as initialized with RtQuatSetupSlerpCache
See also:
RtQuatSetupSlerpCache , RtQuatSetupSlerpArgandCache , RtQuatSlerpArgand

void RtQuatSlerpArgand RtQuat   qpResult,
RtQuat   qpFrom,
RtQuat   qpTo,
RwReal    rT,
RtQuatSlerpArgandCache   sArgandCache
 

RtQuatSlerpArgand spherically interpolates between two quaternions in an Argand style

Parameters:
qpResult  target quaternion
qpFrom  initial quaternion
qpTo  final quaternion
rT  parameter for interplotion where
  • 0.0 denotes the initial quaterion
  • 1.0 denotes the final quaternion
sArgandCache  as initialized with RtQuatSetupSlerpArgandCache
See also:
RtQuatSetupSlerpCache , RtQuatSetupSlerpArgandCache , RtQuatSlerp

RtSlerp* RtSlerpCreate RwInt32    nMatRefMask
 

RtSlerpCreate is used to create a new spherical linear interpolator, or SLERP, for interpolating rotation matrices. The matrix reference mask specifies whether the start and end matrices are created internally or are referenced externally; this effects how the SLERP is initialized.

The include file rtslerp.h and the library file rtslerp.lib are required to use this function.

Parameters:
nMatRefMask  flags specifying whether to copy or reference the matrices.
  • rtSLERPREFNONE mpMat1 and mpMat2 are preserved
  • rtSLERPREFSTARTMAT mpMat1 may be destroyed
  • rtSLERPREFENDMAT mpMat2 may be destroyed
  • rtSLERPREFALL mpMat1 and mpMat2 are destroyed
These flags are set when RtSlerpInitialize is called.

Returns:
pointer to Slerp data-structure on success; NULL pointer otherwise
See also:
RtSlerpInitialize , RtSlerpDestroy , RtSlerpGetMatrix , RtSlerpSetLerp

void RtSlerpDestroy RtSlerp   spSlerp
 

RtSlerpDestroy frees resources used by a RtSlerp data-structure, including any matrices which it got by copying (as opposed to referencing)

Parameters:
spSlerp  pointer to the data-structure
See also:
RtSlerpCreate , RtSlerpInitialize , RtSlerpGetMatrix , RtSlerpSetLerp

RwMatrix* RtSlerpGetMatrix RtSlerp   spSlerp,
RwMatrix   mpResultMat,
RwReal    nDelta
 

RtSlerpGetMatrix is used to interpolate between the start and end matrices of the specified SLERP using the given interpolation value. An interpolation value of zero will produce the start matrix while a value of one gives the end matrix.

The include file rtslerp.h and the library file rtslerp.lib are required to use this function.

Parameters:
spSlerp  pointer to an input slerp data-structure
mpResultMat  pointer to an output matrix
nDelta  value between 0.0 and 1.0 where
  • 0.0 denotes the initial matrix and
  • 1.0 denotes the final matrix
Returns:
pointer to the matrix on success; NULL pointer otherwise
See also:
RtSlerpCreate , RtSlerpInitialize , RtSlerpDestroy , RtSlerpSetLerp

RtSlerp* RtSlerpInitialize RtSlerp   spSlerp,
RwMatrix   mpMat1,
RwMatrix   mpMat2
 

RtSlerpInitialize initializes a RtSlerp struct with two matrices

Parameters:
spSlerp  the target RtSlerp to initialize
mpMat1  the initial matrix
mpMat2  the final matrix
Returns:
pointer to Slerp data-structure on success; NULL pointer otherwise
See also:
RtSlerpCreate , RtSlerpDestroy , RtSlerpGetMatrix , RtSlerpSetLerp

RtSlerp* RtSlerpSetLerp RtSlerp   spSlerp,
RwBool    useLerp
 

RtSlerpSetLerp is used to toggle the use of spherical and non-spherical linear interpolation on the specified SLERP.

The include file rtslerp.h and the library file rtslerp.lib are required to use this function.

Parameters:
spSlerp  slerp to alter.
useLerp  boolean flag to use linear rather than spherical interpolation
  • TRUE means always use lerps
  • FALSE means use slerps where possible
Returns:
pointer to Slerp data-structure on success; NULL pointer otherwise
See also:
RtSlerpCreate , RtSlerpInitialize , RtSlerpDestroy , RtSlerpGetMatrix


Criterion Software © 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:47:14 2004. Send Feedback