MeshAnimation
The MeshAnimation class represents a collection of transformations applied to a mesh over time, typically used to animate 3D models. It allows for managing and retrieving a series of transformations for multiple nodes or joints within the mesh. The class provides methods to set and retrieve transformations at specific time intervals, including translation, rotation, scale, and morphing. It also supports optimization of transforms and the calculation of bounding boxes for the animated mesh. The MeshAnimation class is designed to efficiently handle complex animations, including looping and applying transformations across multiple mesh nodes or joints.
#include <format/TellusimMesh.h>
Constructors
explicit MeshAnimation(const char *name = nullptr)
explicit MeshAnimation(Mesh &mesh, const char *name = nullptr)
Methods
Clear animation.
void clear()
Animation index.
uint32_t getIndex() const
Animation name.
void setName(const char *name)
String getName() const
Animation mesh.
void setMesh(Mesh &mesh, bool check = true)
const Mesh getMesh() const
Mesh getMesh()
Animation range.
float64_t getMinTime() const
float64_t getMaxTime() const
Animation transforms.
void setNumTransforms(uint32_t num_transforms)
uint32_t getNumTransforms() const
const Array<MeshTransform> getTransforms() const
Array<MeshTransform> getTransforms()
const MeshTransform getTransform(uint32_t node) const
MeshTransform getTransform(uint32_t node)
void setTransform(float64_t time, uint32_t node, Matrix4x3d transform, float32_t threshold = 1e-6f)
void setTranslate(float64_t time, uint32_t node, Vector3d translate, float32_t threshold = 1e-6f)
void setRotate(float64_t time, uint32_t node, Quaternionf rotate, float32_t threshold = 1e-6f)
void setScale(float64_t time, uint32_t node, Vector3f scale, float32_t threshold = 1e-6f)
void setMorph(float64_t time, uint32_t node, Vector4f morph, float32_t threshold = 1e-6f)
Animation transform.
void setTime(float64_t time, Matrix4x3d transform = Matrix4x3d::identity, bool loop = true, float64_t from = -Maxf32, float64_t to = Maxf32)
void setTime(float64_t time, bool loop, float64_t from = -Maxf32, float64_t to = Maxf32)
const Matrix4x3d getLocalTransform(uint32_t node) const
const Matrix4x3d getLocalTransform(const MeshNode &node) const
const Matrix4x3d getLocalTransform(const MeshJoint &joint) const
const Matrix4x3d getGlobalTransform(uint32_t node) const
const Matrix4x3d getGlobalTransform(const MeshNode &node) const
const Matrix4x3d getGlobalTransform(const MeshJoint &joint) const
const Vector4f getMorphTransform(uint32_t node) const
const Vector4f getMorphTransform(const MeshNode &node) const
Animation bound box.
BoundBoxd getBoundBox() const
BoundBoxd getBoundBox(const MeshNode &node) const
BoundBoxd getBoundBox(const MeshGeometry &geometry) const
BoundBoxd getBoundBox(const MeshGeometry &geometry, Vector4f morph) const
Apply transform.
void setTransform(Vector3d scale)
void setTransform(Matrix4x3d transform)
Optimize animation.
void optimizeTransforms(float32_t threshold = 1e-6f)
Memory usage.
size_t getMemory() const