Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
C3DKeyframable Class Reference

This is the base class for any object that can be animated using C3DKeyframe. More...

Detailed Description

This is the base class for any object that can be animated using C3DKeyframe.

The C3DSceneNode derived from this class and handles KEYFRAME_MATRIX, KEYFRAME_SCALE, KEYFRAME_ROT, KEYFRAME_TRANS keyframes. It is possible to add / remove keyframe of any kind and to evaluate the interpolation of 2 keyframes

#include <3DAnimatable.h>

Inheritance diagram for C3DKeyframable:
C3DAnimatable C3DMaterial C3DSceneNode CMaterialMap C3DPbrMaterial C3DStandardMaterial

Public Types

enum  TimeStamp { INVALID_TIME = -1 }
 
enum  KeyframeFlags { KEYFRAME_NONE = 0x00 , KEYFRAME_REPLACE_KEY = 0x01 , KEYFRAME_DONT_EVALUATE = 0x02 }
 
typedef enum C3DKeyframable::TimeStamp TimeStamp
 
- Public Types inherited from C3DAnimatable
enum  FindKey { KEYFRAME_PREV = 0x01 , KEYFRAME_NEXT = 0x02 , KEYFRAME_SAME = 0x04 }
 

Public Member Functions

int AddKey (int time, C3DKeyframe *newkey)
 Return -1 if fails or keyframe number.
 
int AddKey (int time, const C3DKeyframe &newkey)
 Return keyframe number.
 
int DeleteKey (int time, longuint classid=KEYFRAME_NULLID)
 If time = INVALID_TIME, then all key of classid are deleted or all keys are deleted if classid = KEYFRAME_NULLID.
 
void DeleteAllKeys ()
 
C3DKeyframeCreateKey (int time, longuint classid, unsigned int flags=KEYFRAME_NONE)
 Create key of the given classid. flags is one or more KeyframeFlags.
 
C3DKeyframeGetKeyByIndex (unsigned int index, int *time=NULL, longuint classid=KEYFRAME_NULLID)
 This invalidate the cache, and can lead to slower computation.
 
const C3DKeyframeGetConstKeyByIndex (unsigned int index, int *time=NULL, longuint classid=KEYFRAME_NULLID) const
 
int GetKeyNbr (longuint classid=KEYFRAME_NULLID) const
 
bool Evaluate (int time, C3DKeyframe &findkey) const
 This method evaluate the key at the given time. Same but slower that the following method that return a pointer.
 
const C3DKeyframeEvaluate (int time, longuint classid) const
 This method evaluate the key at the given time. This is the fastest method. The key content cannot be changed.
 
int CopyKeys (const C3DKeyframable *srckeys, longuint classid=KEYFRAME_NULLID, CTimeRange range=CTimeRange(0, CTimeRange::MAX_TIME))
 Copy key of the given classid in the given time range.
 
bool operator== (const C3DKeyframable &refkeys) const
 
bool operator= (const C3DKeyframable &key)
 
virtual void Serialize (CXArchive &ar)
 
virtual void OnKeyframesChanged (longuint classID) const
 
virtual CTimeRange GetTimeRange (longuint classid=KEYFRAME_NULLID) const
 
virtual const C3DKeyframeGetConstKey (int time, unsigned int findKeyFlag, longuint classid=KEYFRAME_NULLID, int *findKeyTime=NULL) const
 Retrieve a keyframe at / before or after the specified time depending on findKeyFlag.
 
- Public Member Functions inherited from C3DAnimatable
int GetKeyTime (int time, unsigned int pos, longuint classid=KEYFRAME_NULLID)
 

Member Enumeration Documentation

◆ KeyframeFlags

Enumerator
KEYFRAME_REPLACE_KEY 

The created keyframe replaces the previous one.

KEYFRAME_DONT_EVALUATE 

The created is not evaluate during creation. If not specified, the created keyframe is the interpolation of the adjacent keyframes.

Member Function Documentation

◆ GetConstKey()

virtual const C3DKeyframe * C3DKeyframable::GetConstKey ( int  time,
unsigned int  findKeyFlag,
longuint  classid = KEYFRAME_NULLID,
int findKeyTime = NULL 
) const
virtual

Retrieve a keyframe at / before or after the specified time depending on findKeyFlag.

Implements C3DAnimatable.

◆ GetTimeRange()

virtual CTimeRange C3DKeyframable::GetTimeRange ( longuint  classid = KEYFRAME_NULLID) const
virtual

Implements C3DAnimatable.


The documentation for this class was generated from the following file: