Wasabi
|
#include <WSkeletalAnimation.hpp>
Public Member Functions | |
WSkeleton (Wasabi *const app, uint32_t ID=0) | |
WError | CreateKeyFrame (WBone *baseBone, float fTime) |
WError | DeleteKeyFrame (uint32_t frame) |
WBone * | GetKeyFrame (uint32_t frame) |
virtual void | AddSubAnimation () |
void | SetSubAnimationBaseBone (uint32_t subAnimation, uint32_t boneIndex, uint32_t parentSubAnimation=-1) |
virtual void | Update (float fDeltaTime) |
virtual WImage * | GetTexture () const |
virtual WBone * | GetBone (uint32_t frame, uint32_t index) const |
virtual WBone * | GetBone (uint32_t frame, std::string name) const |
void | Scale (float scale) |
void | Scale (float x, float y, float z) |
void | Scale (WVector3 scale) |
void | BindToBone (WOrientation *obj, uint32_t boneID) |
void | UnbindFromBone (WOrientation *obj, uint32_t boneID) |
void | UnbindFromBone (uint32_t boneID) |
void | SetBindingScale (float scale) |
void | SetBindingScale (float x, float y, float z) |
void | SetBindingScale (WVector3 scale) |
WVector3 | GetCurrentParentBonePosition () |
virtual WError | CopyFrom (const WAnimation *const from) |
virtual WError | UseAnimationFrames (const WAnimation *const anim) |
bool | Valid () const |
virtual WError | SaveToStream (WFile *file, std::ostream &outputStream) |
virtual WError | LoadFromStream (WFile *file, std::istream &inputStream, std::vector< void * > &args, std::string nameSuffix) |
![]() | |
virtual std::string | GetTypeName () const override |
virtual void | SetID (uint32_t newID) override |
virtual void | SetName (std::string newName) override |
WAnimation (class Wasabi *const app, uint32_t ID=0) | |
virtual void | RemoveSubAnimation (uint32_t index) |
WError | SetKeyFrameTime (uint32_t frame, float fTime) |
void | SetPlaySpeed (float fSpeedMultiplier, uint32_t subAnimation=-1) |
void | SetCurrentFrame (uint32_t frame, uint32_t subAnimation=0) |
void | SetCurrentTime (float fTime, uint32_t subAnimation=0) |
void | SetPlayingBounds (uint32_t startFrame, uint32_t endFrame, uint32_t subAnimation=0) |
void | SetPlayingBounds_Time (float fStartTime, float fEndTime, uint32_t subAnimation=0) |
void | Play (uint32_t subAnimation=-1) |
void | Loop (uint32_t subAnimation=-1) |
void | Stop (uint32_t subAnimation=-1) |
void | Reset (uint32_t subAnimation=-1) |
bool | Playing (uint32_t subAnimation=0) const |
bool | Looping (uint32_t subAnimation=0) const |
float | GetTime (uint32_t subAnimation=0) const |
![]() | |
WFileAsset (class Wasabi *const app, uint32_t ID=0) | |
virtual WError | LoadFromStream (class WFile *file, std::istream &inputStream, vector< void * > &args, std::string nameSuffix)=0 |
![]() | |
WBase (class Wasabi *const app, uint32_t ID=0) | |
uint32_t | GetID () const |
std::string | GetName () const |
class Wasabi * | GetAppPtr () const |
void | AddReference () |
void | RemoveReference () |
Static Public Member Functions | |
static std::vector< void * > | LoadArgs () |
![]() | |
static std::string | _GetTypeName () |
Additional Inherited Members | |
![]() | |
void | m_UpdateFirstFrame (uint32_t subAnimation=-1) |
![]() | |
bool | m_bFramesOwner |
float | m_totalTime |
vector< W_FRAME * > | m_frames |
vector< W_SUB_ANIMATION * > | m_subAnimations |
![]() | |
class Wasabi * | m_app |
uint32_t | m_ID |
std::string | m_name |
This is the class implementing skeletal animation, as described in WSkeletalAnimation.h.
|
virtual |
Appends a subanimation to this animation. This is inherited from WAnimation.
Reimplemented from WAnimation.
void WSkeleton::BindToBone | ( | WOrientation * | obj, |
uint32_t | boneID | ||
) |
|
virtual |
Copies another WSkeleton.
from | Sekelton to copy from |
Implements WAnimation.
Appends a keyframe to the frames of this animation.
baseBone | The root of the bone structure for this keyframe |
fTime | The duration of this keyframe |
WError WSkeleton::DeleteKeyFrame | ( | uint32_t | frame | ) |
Delete a an existing keyframe.
frame | Index of the keyframe to delete |
|
virtual |
Retrieves a pointer to a bone from a frame. Changing the returned bone will impact the frame in real-time without any re-initialization.
frame | Frame to retrieve from |
index | Name of the bone to retrieve |
|
virtual |
Retrieves a pointer to a bone from a frame. Changing the returned bone will impact the frame in real-time without any re-initialization.
frame | Frame to retrieve from |
index | Index of the bone to retrieve |
WVector3 WSkeleton::GetCurrentParentBonePosition | ( | ) |
Retrieves the world-space position of the root of this skeleton at this point in the animation.
WBone* WSkeleton::GetKeyFrame | ( | uint32_t | frame | ) |
Retrieves an existing keyframe.
frame | Index of the keyframe to retrieve |
|
virtual |
Retrieves the animation texture, as described in WSkeletalAnimation.h
Implements WAnimation.
void WSkeleton::Scale | ( | float | scale | ) |
Sets the scale of the the skeleton.
scale | Scale multiplier |
void WSkeleton::Scale | ( | float | x, |
float | y, | ||
float | z | ||
) |
Sets the scale of the the skeleton.
x | Scale multiplier on X |
y | Scale multiplier on Y |
z | Scale multiplier on Z |
void WSkeleton::Scale | ( | WVector3 | scale | ) |
Scales the skeleton.
scale | Scale multiplier components |
void WSkeleton::SetBindingScale | ( | float | scale | ) |
Set the binding scale, which is applied to the binding matrix before it is set on bound objects.
scale | Scale multiplier |
void WSkeleton::SetBindingScale | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the binding scale, which is applied to the binding matrix before it is set on bound objects.
x | Scale multiplier on X |
y | Scale multiplier on Y |
z | Scale multiplier on Z |
void WSkeleton::SetBindingScale | ( | WVector3 | scale | ) |
Set the binding scale, which is applied to the binding matrix before it is set on bound objects.
scale | Scale multiplier components |
void WSkeleton::SetSubAnimationBaseBone | ( | uint32_t | subAnimation, |
uint32_t | boneIndex, | ||
uint32_t | parentSubAnimation = -1 |
||
) |
Sets the base bone for a subanimation. A subanimation's transformations will affect its base bone and all its children. If a parent subanimation is present, then this subanimation will be affected by the motion of that parent subanimation.
subAnimation | The subanimation to set its base bane |
boneIndex | The index of the bone to be set as base |
parentSubAnimation | The parent subanimation, -1 if none |
void WSkeleton::UnbindFromBone | ( | uint32_t | boneID | ) |
Unbind all objects from a bone.
boneID | Index of the bone to unbind objects from |
void WSkeleton::UnbindFromBone | ( | WOrientation * | obj, |
uint32_t | boneID | ||
) |
Unbind an object from a bone.
obj | Pointer to the object to unbind |
boneID | Index of the bone to unbind obj from |
|
virtual |
Steps the state of the playing (or looping) subanimations forward. This is usually called by the engine during normal execution each frame.
fDeltaTime | step time in seconds |
Reimplemented from WAnimation.
|
virtual |
Use the animation frames of another animation object. This is more efficient than copying in time and memory usage.
anim | Animation to use its frames |
Implements WAnimation.
|
virtual |
Returns whether or not this skeleton is valid. A valid skeleton is one that has animation keyframes and a bone texture.
Implements WBase.