![]() |
nomlib
|
Pure virtual base class interface for actions. More...
#include <IActionObject.hpp>
Public Types | |
| enum | FrameState { COMPLETED , PLAYING } |
| The update status of the action. More... | |
| typedef IActionObject | self_type |
| typedef std::function< real32(real32, real32, real32, real32)> | timing_curve_func |
| A function pointer to a timing mode. | |
Public Member Functions | |
| const std::string & | name () const |
| Get the unique identifier of the action. | |
| real32 | duration () const |
| Get the duration of the action. | |
| real32 | speed () const |
| Get the speed modifier of the action. | |
| const IActionObject::timing_curve_func & | timing_curve () const |
| Get the timing mode function used by the action. | |
| void | set_name (const std::string &action_id) |
| Set the unique identifier of the action. | |
| virtual void | set_speed (real32 speed) |
| Set the speed factor of the action. | |
| virtual void | set_timing_curve (const IActionObject::timing_curve_func &mode) |
| Set the timing mode of the action. | |
| virtual std::unique_ptr< IActionObject > | clone () const =0 |
| Create a deep copy instance of the action. | |
| virtual IActionObject::FrameState | next_frame (real32 delta_time)=0 |
| Play the action forward in time by one time step. | |
| virtual IActionObject::FrameState | prev_frame (real32 delta_time)=0 |
| Play the action backwards in time by one time step. | |
| virtual void | pause (real32 delta_time)=0 |
| Freeze the action's internal state. | |
| virtual void | resume (real32 delta_time)=0 |
| Resume the internal state of the action. | |
| virtual void | rewind (real32 delta_time)=0 |
| Reset the internal state of the action back to its initial starting values. | |
| virtual void | release ()=0 |
| Free externally referenced resources held by the action. | |
Protected Member Functions | |
| IActionObject::FrameState | status () const |
| Get the current state of the action. | |
| void | set_duration (real32 seconds) |
| Set the duration of the action. | |
| void | set_status (FrameState state) |
| Set the state of the action. | |
Protected Attributes | |
| real32 | elapsed_frames_ = 0.0f |
| Internal frames counter. | |
| Timer | timer_ |
| Internal time clock (milliseconds resolution). | |
Private Attributes | |
| FrameState | status_ = FrameState::PLAYING |
| std::string | name_ |
| real32 | duration_ = 0.0f |
| real32 | speed_ = 1.0f |
| timing_curve_func | timing_curve_ = nullptr |
Related Symbols | |
(Note that these are not member symbols.) | |
| typedef std::vector< std::shared_ptr< IActionObject > > | action_list |
| A collection of actions. | |
| template<typename ObjectType, typename... ObjectArgs> | |
| std::shared_ptr< ObjectType > | create_action (ObjectArgs &&... args) |
| Constructor function for creating an action. | |
| template<typename ObjectType> | |
| std::shared_ptr< ObjectType > | create_action (const action_list &actions) |
| Constructor function for creating an action that uses a collection of actions. | |
Pure virtual base class interface for actions.
TODO: This documentation section is a STUB!
A simple, bare-bones example:
Definition at line 41 of file IActionObject.hpp.
| typedef IActionObject nom::IActionObject::self_type |
Definition at line 44 of file IActionObject.hpp.
| typedef std::function<real32(real32, real32, real32, real32)> nom::IActionObject::timing_curve_func |
A function pointer to a timing mode.
Definition at line 51 of file IActionObject.hpp.
The update status of the action.
| Enumerator | |
|---|---|
| COMPLETED | The action has finished its update loop. |
| PLAYING | The action is still updating; duration remains. |
Definition at line 54 of file IActionObject.hpp.
|
pure virtual |
Create a deep copy instance of the action.
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
| real32 nom::IActionObject::duration | ( | ) | const |
Get the duration of the action.
|
pure virtual |
Play the action forward in time by one time step.
| delta_time | Reserved for application-defined implementations. |
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
|
pure virtual |
Freeze the action's internal state.
| delta_time | Reserved for application-defined implementations. |
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
|
pure virtual |
Play the action backwards in time by one time step.
| delta_time | Reserved for application-defined implementations. |
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
|
pure virtual |
Free externally referenced resources held by the action.
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
|
pure virtual |
Resume the internal state of the action.
| delta_time | Reserved for application-defined implementations. |
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
|
pure virtual |
Reset the internal state of the action back to its initial starting values.
| delta_time | Reserved for application-defined implementations. |
Implemented in nom::AnimateTexturesAction, nom::CallbackAction, nom::FadeAlphaByAction, nom::FadeAudioGainBy, nom::FadeInAction, nom::FadeOutAction, nom::GroupAction, nom::MoveByAction, nom::PlayAudioSource, nom::RemoveAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, nom::ScaleByAction, nom::SequenceAction, nom::SpriteBatchAction, and nom::WaitForDurationAction.
|
protected |
Set the duration of the action.
| seconds | The duration in seconds. |
|
virtual |
Set the speed factor of the action.
Reimplemented in nom::GroupAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, and nom::SequenceAction.
|
protected |
Set the state of the action.
| state | One of the IActionObject::FrameState enumeration values. |
|
virtual |
Set the timing mode of the action.
Reimplemented in nom::GroupAction, nom::RepeatForAction, nom::RepeatForeverAction, nom::ReversedAction, and nom::SequenceAction.
| real32 nom::IActionObject::speed | ( | ) | const |
Get the speed modifier of the action.
|
protected |
Get the current state of the action.
| const IActionObject::timing_curve_func & nom::IActionObject::timing_curve | ( | ) | const |
Get the timing mode function used by the action.
|
A collection of actions.
Definition at line 216 of file IActionObject.hpp.
|
Constructor function for creating an action that uses a collection of actions.
| actions | The collection of actions to pass to the constructed object. |
Definition at line 252 of file IActionObject.hpp.
|
Constructor function for creating an action.
| args | The arguments to pass to the constructed object. |
Definition at line 224 of file IActionObject.hpp.
|
private |
Definition at line 208 of file IActionObject.hpp.
|
protected |
Internal frames counter.
Definition at line 195 of file IActionObject.hpp.
|
private |
Definition at line 207 of file IActionObject.hpp.
|
private |
Definition at line 209 of file IActionObject.hpp.
|
private |
Definition at line 206 of file IActionObject.hpp.
|
protected |
Internal time clock (milliseconds resolution).
Definition at line 203 of file IActionObject.hpp.
|
private |
Definition at line 210 of file IActionObject.hpp.