vsg 1.1.3
VulkanSceneGraph library
Loading...
Searching...
No Matches
vsg::Animation Class Reference

Animation class that controls a single animation made up of one more samplers. More...

#include <Animation.h>

Inheritance diagram for vsg::Animation:
Collaboration diagram for vsg::Animation:

Public Types

enum  Mode { ONCE , REPEAT , FORWARD_AND_BACK }
 
using Samplers = std::vector<ref_ptr<AnimationSampler>>
 Animation samplers provide the means for mapping the local animation time.
 

Public Member Functions

 Animation (const Animation &rhs, const CopyOp &copyop={})
 
virtual bool start (double simulationTime, double startTime=0.0)
 initialize this animation start time
 
virtual bool update (double simulationTime)
 update the samplers
 
virtual bool stop (double simulationTime)
 signal that this animation is to stop
 
bool active () const
 return true if this animation is being actively updated.
 
virtual double maxTime () const
 compute the max time from the highest time keyframes in the available samplers
 
ref_ptr< Objectclone (const CopyOp &copyop={}) const override
 
int compare (const Object &rhs) const override
 compare two objects, return -1 if this object is less than rhs, return 0 if it's equal, return 1 if rhs is greater,
 
void traverse (Visitor &visitor) override
 
void traverse (ConstVisitor &visitor) const override
 
void read (Input &input) override
 
void write (Output &output) const override
 
- Public Member Functions inherited from vsg::Inherit< Object, Animation >
 Inherit (Args &&... args)
 
std::size_t sizeofObject () const noexcept override
 
const char * className () const noexcept override
 
const std::type_info & type_info () const noexcept override
 
bool is_compatible (const std::type_info &type) const noexcept override
 
int compare (const Object &rhs) const override
 
void accept (Visitor &visitor) override
 
void accept (ConstVisitor &visitor) const override
 
void accept (RecordTraversal &visitor) const override
 
- Public Member Functions inherited from vsg::Object
 Object (const Object &object, const CopyOp &copyop={})
 
Objectoperator= (const Object &)
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
virtual void traverse (RecordTraversal &) const
 
void ref () const noexcept
 
void unref () const noexcept
 
void unref_nodelete () const noexcept
 
unsigned int referenceCount () const noexcept
 
template<typename T >
void setValue (const std::string &key, const T &value)
 
void setValue (const std::string &key, const char *value)
 specialization of setValue to handle passing C strings
 
template<typename T >
bool getValue (const std::string &key, T &value) const
 get specified value type, return false if value associated with key is not assigned or is not the correct type
 
void setObject (const std::string &key, ref_ptr< Object > object)
 assign an Object associated with key
 
ObjectgetObject (const std::string &key)
 get Object pointer associated with key, return nullptr if no object associated with key has been assigned
 
const ObjectgetObject (const std::string &key) const
 get const Object pointer associated with key, return nullptr if no object associated with key has been assigned
 
template<class T >
T * getObject (const std::string &key)
 get object pointer of specified type associated with key, return nullptr if no object associated with key has been assigned
 
template<class T >
const T * getObject (const std::string &key) const
 get const object pointer of specified type associated with key, return nullptr if no object associated with key has been assigned
 
ref_ptr< ObjectgetRefObject (const std::string &key)
 get ref_ptr<Object> associated with key, return nullptr if no object associated with key has been assigned
 
ref_ptr< const ObjectgetRefObject (const std::string &key) const
 get ref_ptr<const Object> pointer associated with key, return nullptr if no object associated with key has been assigned
 
template<class T >
ref_ptr< T > getRefObject (const std::string &key)
 get ref_ptr<T> of specified type associated with key, return nullptr if no object associated with key has been assigned
 
template<class T >
const ref_ptr< const T > getRefObject (const std::string &key) const
 get ref_ptr<const T> of specified type associated with key, return nullptr if no object associated with key has been assigned
 
void removeObject (const std::string &key)
 remove meta object or value associated with key
 
AuxiliarygetOrCreateAuxiliary ()
 
AuxiliarygetAuxiliary ()
 
const AuxiliarygetAuxiliary () const
 

Static Public Member Functions

template<class N , class V >
static void t_traverse (N &node, V &visitor)
 
- Static Public Member Functions inherited from vsg::Inherit< Object, Animation >
static ref_ptr< Animationcreate (Args &&... args)
 
static ref_ptr< Animationcreate_if (bool flag, Args &&... args)
 
- Static Public Member Functions inherited from vsg::Object
static ref_ptr< Objectcreate ()
 
static ref_ptr< Objectcreate_if (bool flag)
 
static void * operator new (std::size_t count)
 provide new and delete to enable custom memory management via the vsg::Allocator singleton, using the MEMORY_AFFINTY_OBJECTS
 
static void operator delete (void *ptr)
 

Public Attributes

std::string name
 
Mode mode = REPEAT
 specify how time value outside the sampler maxTime period is managed
 
double time = 0.0
 local animation time used to look up samplers, automatically updated by the Animation::update(..) method.
 
double speed = 1.0
 speed multiplier for how quickly the Animation::time changes with changes in simulationTime
 
Samplers samplers
 

Protected Attributes

bool _active = false
 
double _previousSimulationTime = 0.0
 
double _maxTime = 0.0
 

Additional Inherited Members

- Protected Member Functions inherited from vsg::Object
virtual void _attemptDelete () const
 
void setAuxiliary (Auxiliary *auxiliary)
 

Detailed Description

Animation class that controls a single animation made up of one more samplers.

Member Function Documentation

◆ clone()

ref_ptr< Object > vsg::Animation::clone ( const CopyOp & copyop = {}) const
inlineoverridevirtual

clone this object using CopyOp's duplicates map to decide whether to clone or to return the original object. The default clone(CopyOp&) implementation simply returns ref_ptr<> to this object rather attempt to clone.

Reimplemented from vsg::Object.

◆ compare()

int vsg::Animation::compare ( const Object & rhs) const
overridevirtual

compare two objects, return -1 if this object is less than rhs, return 0 if it's equal, return 1 if rhs is greater,

Reimplemented from vsg::Object.

◆ read()

void vsg::Animation::read ( Input & input)
overridevirtual

Reimplemented from vsg::Object.

◆ traverse() [1/2]

void vsg::Animation::traverse ( ConstVisitor & visitor) const
inlineoverridevirtual

Reimplemented from vsg::Object.

◆ traverse() [2/2]

void vsg::Animation::traverse ( Visitor & visitor)
inlineoverridevirtual

Reimplemented from vsg::Object.

◆ write()

void vsg::Animation::write ( Output & output) const
overridevirtual

Reimplemented from vsg::Object.


The documentation for this class was generated from the following file: