tec::MD5Anim
#include <md5anim.hpp>
Public Classes
Name | |
---|---|
struct | BoundingBox |
struct | Frame |
struct | FrameSkeleton |
struct | Joint |
struct | SkeletonJoint |
Public Functions
Name | |
---|---|
MD5Anim() =default | |
~MD5Anim() =default | |
bool | Parse() Loads the MD5Anim file from disk and parses it. |
void | SetFileName(const Path & fname) Sets the animation filename. |
Path | GetFileName() |
const std::string | GetName() const |
void | SetName(const std::string & _name) |
std::size_t | GetFrameCount() const Returns the number of animation frames. |
int | GetFrameRate() const Returns the number of frame rate per second. |
void | BuildFrameSkeleton(std::size_t frame_index) Builds or rebuilds the FrameSkeleton for a given frame index. |
bool | CheckMesh(std::shared_ptr< MD5Mesh > mesh_file) Checks of a given mesh is valid for this animation. |
void | InterpolatePose(std::vector< AnimationBone > & pose_out, std::size_t frame_index_start, std::size_t frame_index_end, float delta) Gets the interpolated pose skeleton between 2 frames at a given delta. |
std::shared_ptr< MD5Anim > | Create(const Path & fname) Returns a resource with the specified name. |
Public Functions Documentation
function MD5Anim
MD5Anim() =default
function ~MD5Anim
~MD5Anim() =default
function Parse
bool Parse()
Loads the MD5Anim file from disk and parses it.
Return: bool If the animation was valid and loaded correctly.
function SetFileName
inline void SetFileName(
const Path & fname
)
Sets the animation filename.
Parameters:
- const std::string& fname The mesh filename.
Return: bool True if initialization finished with no errors.
This is just a shorthand function that can be called directly via script API.
function GetFileName
inline Path GetFileName()
function GetName
inline const std::string GetName() const
function SetName
inline void SetName(
const std::string & _name
)
function GetFrameCount
inline std::size_t GetFrameCount() const
Returns the number of animation frames.
Return: bool size_t The number of frames.
function GetFrameRate
inline int GetFrameRate() const
Returns the number of frame rate per second.
Return: int The frame rate per second.
function BuildFrameSkeleton
void BuildFrameSkeleton(
std::size_t frame_index
)
Builds or rebuilds the FrameSkeleton for a given frame index.
Parameters:
- size_t frame_index Index of the frame to build/rebuild.
Return: void
function CheckMesh
bool CheckMesh(
std::shared_ptr< MD5Mesh > mesh_file
)
Checks of a given mesh is valid for this animation.
Parameters:
- std::shared_ptr
mesh_file The mesh to check against.
Return: bool True if the mesh is compatible.
function InterpolatePose
void InterpolatePose(
std::vector< AnimationBone > & pose_out,
std::size_t frame_index_start,
std::size_t frame_index_end,
float delta
)
Gets the interpolated pose skeleton between 2 frames at a given delta.
Parameters:
- pose_out array of AnimationBone to store the interpolated pose in.
- frame_index_start The starting frame index.
- frame_index_end The ending frame index.
- delta The change in time since the last call.
function Create
static std::shared_ptr< MD5Anim > Create(
const Path & fname
)
Returns a resource with the specified name.
Parameters:
Return: std::shared_ptr
The only used initialization property is "filename".
Updated on 2022-07-24 at 19:27:35 +0000