Class Animatable

Synopsis

#include <Source/Falcor/Scene/Animation/Animatable.h>

class dlldecl Animatable

Description

Represents an object that has a transform which can be animated using a scene graph node.

Inheritance

Decsendents: Light, Camera

Methods

getNodeIDGets the node ID of the animated scene graph node.
hasAnimationReturns true if object has animation data.
isAnimatedReturns true if object animation is enabled.
setHasAnimationSet if object has animation data.
setIsAnimatedEnable/disable object animation.
setNodeIDSets the node ID of the animated scene graph node.
updateFromAnimationUpdate the transform of the animatable object.

Source

Lines 36-75 in Source/Falcor/Scene/Animation/Animatable.h.

class dlldecl Animatable
{
public:
    // While this is an abstract base class, we still need a holder type (shared_ptr)
    // for pybind11 bindings to work on inherited types.
    using SharedPtr = std::shared_ptr<Animatable>;
    /** Set if object has animation data.
    */
    void setHasAnimation(bool hasAnimation) { mHasAnimation = hasAnimation; }
    /** Returns true if object has animation data.
    */
    bool hasAnimation() const { return mHasAnimation; }
    /** Enable/disable object animation.
    */
    void setIsAnimated(bool isAnimated) { mIsAnimated = isAnimated; }
    /** Returns true if object animation is enabled.
    */
    bool isAnimated() const { return mIsAnimated; }
    /** Sets the node ID of the animated scene graph node.
    */
    void setNodeID(uint32_t nodeID) { mNodeID = nodeID; }
    /** Gets the node ID of the animated scene graph node.
    */
    uint32_t getNodeID() const { return mNodeID; }
    /** Update the transform of the animatable object.
    */
    virtual void updateFromAnimation(const glm::mat4& transform) = 0;
protected:
    bool mHasAnimation = false;
    bool mIsAnimated = true;
    uint32_t mNodeID = uint32_t(-1);
};





Add Discussion as Guest

Log in to DocsForge