Emergency 2017 Dokumentation  v3.0.1
qsf::MeshAnimationComponent Class Reference

Mesh animation component class. More...

#include <MeshAnimationComponent.h>

Classes

struct  LastAnimatonData
 

Public Types

enum  BlendSynchronization { SYNC_NONE, SYNC_AT_START, SYNC_AT_END, SYNC_PARALLEL }
 
enum  BoneRetargeting { ANIMATION_BONE_RETARGETING, ANIMATION_BONE_SCALE_RETARGETING }
 Bone retargeting. More...
 
enum  AnimationType {
  ANIMATION_TYPE_NONE, ANIMATION_TYPE_STOP_ALL, ANIMATION_TYPE_PLAY_SINGLE, ANIMATION_TYPE_PLAY_MASK,
  ANIMATION_TYPE_BLEND_SINGLE, ANIMATION_TYPE_BLEND_MASK
}
 
typedef boost::container::flat_map< uint32, MeshAnimationChannel * > ChannelMap
 
- Public Types inherited from qsf::Component
enum  TransformChangeFlag {
  TRANSFORM_CHANGE_POSITION = 0x01, TRANSFORM_CHANGE_ROTATION = 0x02, TRANSFORM_CHANGE_SCALE = 0x04, TRANSFORM_CHANGE_TRANSFORM = 0x07,
  TRANSFORM_CHANGE_FOR_SIMULATION = 0x08, TRANSFORM_CHANGE_FOR_ANIMATION = 0x10
}
 
typedef BitFlagSet< uint8, TransformChangeFlagTransformChangeFlags
 
- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 
- Public Types inherited from qsf::MovableObjectRenderingListener
enum  State { SLEEPING, AWAKE }
 State of the listener. More...
 

Public Member Functions

 MeshAnimationComponent (Prototype *prototype)
 Constructor. More...
 
virtual ~MeshAnimationComponent ()
 Destructor. More...
 
void stopAllAnimations ()
 Stop all animations currently playing. More...
 
MeshAnimationChannelplayAnimation (const AssetProxy &animationAsset, bool loop, bool reverse=false, BoneRetargeting boneTranslationRetargeting=ANIMATION_BONE_SCALE_RETARGETING)
 Play a new animation, replacing the existing one. More...
 
std::pair< MeshAnimationChannel *, MeshAnimationChannel * > playMaskedAnimation (const AssetProxy &animationAsset1, const AssetProxy &animationAsset2, const std::vector< std::string > &boneMask, bool loop, bool reverse1=false, bool reverse2=false, BoneRetargeting boneTranslationRetargeting1=ANIMATION_BONE_SCALE_RETARGETING, BoneRetargeting boneTranslationRetargeting2=ANIMATION_BONE_SCALE_RETARGETING)
 Play 2 new masked animation, replacing the existing one. More...
 
MeshAnimationChannelblendToAnimation (const AssetProxy &animationAsset, bool loop, Time blendLength, bool reverse=false, BlendSynchronization blendSync=SYNC_NONE, BoneRetargeting boneTranslationRetargeting=ANIMATION_BONE_SCALE_RETARGETING)
 Play a new animation, blending from the existing one (if there is one) More...
 
std::pair< MeshAnimationChannel *, MeshAnimationChannel * > blendToMaskedAnimation (const AssetProxy &animationAsset1, const AssetProxy &animationAsset2, const std::vector< std::string > &boneMask, bool loop, Time blendLength, bool reverse1=false, bool reverse2=false, BlendSynchronization blendSync=SYNC_NONE, BoneRetargeting boneTranslationRetargeting1=ANIMATION_BONE_SCALE_RETARGETING, BoneRetargeting boneTranslationRetargeting2=ANIMATION_BONE_SCALE_RETARGETING)
 Play a new animation, blending from the existing one (if there is one) More...
 
bool isPlaying () const
 Return the current playback state. More...
 
bool isAnimationPlaying (const AssetProxy &animationAsset) const
 Check whether the given animation is current playing. More...
 
const ChannelMapgetChannels () const
 
void resetAnimationBindingNextTime ()
 Next time an animation is played the binding will be updated. More...
 
bool isDoAlwaysUpdateAnimation () const
 Return whether or not the animation is always updated, regardless of whether or not it's visible. More...
 
void setDoAlwaysUpdateAnimation (bool doAlwaysUpdateAnimation)
 Return whether or not the animation is always updated, regardless of whether or not it's visible. More...
 
Ogre::v1::OldBone * manualBoneControl (const std::string &boneName, bool manualControl, MeshAnimationChannel *channelForMaskedBone=nullptr) const
 Set if we want to manually control a bone. More...
 
bool isBone (const std::string &boneName) const
 Check if a bone with bone name exists. More...
 
MeshAnimationChannelgetAnimationChannel (const AssetProxy &animationAsset) const
 Get an animation channel of a given asset if possible. More...
 
const std::string & getCurrentAnimation () const
 Return the skeleton local asset name of the first channel. More...
 
std::string getDebugStringFirstChannel () const
 Return the skeleton asset name of the first channel, plus debug information like the current play position. More...
 
const LastAnimatonDatagetLastAnimationData () const
 Returns the last animation data. More...
 
void enforceGraphicsSynchronization ()
 Enforce graphics synchronization. More...
 
- Public Member Functions inherited from qsf::Component
virtual ~Component ()
 Destructor. More...
 
PrototypegetPrototype () const
 Return the prototype this component is in. More...
 
EntitygetEntity () const
 Return a reference to the entity this component is in. More...
 
uint32 getId () const
 Return the unique component identifier. More...
 
ComponentManagergetComponentManager () const
 Return the component manager that's responsible for this component instance. More...
 
ComponentCollectiongetComponentCollection () const
 Return the component collection that's responsible for this component instance. More...
 
bool isSimulating () const
 Return whether or not the component is in simulating mode. More...
 
bool isActive () const
 Return whether or not the component is considered to be active. More...
 
void setActive (bool active)
 Set whether or not the component is considered to be active. More...
 
bool isDebug () const
 Return whether or not the component is considered to be in debug mode. More...
 
bool isHidden () const
 Return whether or not the component is hidden. More...
 
void setHidden (bool hidden)
 Set whether or not the component is hidden. More...
 
bool isGloballyHidden () const
 Return whether or not the component is globally hidden. More...
 
void setGloballyHidden (bool globallyHidden)
 Set whether or not the component is globally hidden. More...
 
bool isReallyHidden () const
 Return whether or not the component is really hidden. More...
 
bool startup ()
 Startup the component. More...
 
bool isRunning () const
 Return whether or not the component is up-and-running. More...
 
void shutdown ()
 Shutdown the component. More...
 
uint64 getPrototypeId () const
 Return the ID of the prototype this component is in. More...
 
uint64 getEntityId () const
 Return the ID of the entity this component is in. More...
 
virtual void onInvalidation ()
 Invalidate the component. More...
 
virtual void setDebug (bool debugMode)
 Set whether or not the component is considered to be in debug mode. More...
 
virtual void serialize (BinarySerializer &serializer)
 Serialize or deserialize the component using a binary serializer. More...
 
- Public Member Functions inherited from qsf::InheritedObject
void copyPropertyOverrideStateFrom (const InheritedObject &object, bool add=false)
 
void setAllPropertyOverrideFlags (bool value)
 
void autoCreatePropertyOverrideState ()
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const override
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const override
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState) override
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 
- Public Member Functions inherited from qsf::JobProxyMovableObjectRenderingListener
 JobProxyMovableObjectRenderingListener ()
 Constructor. More...
 
virtual ~JobProxyMovableObjectRenderingListener ()
 Destructor. More...
 
const TimegetNonvisibleUpdateTimeout () const
 Return the nonvisible update timeout. More...
 
void setNonvisibleUpdateTimeout (const Time &nonvisibleUpdateTimeout)
 Set the nonvisible update timeout. More...
 
- Public Member Functions inherited from qsf::MovableObjectRenderingListener
 MovableObjectRenderingListener ()
 Constructor. More...
 
virtual ~MovableObjectRenderingListener ()
 Destructor. More...
 
bool isMovableObjectRenderingListenerRegistered () const
 Return whether or not the movable object rendering listener is registered. More...
 
State getState () const
 Return the state of the listener. More...
 

Static Public Attributes

static const uint32 COMPONENT_ID
 "qsf::MeshAnimationComponent" unique component ID More...
 
- Static Public Attributes inherited from qsf::Component
static const uint32 COMPONENT_ID
 "qsf::Component" unique component ID More...
 

Protected Member Functions

virtual const NamedIdentifiergetAnimationJobManagerId () const
 
virtual void onUpdateMovableObjectRenderingJob (const JobArguments &jobArguments) override
 Main update function that is passed to the job manager. More...
 
virtual ComponentgetMovableObjectRenderingListenerComponent () override
 Return the component the listener will spy on. More...
 
virtual void onObjectRenderingStartup () override
 Called when an OGRE movable object is about to be rendered for the first time after it has not been rendered for some time. More...
 
virtual void onObjectRenderingShutdown () override
 Called when an OGRE movable object is no longer be rendered for some time. More...
 
virtual void onShutdown () override
 Shutdown the component. More...
 
virtual bool implementsOnComponentPropertyChange () const override
 Signal whether this component needs the "onComponentPropertyChange" callback at all. More...
 
virtual void onComponentPropertyChange (const Component &component, uint32 propertyId) override
 Called in case a component property value was changed. More...
 
- Protected Member Functions inherited from qsf::Component
 Component (Prototype *prototype)
 Constructor. More...
 
void promotePropertyChange (uint32 propertyId)
 A component property value was changed. More...
 
template<typename T , typename S >
bool assignAndPromoteChange (T &variable, const S &newValue, uint32 propertyId)
 Comfort function for updating an exported member variable and promoting any change that happened. More...
 
void setRegisterForSimulationTransformChanges (bool enable)
 Register or unregister this component as simulation transform listener. More...
 
void setRegisterForAnimationTransformChanges (bool enable)
 Register or unregister this component as animation transform listener. More...
 
virtual const ObjectgetPropertyDefaultsProvider () const override
 
virtual void onComponentTransformChange (const Transform &transform, TransformChangeFlags flags)
 Called in case a component transformation value was changed. More...
 
virtual void onSetSimulating (bool simulating)
 Set whether or not the component is in simulating mode. More...
 
virtual void onSetActive (bool active)
 Set whether or not the component is considered to be active. More...
 
virtual void onSetDebug (bool debug)
 Set whether or not the component is considered to be in debug mode. More...
 
virtual void onSetHidden (bool hidden)
 Set whether or not the component is considered to be hidden. More...
 
virtual bool onStartup ()
 Startup the component. More...
 
- Protected Member Functions inherited from qsf::InheritedObject
 InheritedObject ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 
 ~WeakPtrTarget ()
 Destructor. More...
 
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
 
void operator= (const WeakPtrTarget &other)
 Copy operator. More...
 
- Protected Member Functions inherited from qsf::JobProxyMovableObjectRenderingListener
virtual void onObjectRendering (const Component &component, const Ogre::Camera &ogreCamera) override
 Called when an OGRE movable object of the camera to be used for rendering. More...
 
- Protected Member Functions inherited from qsf::MovableObjectRenderingListener
virtual void registerMovableObjectRenderingListener ()
 Register movable object rendering listener. More...
 
virtual void unregisterMovableObjectRenderingListener ()
 Unregister movable object rendering listener. More...
 
virtual void onObjectDestroyed ()
 Movable object has been destroyed. More...
 

Friends

class MeshComponent
 

Additional Inherited Members

- Protected Attributes inherited from qsf::InheritedObject
std::bitset< 128 > mPropertyOverrideFlags
 One bit for each property; if set, the property is overridden. More...
 
- Protected Attributes inherited from qsf::JobProxyMovableObjectRenderingListener
JobProxy mAnimationJobProxy
 Regular animation job proxy; for updates once a frame. More...
 
- Protected Attributes inherited from qsf::MovableObjectRenderingListener
bool mAllowRegistration = true
 

Detailed Description

Mesh animation component class.

Note
  • Not derived from "qsf::RendererComponent" by intent because it's a logic update and nothing directly visible on the screen
Todo:
  • TODO(fw): Add more getters like get remaining / absolute play length or access the current animation
  • TODO(fw): A method enqueueBlendToAnimation would be nice, to support several animations or blends one after another

Definition at line 63 of file MeshAnimationComponent.h.

Member Typedef Documentation

Definition at line 79 of file MeshAnimationComponent.h.

Member Enumeration Documentation

Enumerator
ANIMATION_TYPE_NONE 

No animation where started.

ANIMATION_TYPE_STOP_ALL 

All running animations were explicit stopped.

ANIMATION_TYPE_PLAY_SINGLE 

Animation started via playAnimation.

ANIMATION_TYPE_PLAY_MASK 

Animation started via playMaskedAnimation.

ANIMATION_TYPE_BLEND_SINGLE 

Animation started via blendToAnimation.

ANIMATION_TYPE_BLEND_MASK 

Animation started via blendToMaskedAnimation.

Definition at line 99 of file MeshAnimationComponent.h.

Enumerator
SYNC_NONE 

Don't sync blended animation with already running animation.

SYNC_AT_START 

Start blended animation in sync with the already running animation's next loop start.

SYNC_AT_END 

Start blended animation so that blending ends at the already running animation's next loop start.

SYNC_PARALLEL 

Blend immediately, but copy the playback offset from the already running animation.

Definition at line 81 of file MeshAnimationComponent.h.

Bone retargeting.

Enumerator
ANIMATION_BONE_RETARGETING 

Use the original bone translation from the animation skeleton keyframes.

ANIMATION_BONE_SCALE_RETARGETING 

Scale the bone translation from the animation skeleton keyframes so it matches the target mesh skeleton without distorting it.

Definition at line 93 of file MeshAnimationComponent.h.

Constructor & Destructor Documentation

qsf::MeshAnimationComponent::MeshAnimationComponent ( Prototype prototype)
inlineexplicit

Constructor.

Parameters
[in]prototypeThe prototype this component is in, no null pointer allowed

Definition at line 14 of file MeshAnimationComponent-inl.h.

qsf::MeshAnimationComponent::~MeshAnimationComponent ( )
inlinevirtual

Destructor.

Definition at line 26 of file MeshAnimationComponent-inl.h.

Member Function Documentation

MeshAnimationChannel* qsf::MeshAnimationComponent::blendToAnimation ( const AssetProxy animationAsset,
bool  loop,
Time  blendLength,
bool  reverse = false,
BlendSynchronization  blendSync = SYNC_NONE,
BoneRetargeting  boneTranslationRetargeting = ANIMATION_BONE_SCALE_RETARGETING 
)

Play a new animation, blending from the existing one (if there is one)

Parameters
[in]animationAssetThe skeleton asset to use as animation
[in]loopSet to "true" for a looped animation, "false" otherwise
[in]blendLengthThe blend time duration
[in]reverseSet to "true" for a reversed animation playback, "false" otherwise
[in]blendSyncBlend synchronization mode to use
[in]boneTranslationRetargetingBone translation retargeting to use
Returns
The newly created mesh animation channels; may be a null pointers, only temporarily use this instance pointers and do not store them (WeakPtr is okay)
std::pair<MeshAnimationChannel*, MeshAnimationChannel*> qsf::MeshAnimationComponent::blendToMaskedAnimation ( const AssetProxy animationAsset1,
const AssetProxy animationAsset2,
const std::vector< std::string > &  boneMask,
bool  loop,
Time  blendLength,
bool  reverse1 = false,
bool  reverse2 = false,
BlendSynchronization  blendSync = SYNC_NONE,
BoneRetargeting  boneTranslationRetargeting1 = ANIMATION_BONE_SCALE_RETARGETING,
BoneRetargeting  boneTranslationRetargeting2 = ANIMATION_BONE_SCALE_RETARGETING 
)

Play a new animation, blending from the existing one (if there is one)

Parameters
[in]animationAsset1The skeleton asset to use as animation 1 (mask defines bones we use)
[in]animationAsset2The skeleton asset to use as animation 2 (mask defines bones we don't use)
[in]boneMaskList of bone names we want to mask with all child bones (no holes of empty strings, please)
[in]loopSet to "true" for a looped animation, "false" otherwise
[in]blendLengthThe blend time duration
[in]reverse1Set to "true" for a reversed animation 1 playback, "false" otherwise
[in]reverse2Set to "true" for a reversed animation 2 playback, "false" otherwise
[in]blendSyncBlend synchronization mode between the 2 animation
[in]boneTranslationRetargeting1Bone translation retargeting to use
[in]boneTranslationRetargeting2Bone translation retargeting to use
Returns
The newly created mesh animation channels; may be a null pointers, only temporarily use this instance pointers and do not store them (WeakPtr is okay)
void qsf::MeshAnimationComponent::enforceGraphicsSynchronization ( )

Enforce graphics synchronization.

Note
  • There are rare situations were one needs the current bone position of an animated skeleton, call this method to ensure the bone is updated
  • For performance reasons, do not overuse this method
MeshAnimationChannel* qsf::MeshAnimationComponent::getAnimationChannel ( const AssetProxy animationAsset) const

Get an animation channel of a given asset if possible.

Parameters
[in]animationAssetThe skeleton asset of the animation we want to get
Returns
Pointer to the animation channel, can be a null pointer
virtual const NamedIdentifier& qsf::MeshAnimationComponent::getAnimationJobManagerId ( ) const
protectedvirtual
const MeshAnimationComponent::ChannelMap & qsf::MeshAnimationComponent::getChannels ( ) const
inline

Definition at line 31 of file MeshAnimationComponent-inl.h.

const std::string& qsf::MeshAnimationComponent::getCurrentAnimation ( ) const

Return the skeleton local asset name of the first channel.

std::string qsf::MeshAnimationComponent::getDebugStringFirstChannel ( ) const

Return the skeleton asset name of the first channel, plus debug information like the current play position.

const MeshAnimationComponent::LastAnimatonData & qsf::MeshAnimationComponent::getLastAnimationData ( ) const
inline

Returns the last animation data.

Definition at line 46 of file MeshAnimationComponent-inl.h.

virtual Component* qsf::MeshAnimationComponent::getMovableObjectRenderingListenerComponent ( )
overrideprotectedvirtual

Return the component the listener will spy on.

Returns
The component the listener will spy on, can be a null pointer, do not destroy the instance
Note
  • The default implementation is empty and returns a null pointer
  • Ease of use method in case a listener just listens to a single movable object (the common use case)

Reimplemented from qsf::MovableObjectRenderingListener.

virtual bool qsf::MeshAnimationComponent::implementsOnComponentPropertyChange ( ) const
inlineoverrideprotectedvirtual

Signal whether this component needs the "onComponentPropertyChange" callback at all.

Returns
If "true", this component can receive property change callbacks, otherwise "onComponentPropertyChange" won't get called

Reimplemented from qsf::Component.

Definition at line 426 of file MeshAnimationComponent.h.

bool qsf::MeshAnimationComponent::isAnimationPlaying ( const AssetProxy animationAsset) const

Check whether the given animation is current playing.

Parameters
[in]animationAssetThe animation skeleton asset
Returns
"true" if the animation is playing or enqueued at the moment, "false" otherwise
bool qsf::MeshAnimationComponent::isBone ( const std::string &  boneName) const

Check if a bone with bone name exists.

Parameters
[in]boneNameName of the bone we want to check
Returns
"true" if the skeleton has a bone with our name, else "false"
bool qsf::MeshAnimationComponent::isDoAlwaysUpdateAnimation ( ) const
inline

Return whether or not the animation is always updated, regardless of whether or not it's visible.

Definition at line 41 of file MeshAnimationComponent-inl.h.

bool qsf::MeshAnimationComponent::isPlaying ( ) const

Return the current playback state.

Returns
"true" if any animation is playing or enqueued at the moment, "false" otherwise
Ogre::v1::OldBone* qsf::MeshAnimationComponent::manualBoneControl ( const std::string &  boneName,
bool  manualControl,
MeshAnimationChannel channelForMaskedBone = nullptr 
) const

Set if we want to manually control a bone.

Parameters
[in]boneNameName of the bone we want to have full control
[in]manualControlIf we want to manually control the bone or not
[in]channelForMaskedBoneThe channel we want to set the mask to 1 when we set the bone to not be manually controlled
Returns
Pointer to the bone, don't destroy it
virtual void qsf::MeshAnimationComponent::onComponentPropertyChange ( const Component component,
uint32  propertyId 
)
overrideprotectedvirtual

Called in case a component property value was changed.

Parameters
[in]componentComponent instance which had a property value change
[in]propertyIdUnique class property ID the component property which values was changed
Note
  • The default implementation is empty
  • The unique class property identifier is generated by "qsf::StringHash" by using the class property name (e.g. qsf::StringHash("Position") generating the hash value 3091144222)

Reimplemented from qsf::Component.

virtual void qsf::MeshAnimationComponent::onObjectRenderingShutdown ( )
overrideprotectedvirtual

Called when an OGRE movable object is no longer be rendered for some time.

Note
  • The default implementation is sets the listener state to sleeping
  • Automatically called in case the listener is unregistered while not sleeping, derived listeners with additional logic might e.g. call this method in case the object has not been visible for a certain amount of time

Reimplemented from qsf::JobProxyMovableObjectRenderingListener.

virtual void qsf::MeshAnimationComponent::onObjectRenderingStartup ( )
overrideprotectedvirtual

Called when an OGRE movable object is about to be rendered for the first time after it has not been rendered for some time.

Note
  • The default implementation is empty

Reimplemented from qsf::JobProxyMovableObjectRenderingListener.

void qsf::MeshAnimationComponent::onShutdown ( )
inlineoverrideprotectedvirtual

Shutdown the component.

Note
  • Only called in case "onStartup()" returned successfully
  • The default implementation is empty

Reimplemented from qsf::Component.

Reimplemented in qsf::MeshAnimationTestComponent.

Definition at line 55 of file MeshAnimationComponent-inl.h.

virtual void qsf::MeshAnimationComponent::onUpdateMovableObjectRenderingJob ( const JobArguments jobArguments)
overrideprotectedvirtual

Main update function that is passed to the job manager.

Parameters
[in]jobArgumentsJob arguments
Note
  • The default implementation checks the time since last visible and puts the listener to sleep if required

Reimplemented from qsf::JobProxyMovableObjectRenderingListener.

MeshAnimationChannel* qsf::MeshAnimationComponent::playAnimation ( const AssetProxy animationAsset,
bool  loop,
bool  reverse = false,
BoneRetargeting  boneTranslationRetargeting = ANIMATION_BONE_SCALE_RETARGETING 
)

Play a new animation, replacing the existing one.

Parameters
[in]animationAssetThe skeleton asset to use as animation
[in]loopSet to "true" for a looped animation, "false" otherwise
[in]reverseSet to "true" for a reversed animation playback, "false" otherwise
[in]boneTranslationRetargetingBone translation retargeting to use
Returns
The newly created mesh animation channel; may be a null pointer, only temporarily use this instance pointer and do not store it (WeakPtr is okay)
std::pair<MeshAnimationChannel*, MeshAnimationChannel*> qsf::MeshAnimationComponent::playMaskedAnimation ( const AssetProxy animationAsset1,
const AssetProxy animationAsset2,
const std::vector< std::string > &  boneMask,
bool  loop,
bool  reverse1 = false,
bool  reverse2 = false,
BoneRetargeting  boneTranslationRetargeting1 = ANIMATION_BONE_SCALE_RETARGETING,
BoneRetargeting  boneTranslationRetargeting2 = ANIMATION_BONE_SCALE_RETARGETING 
)

Play 2 new masked animation, replacing the existing one.

Parameters
[in]animationAsset1The skeleton asset to use as animation 1 (mask defines bones we use)
[in]animationAsset2The skeleton asset to use as animation 2 (mask defines bones we don't use)
[in]boneMaskList of bone names we want to mask with all child bones (no holes of empty strings, please)
[in]loopSet to "true" for a looped animation, "false" otherwise
[in]reverse1Set to "true" for a reversed animation 1 playback, "false" otherwise
[in]reverse2Set to "true" for a reversed animation 2 playback, "false" otherwise
[in]boneTranslationRetargeting1Bone translation retargeting to use for animation 1
[in]boneTranslationRetargeting2Bone translation retargeting to use for animation 2
Returns
The newly created mesh animation channel of animation 1; may be a null pointer, only temporarily use this instance pointer and do not store it (WeakPtr is okay)
void qsf::MeshAnimationComponent::resetAnimationBindingNextTime ( )
inline

Next time an animation is played the binding will be updated.

Definition at line 36 of file MeshAnimationComponent-inl.h.

void qsf::MeshAnimationComponent::setDoAlwaysUpdateAnimation ( bool  doAlwaysUpdateAnimation)

Return whether or not the animation is always updated, regardless of whether or not it's visible.

Note
  • Don't set this to true until you're not in need of decent performance
void qsf::MeshAnimationComponent::stopAllAnimations ( )

Stop all animations currently playing.

Friends And Related Function Documentation

friend class MeshComponent
friend

Definition at line 70 of file MeshAnimationComponent.h.

Member Data Documentation

const uint32 qsf::MeshAnimationComponent::COMPONENT_ID
static

"qsf::MeshAnimationComponent" unique component ID

Definition at line 77 of file MeshAnimationComponent.h.


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