Skip to main content

ObjectAnimation

The ObjectAnimation class represents transformation animations for ObjectNode instances. It allows defining animations for a selected subset of nodes to enable flexible and efficient animation setups. The number of transformations is equal to the number of frames times the number of target nodes.

info

Animations can also be embedded directly into *.scene files.

#include <scene/TellusimObject.h>

Constructors

explicit ObjectAnimation(const char *name = nullptr)
explicit ObjectAnimation(Object &object, const char *name = nullptr)

Methods

Clear animation.

void clear()

Animation unique identifier.

uint32_t getID() const

Animation index.

uint32_t getIndex() const

Animation address.

uint32_t getAddress() const

Animation name.

void setName(const char *name)
void setName(const String &name)
String getName() const

Animation object.

void setObject(Object &object, bool check = true)
const Object getObject() const
Object getObject()

Hidden flag.

void setHidden(bool flag)
bool isHidden() const

Embedded flag.

void setEmbedded(bool flag)
bool isEmbedded() const

Internal flag.

void setInternal(bool flag)
bool isInternal() const

Virtual flag.

void setVirtual(bool flag)
bool isVirtual() const

Changed flag.

void setChanged(bool flag)
bool isChanged() const

Animation fps.

void setFps(float64_t fps)
float64_t getFps() const
float64_t getMaxTime() const

Animation nodes.

void clearNodes()
void shrinkNodes()
void reserveNodes(uint32_t num_nodes)
void setNumNodes(uint32_t num_nodes)
void setNode(uint32_t index, ObjectNode &node)
uint32_t addNode(ObjectNode &node, bool check = true)
bool removeNode(const ObjectNode &node)
uint32_t findNode(const ObjectNode &node) const
uint32_t findNode(const char *name) const
uint32_t getNumNodes() const
const Array<ObjectNode> getNodes() const
Array<ObjectNode> getNodes()
const ObjectNode getNode(uint32_t index) const
ObjectNode getNode(uint32_t index)

Animation frames.

void reserveFrames(uint32_t num_frames)
void setNumFrames(uint32_t num_frames)
void addFrame(Transform *frame)
Transform *addFrame()
uint32_t getNumFrames() const
uint32_t getNumTransforms() const

Animation transforms.

void setTransform(uint32_t frame, uint32_t index, Matrix4x3f transform)
void setTransform(uint32_t frame, uint32_t index, Transform transform)
const Transform getTransform(uint32_t frame, uint32_t index) const
Transform getTransform(uint32_t frame, uint32_t index)
const Transform *getTransforms(uint32_t frame) const
Transform *getTransforms(uint32_t frame)
const Transform *getTransforms() const
Transform *getTransforms()

Load animation.

bool load(const Xml &xml)
bool load(const Json &json)
bool load(Stream &stream)

Save animation.

bool save(Xml &xml) const
bool save(Json &json) const
bool save(Stream &stream) const

Clone animation.

ObjectAnimation clone(Object &object) const

Updated flag.

bool isUpdated() const

Update scene.

void updateScene()

Types

using Transform = ObjectFrame::Transform