![]()
gePath
Description: Time-indexed keyframe creation, maintenance, and sampling.
Source file: …\genesis3d\OpenSource\Source\Actor\bodyinst.h
Functions:
Create, CreateCopy, CreateFromFile, CreateRef, Destroy, DeleteKeyframe, GetKeyframe, GetKeyframeCount, GetKeyframeIndex, GetTimeExtents, InsertKeyframe, ModifyKeyframe, OffsetTimes, Sample, SampleChannels, WriteToBinaryFile, WriteToFileTypes:
gePath, gePath_InterpolatorConstants:
viewAdditions for Genesis3D v1.6: None
![]()
#define GE_PATH_ROTATION_CHANNEL 1
Return to Contents
![]()
Types:
typedef struct _gePath gePath;
NOTE: The contents of this structure have been intentionally left out of the interface, by the designers of this module. Think of this as a handle only.
Return to Contents
typedef enum{
GE_PATH_INTERPOLATE_LINEAR = 0, // linear blend for translation or rotation channel
GE_PATH_INTERPOLATE_HERMITE, // hermite cubic spline for translation channel
GE_PATH_INTERPOLATE_SLERP, // spherical-linear blend for rotation channel
GE_PATH_INTERPOLATE_SQUAD, // higher order blend for rotation channel 'G1' continuity
//GE_PATH_INTEROPLATE_TRIPOD, // not supported yet.
GE_PATH_INTERPOLATE_HERMITE_ZERO_DERIV = 7 // hermite cubic with zero derivative at keyframes ('easing' curve)
}gePath_Interpolator;
Return to Contents
![]()
Functions:
![]()
GENESISAPI gePath* GENESISCC gePath_Create(gePath_Interpolator TranslationInterpolation, gePath_Interpolator RotationInterpolation, geBoolean Looped);
This function creates a newgePath with the specified gePath_Interpolators for TranslationInterpolation and RotationInterpolation. If Looped is GE_TRUE then the path is a looped path in which case the first and last points of the path should be identical.
Returns: the newly createdgePath.
Notes:
Return to Contents
![]()
GENESISAPI gePath* GENESISCC gePath_CreateCopy(const gePath* P);
This function creates a newgePath as a copy of the specified gePath.
Returns: the newly createdgePath.
Return to Contents
![]()
GENESISAPI gePath* GENESISCC gePath_CreateFromFile(geVFile* F);
This function creates a newgePath from the specifed geVFile which may be either a binary or ascii path file.
Returns: the newly createdgePath.
Notes:
Return to Contents
![]()
GENESISAPI void GENESISCC gePath_CreateRef(gePath* P);
This function increases the reference count for the specifedgePath object by one.
Returns: nothing.
Return to Contents
![]()
GENESISAPI void GENESISCC gePath_Destroy(gePath** PP);
This function decreases the reference count for the specifiedgePath by one. If the reference count reaches zero then all resources for the gePath are released.
Return: nothing.
Notes:
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_DeleteKeyframe(gePath* P, int Index, int ChannelMask);
This function deletes the channels specifed by the ChannelMask from the Index indexed keyframe ofgePath P.
Returns:GE_TRUE on success, GE_FALSE otherwise.
Notes:
Return to Contents
![]()
GENESISAPI void GENESISCC gePath_GetKeyframe(const gePath* P, int Index, int Channel, geFloat* Time, geXForm3d* Matrix);
This function returns a transformation matrix in Matrix for specified index Index and channel mask Channel of thegePath P. The time for the specified index is also return in Time.
Returns: nothing.
Notes:
Return to Contents
![]()
GENESISAPI int GENESISCC gePath_GetKeyframeCount(const gePath* P, int Channel);
This function returns the number of keyframes of type Channel defined ingePath P.
Returns: the result.
Notes:
Return to Contents
![]()
GENESISAPI int GENESISCC gePath_GetKeyframeIndex(const gePath* P, int Channel, geFloat Time);
This function returns the index for the keyframe of type Channel at time Time ofgePath P. If no keyframe exists for the specifed time and channel, -1 is returned. Note that Channel must be either GE_PATH_ROTATION_CHANNEL or GE_PATH_TRANSLATION_CHANNEL.
Returns: the index, or -1 if specifed keyframe does not exist.
Notes:
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_GetTimeExtents(const gePath* P, geFloat* StartTime, geFloat* EndTime);
This function gets the start and end times for the givengePath P.
Returns:GE_TRUE if keys are defined in P, GE_FALSE and no times if there are no keys defined in the path.
Notes:
Questions:
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_InsertKeyframe(gePath* P, int ChannelMask, geFloat Time, const geXForm3d* Matrix);
This function creates a new keyframe in path P at time T for the channel(s) specified Time as defined by the transform Matrix.
Returns:GE_TRUE on success, GE_FALSE otherwise.
Notes:
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_ModifyKeyframe(gePath* P, int Index, int ChannelMask, const geXForm3d* Matrix);
This function updates the keyframe in path P at index Index for the specified channel(s) as defined by the transform Matrix.
Returns:GE_TRUE on success, GE_FALSE otherwise.
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_OffsetTimes(gePath* P, int StartingIndex, int ChannelMask, geFloat TimeOffset);
This function adjusts the time of all keyframes in path P of type ChannelMask starting with StartingIndex to the last frame by TimeOffset.
Returns:GE_TRUE on success, GE_FALSE otherwise.
Notes:
Questions:
Return to Contents
![]()
GENESISAPI void GENESISCC gePath_Sample(const gePath* P, geFloat Time, geXForm3d* Matrix);
This function returns the transformation Matrix for the path P at time Time.
Returns: nothing.
Notes:
Return to Contents
![]()
This function returns the Rotation and Translation for the path P at time Time.
Returns: nothing.
Notes:
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_WriteToBinaryFile(const gePath* P, geVFile* F);
This function writesgePath P out to geVFile F in binary format.
Returns:GE_TRUE on success, GE_FALSE otherwise.
Notes:
Return to Contents
![]()
GENESISAPI geBoolean GENESISCC gePath_WriteToFile(const gePath* P, geVFile* F);
This function writesgePath P out to geVFile in ascii format.
Returns:GE_TRUE on success, GE_FALSE otherwise.
Notes:
Return to Contents
![]()