HPS::AnimationControl Class Reference

#include <sprk.h>

Inheritance diagram for HPS::AnimationControl:
HPS::SprocketControl HPS::Sprocket HPS::Object

Public Member Functions

 AnimationControl (View const &in_view)
 
 AnimationControl (AnimationControl const &in_that)
 
 AnimationControl (AnimationControl &&in_that)
 
Time GetMillisecondsPerTick () const
 
HPS::Type ObjectType () const
 
AnimationControloperator= (AnimationControl &&in_that)
 
AnimationControloperator= (AnimationControl const &in_that)
 
void Play (uint32_t in_start_tick, uint32_t in_end_tick)
 
void Play ()
 
void Resume ()
 
void SetAnimation (Animation const &in_animation)
 
void SetAnimations (size_t in_count, Animation const *const in_animations)
 
void SetAnimations (AnimationArray const &in_animations)
 
void SetMillisecondsPerTick (Time const &in_duration)
 
bool ShowAnimations (AnimationArray &out_animations)
 
void Stop ()
 
void Undo ()
 
void Wait ()
 
 ~AnimationControl ()
 
- Public Member Functions inherited from HPS::Sprocket
Sprocket (Sprocket &&in_that)
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 
virtual HPS::Type Type () const
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::AnimationControl
 
- Static Public Attributes inherited from HPS::SprocketControl
static const HPS::Type staticType = HPS::Type::SprocketControl
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 
- Protected Member Functions inherited from HPS::SprocketControl
SprocketControloperator= (SprocketControl &&in_that)
 
 SprocketControl (SprocketControl &&in_that)
 

Detailed Description

The AnimationControl class is a smart pointer that is tied to a database object. This control allows you to conduct playback for animations on the associated view.

Constructor & Destructor Documentation

◆ AnimationControl() [1/3]

HPS::AnimationControl::AnimationControl ( View const &  in_view)
explicit

Initializes a control tied to the view in_view.

◆ AnimationControl() [2/3]

HPS::AnimationControl::AnimationControl ( AnimationControl const &  in_that)

Initializes a control tied to the same object as in_that.

◆ AnimationControl() [3/3]

HPS::AnimationControl::AnimationControl ( AnimationControl &&  in_that)

The move constructor creates a AnimationControl by transferring the underlying impl of the rvalue reference to this AnimationControl thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a AnimationControl to take the impl from.

◆ ~AnimationControl()

HPS::AnimationControl::~AnimationControl ( )

Releases a reference to the database object this control is tied to.

Member Function Documentation

◆ GetMillisecondsPerTick()

Time HPS::AnimationControl::GetMillisecondsPerTick ( ) const

Gets the duration of time in milliseconds between each tick described by the keyframes of the attached animations.

Returns
The duration in milliseconds.

◆ ObjectType()

HPS::Type HPS::AnimationControl::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::SprocketControl.

◆ operator=() [1/2]

AnimationControl& HPS::AnimationControl::operator= ( AnimationControl &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this OperatorControl thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to a AnimationControl to take the impl from.
Returns
A reference to this AnimationControl.

◆ operator=() [2/2]

AnimationControl& HPS::AnimationControl::operator= ( AnimationControl const &  in_that)

Share the smart-pointer.

◆ Play() [1/2]

void HPS::AnimationControl::Play ( uint32_t  in_start_tick,
uint32_t  in_end_tick 
)

Asynchronously starts playback of the attached animation(s) executing from in_start_tick up to in_end_tick. If in_end_tick is lesser than in_start_tick playback will occur in reverse. Any playback currently stopped on this AnimationControl cannot be resumed after this call.

Warning
If SetAnimations hasn't been called on this AnimationControl this function will throw an InvalidOperationException.
If animation playback is already occuring this will throw an InvalidOperationException.
Parameters
in_start_tickThe tick to start playback from.
in_end_tickThe tick to stop playback at.

◆ Play() [2/2]

void HPS::AnimationControl::Play ( )

Starts playback of the attached animation(s) executing from tick 0 up to the last tick specified by the attached animation(s). Any playback currently stopped on this AnimationControl cannot be resumed after this call.

Warning
If SetAnimations hasn't been called on this AnimationControl this function will throw an InvalidOperationException.
If animation playback is already occuring this will throw an InvalidOperationException.

◆ Resume()

void HPS::AnimationControl::Resume ( )

Resumes playback that was previously halted with Stop().

◆ SetAnimation()

void HPS::AnimationControl::SetAnimation ( Animation const &  in_animation)

Sets the animation to apply during playback on the view associated with this AnimationControl. This will override any previous animation(s) set on this AnimationControl.

Warning
If animation playback is already occuring this will throw an InvalidOperationException
Parameters
in_animationThe animation to use for playback.

◆ SetAnimations() [1/2]

void HPS::AnimationControl::SetAnimations ( size_t  in_count,
Animation const *const  in_animations 
)

Sets the animations to apply during playback on the view associated with this AnimationControl. Playback of multiple animations will occur simultaneously. This will override any previous animation(s) set on this AnimationControl.

Warning
If animation playback is already occuring this will throw an InvalidOperationException.
Parameters
in_countThe number of animations that will be associated with this AnimationControl.
in_animationsThe animations to use for playback.

◆ SetAnimations() [2/2]

void HPS::AnimationControl::SetAnimations ( AnimationArray const &  in_animations)

Sets the animations to apply during playback on the view associated with this AnimationControl. Playback of multiple animations will occur simultaneously. This will override any previous animation(s) set on this AnimationControl.

Warning
If animation playback is already occuring this will throw an InvalidOperationException.
Parameters
in_animationsThe animations to use for playback.

◆ SetMillisecondsPerTick()

void HPS::AnimationControl::SetMillisecondsPerTick ( Time const &  in_duration)

Sets the duration of time in milliseconds between each tick described by the keyframes of the attached animations.

Warning
If animation playback is already occuring this will throw an InvalidOperationException.
Parameters
in_durationThe duration in milliseconds.

◆ ShowAnimations()

bool HPS::AnimationControl::ShowAnimations ( AnimationArray &  out_animations)

Shows the animations that are set on this AnimationControl.

Parameters
out_animationsThe animations that are currently set on this animation control.

◆ Stop()

void HPS::AnimationControl::Stop ( )

Stops playback. The playback can be resumed later by calling Resume().

Warning
If SetAnimations hasn't been called on this AnimationControl this function will throw an InvalidOperationException.

◆ Undo()

void HPS::AnimationControl::Undo ( )

Reverts any changes made to the scene by playing animations.

Warning
If animation playback is already occuring this will throw an InvalidOperationException.

◆ Wait()

void HPS::AnimationControl::Wait ( )

Blocks until playback is complete.


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