AnimationControl

class HPS::AnimationControl : public HPS::SprocketControl

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.

Public Functions

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_that – An rvalue reference to a AnimationControl to take the impl from.

AnimationControl(AnimationControl const &in_that)

Initializes a control tied to the same object as in_that.

explicit AnimationControl(View const &in_view)

Initializes a control tied to the view in_view.

Time 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.

inline virtual HPS::Type ObjectType() const

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.

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_that – An rvalue reference to a AnimationControl to take the impl from.

Returns

A reference to this AnimationControl.

AnimationControl &operator=(AnimationControl const &in_that)

Share the smart-pointer.

void 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.

Warning

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

void 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.

Warning

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

Parameters
  • in_start_tick – The tick to start playback from.

  • in_end_tick – The tick to stop playback at.

void Resume()

Resumes playback that was previously halted with Stop().

void 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_animation – The animation to use for playback.

void 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_animations – The animations to use for playback.

void 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_count – The number of animations that will be associated with this AnimationControl.

  • in_animations – The animations to use for playback.

void 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_duration – The duration in milliseconds.

bool ShowAnimations(AnimationArray &out_animations)

Shows the animations that are set on this AnimationControl.

Parameters

out_animations – The animations that are currently set on this animation control.

void 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.

void Undo()

Reverts any changes made to the scene by playing animations.

Warning

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

void Wait()

Blocks until playback is complete.

~AnimationControl()

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

Public Static Attributes

static const HPS::Type staticType = HPS::Type::AnimationControl