22 #include "precompiled.h"
48 size_t startframe = (size_t)(
int)(time/
m_FrameTime);
49 float deltatime = fstartframe-startframe;
53 size_t endframe = startframe + 1;
56 if (!loop && endframe == 0)
74 const Key& startkey =
GetKey(startframe, i);
93 unpacker.
Read(filename,
"PSSA");
134 packer.
Write(pathname);
Key & GetKey(size_t frame, size_t bone)
void Translate(float x, float y, float z)
void UnpackRaw(void *rawData, size_t rawDataSize)
unpack given number of bytes from the input into the given array.
T Interpolate(const T &a, const T &b, float l)
void PackRaw(const void *rawData, size_t rawDataSize)
pack given number of bytes onto the end of the data stream
helper class for reading binary files
void Rotate(const CQuaternion &quat)
helper class for writing binary files.
static void Save(const VfsPath &pathname, const CSkeletonAnimDef *anim)
CMatrix3D ToMatrix() const
void BuildBoneMatrices(float time, CMatrix3D *matrices, bool loop) const
void Read(const VfsPath &filename, const char magic[4])
open and read in given file, check magic bits against those given; throw variety of exceptions if ope...
size_t UnpackSize()
use UnpackRaw to retrieve 32-bits; returns their value as size_t after converting from little endian ...
void UnpackString(CStr8 &result)
unpack a string from the raw data stream.
void Write(const VfsPath &filename)
write out to file all packed data added so far.
void PackSize(size_t value)
convenience: convert a number (almost always a size type) to little-endian u32 and pack that...
static CSkeletonAnimDef * Load(const VfsPath &filename)
void Slerp(const CQuaternion &from, const CQuaternion &to, float ratio)
void PackString(const CStr &str)
pack a string onto the end of the data stream (encoded as a 32-bit length followed by the characters)...