49 class SKYLICHT_API CArrayKeyFrame
53 core::array<CKeyFrameData<T>>
Data;
96 return Data.pointer();
105 if (
Data.size() == 0)
108 return Data.getLast().Frame;
115 int foundPositionIndex = -1;
117 int numKey = (int)
Data.size();
123 if (
Hint > 0 && pData[
Hint].Frame >= frame && pData[
Hint - 1].Frame < frame)
124 foundPositionIndex =
Hint;
125 else if (
Hint + 1 < numKey)
127 if (pData[
Hint + 1].Frame >= frame && pData[
Hint + 0].Frame < frame)
130 foundPositionIndex =
Hint;
136 if (foundPositionIndex == -1)
138 for (s32 i = 0; i < numKey; ++i)
140 if (pData[i].Frame >= frame)
142 foundPositionIndex = i;
149 return foundPositionIndex;
156 class SKYLICHT_API CAnimationData
172 class SKYLICHT_API CAnimationTrack
188 virtual ~CAnimationTrack();
197 static void quaternionSlerp(core::quaternion& result, core::quaternion q1, core::quaternion q2,
float t);
207 core::vector3df& position,
208 core::vector3df& scale,
209 core::quaternion& rotation);
224 m_data->Positions.clearHint();
225 m_data->Rotations.clearHint();
226 m_data->Scales.clearHint();
Container for PRS (Position, Rotation, Scale) animation data.
Definition CAnimationTrack.h:157
CAnimationData * m_data
Pointer to the shared animation data.
Definition CAnimationTrack.h:176
bool HaveAnimation
Whether this track currently has animation data.
Definition CAnimationTrack.h:183
CAnimationData * getAnimData()
Gets the underlying animation data.
void getFrameData(f32 frame, core::vector3df &position, core::vector3df &scale, core::quaternion &rotation)
Calculates the interpolated PRS data for a specific frame.
void setAnimationData(CAnimationData *data)
Sets the source animation data for this track.
Definition CAnimationTrack.h:239
void clearAllKeyFrame()
Clears all keyframe search hints and resets the track.
Definition CAnimationTrack.h:220
std::string Name
The name of the track.
Definition CAnimationTrack.h:180
CAnimationData * getFrameData()
Gets the underlying animation data.
Definition CAnimationTrack.h:248
static void quaternionSlerp(core::quaternion &result, core::quaternion q1, core::quaternion q2, float t)
Static utility for spherical linear interpolation between quaternions.
Container for an array of keyframes with interpolation support.
Definition CAnimationTrack.h:50
int Hint
Internal hint for optimizing keyframe searching.
Definition CAnimationTrack.h:59
CKeyFrameData< T > * pointer()
Returns the raw pointer to the keyframe data.
Definition CAnimationTrack.h:94
void clearHint()
Resets the search hint.
Definition CAnimationTrack.h:69
int getIndex(f32 frame)
Finds the index of the keyframe at or just before the specified time.
Definition CAnimationTrack.h:113
T Default
Default value used if no keyframes are present.
Definition CAnimationTrack.h:56
f32 getLastFrame()
Gets the time of the last keyframe.
Definition CAnimationTrack.h:103
u32 size()
Gets the number of keyframes.
Definition CAnimationTrack.h:85
core::array< CKeyFrameData< T > > Data
List of keyframes, sorted by time.
Definition CAnimationTrack.h:53
Template for keyframe data.
Definition CAnimationTrack.h:33
f32 Frame
Definition CAnimationTrack.h:36
core::vector3df Value
Definition CAnimationTrack.h:39
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29