PixelLightAPI
.
|
#include <Animation.h>
Public Types | |
enum | EFlags { Loop = 1<<0, PingPong = 1<<1 } |
Animation flags. More... | |
Public Member Functions | |
PLRENDERER_API | Animation (const PLCore::String &sName="", AnimationManager *pManager=nullptr) |
Constructor. | |
virtual PLRENDERER_API | ~Animation () |
Destructor. | |
PLRENDERER_API void | Reset () |
Resets the animation. | |
bool | IsActive () const |
Get the animation active status. | |
void | SetActive (bool bActive=true) |
Set the animation active status. | |
PLCore::uint32 | GetType () const |
Type of animation. | |
void | SetType (PLCore::uint32 nType=0) |
Sets the animation type. | |
PLRENDERER_API void | Start (PLCore::uint32 nStart, PLCore::uint32 nEnd, float fSpeed=24.0f, PLCore::uint32 nFlags=0) |
Starts an animation. | |
PLRENDERER_API void | Start (AnimationInfo &cAnimationInfo, bool bRestart=false) |
Starts an animation. | |
PLRENDERER_API void | Stop () |
Stops the animation. | |
void | Pause () |
Pause the animation. | |
void | Continue () |
Continues the animation. | |
AnimationInfo * | GetAnimation () const |
Returns the animation information. | |
float | GetWeight () const |
Gets the animation weight. | |
void | SetWeight (float fWeight=1.0f) |
Sets the animation weight. | |
float | GetSpeed () const |
Get the animation speed. | |
void | SetSpeed (float fSpeed=24.0f) |
Set the animation speed. | |
PLCore::uint32 | GetFlags () const |
Get the animation information flags. | |
void | SetFlags (PLCore::uint32 nFlags=0) |
Sets the animation information flags. | |
bool | IsRunning () const |
Get the animation running status. | |
PLCore::uint32 | GetStartFrame () const |
Returns the start frame. | |
PLCore::uint32 | GetEndFrame () const |
Returns the end frame. | |
PLCore::uint32 | GetNumOfFrames () const |
Returns the number of frames. | |
PLRENDERER_API float | GetFrame () const |
Get the current animation frame. | |
PLRENDERER_API float | GetProgress () const |
Gets the progress from the current state to the next state (0.0-1.0) | |
PLRENDERER_API PLCore::uint32 | GetCurrentFrame () const |
Get the current animation frame as an integer. | |
PLRENDERER_API void | SetCurrentFrame (float fFrame) |
Set the current animation frame. | |
PLRENDERER_API PLCore::uint32 | GetNextFrame () const |
Get the next animation frame as an integer. | |
PLRENDERER_API void | Update (float fTimeDifference) |
Updates the animation. | |
bool | GetEvents () const |
Returns whether animation events are enabled or not. | |
void | SetEvents (bool bEvents=true) |
Sets whether animation events are enabled or not. | |
PLRENDERER_API Animation & | operator= (const Animation &cSource) |
Public Attributes | |
PLCore::Event | EventStart |
PLCore::Event | EventStop |
PLCore::Event | EventFrameChange |
PLCore::Event< int > | EventSpecialFrame |
Animation control.
Animation flags.
PLRENDERER_API PLRenderer::Animation::Animation | ( | const PLCore::String & | sName = "" , |
AnimationManager * | pManager = nullptr |
||
) |
Constructor.
[in] | sName | Element name to set |
[in] | pManager | Animation manager using this element, can be a null pointer |
virtual PLRENDERER_API PLRenderer::Animation::~Animation | ( | ) | [virtual] |
Destructor.
PLRENDERER_API void PLRenderer::Animation::Reset | ( | ) |
Resets the animation.
bool PLRenderer::Animation::IsActive | ( | ) | const [inline] |
Get the animation active status.
void PLRenderer::Animation::SetActive | ( | bool | bActive = true | ) | [inline] |
Set the animation active status.
[in] | bActive | Should the animation be active? |
PLCore::uint32 PLRenderer::Animation::GetType | ( | ) | const [inline] |
Type of animation.
void PLRenderer::Animation::SetType | ( | PLCore::uint32 | nType = 0 | ) | [inline] |
Sets the animation type.
[in] | nType | Animation type (for instance 0=skeleton 1=vertex) |
PLRENDERER_API void PLRenderer::Animation::Start | ( | PLCore::uint32 | nStart, |
PLCore::uint32 | nEnd, | ||
float | fSpeed = 24.0f , |
||
PLCore::uint32 | nFlags = 0 |
||
) |
Starts an animation.
[in] | nStart | Start frame (inclusive) |
[in] | nEnd | End frame (inclusive) |
[in] | fSpeed | Animation speed, if negative, the animation is played reversed |
[in] | nFlags | Animation flags (see EFlags) |
PLRENDERER_API void PLRenderer::Animation::Start | ( | AnimationInfo & | cAnimationInfo, |
bool | bRestart = false |
||
) |
Starts an animation.
[in] | cAnimationInfo | The animation information |
[in] | bRestart | Restart animation if it is already currently played? |
PLRENDERER_API void PLRenderer::Animation::Stop | ( | ) |
Stops the animation.
void PLRenderer::Animation::Pause | ( | ) | [inline] |
Pause the animation.
void PLRenderer::Animation::Continue | ( | ) | [inline] |
Continues the animation.
AnimationInfo * PLRenderer::Animation::GetAnimation | ( | ) | const [inline] |
Returns the animation information.
float PLRenderer::Animation::GetWeight | ( | ) | const [inline] |
Gets the animation weight.
void PLRenderer::Animation::SetWeight | ( | float | fWeight = 1.0f | ) | [inline] |
Sets the animation weight.
[in] | fWeight | Animation weight (normally 0.0-1.0) |
float PLRenderer::Animation::GetSpeed | ( | ) | const [inline] |
Get the animation speed.
void PLRenderer::Animation::SetSpeed | ( | float | fSpeed = 24.0f | ) | [inline] |
Set the animation speed.
[in] | fSpeed | New speed for the animation, if negative, the animation is played reversed |
PLCore::uint32 PLRenderer::Animation::GetFlags | ( | ) | const [inline] |
Get the animation information flags.
void PLRenderer::Animation::SetFlags | ( | PLCore::uint32 | nFlags = 0 | ) | [inline] |
Sets the animation information flags.
[in] | nFlags | Animation information flags (see EFlags) |
bool PLRenderer::Animation::IsRunning | ( | ) | const [inline] |
Get the animation running status.
PLCore::uint32 PLRenderer::Animation::GetStartFrame | ( | ) | const [inline] |
Returns the start frame.
PLCore::uint32 PLRenderer::Animation::GetEndFrame | ( | ) | const [inline] |
Returns the end frame.
PLCore::uint32 PLRenderer::Animation::GetNumOfFrames | ( | ) | const [inline] |
Returns the number of frames.
PLRENDERER_API float PLRenderer::Animation::GetFrame | ( | ) | const |
Get the current animation frame.
PLRENDERER_API float PLRenderer::Animation::GetProgress | ( | ) | const |
Gets the progress from the current state to the next state (0.0-1.0)
PLRENDERER_API PLCore::uint32 PLRenderer::Animation::GetCurrentFrame | ( | ) | const |
Get the current animation frame as an integer.
PLRENDERER_API void PLRenderer::Animation::SetCurrentFrame | ( | float | fFrame | ) |
Set the current animation frame.
[in] | fFrame | Current animation frame |
PLRENDERER_API PLCore::uint32 PLRenderer::Animation::GetNextFrame | ( | ) | const |
Get the next animation frame as an integer.
PLRENDERER_API void PLRenderer::Animation::Update | ( | float | fTimeDifference | ) |
Updates the animation.
[in] | fTimeDifference | Past time since last frame (use e.g. PLCore::Timing::GetInstance()->GetTimeDifference()) |
bool PLRenderer::Animation::GetEvents | ( | ) | const [inline] |
Returns whether animation events are enabled or not.
void PLRenderer::Animation::SetEvents | ( | bool | bEvents = true | ) | [inline] |
Sets whether animation events are enabled or not.
[in] | bEvents | Are animation events enabled? |
Animation has been started
Animation has been stopped
Current frame change event
Special marked frame reached event, event ID as parameter (see 'AnimationEvent')
|