Provides teleportation and simple keyframe-based animation for an entity. Animations play back in the Pre-Physics tick phase. When animating an entity with a parent_constraint, animation will be relative to the parent entity.
Verse using statement |
using { /Verse.org/SceneGraph/KeyframedMovement } |
Inheritance Hierarchy
This class is derived from component.
| Name | Description |
|---|---|
component |
Base class for authoring logic and data in the SceneGraph. Using components you can author re-usable building blocks of logic and data which can then be added to entities in the scene. Components are a very low level building block which can be used in many ways. For example:
As components are generic there is no specific way that they must be used. It is up to the needs of your experience if you use one big game component or if you break up logic into many small components. Classes deriving from component must also specify Only one instance of a component from each subclass group can be added to an entity at a time. For example, given this group of components, only one light_component can exist on a single entity. To create multiple lights you should use multiple entities. light_component := class ============================================================================== Component Lifetime Components move through a series of lifetime functions as they are added to entities, added to the scene, and begin running in the simulation. Components should override these methods to perform setup and run their simulation. As a component shuts down it will then move through shutdown version of these
functions, giving users the opportunity to clean up any retained state on the
component before it is disposed
.
Lifetime Methods:
OnAddedToScene
OnBeginSimulation -> OnSimulate |
Members
This class has both data members and functions.
Data
| Data Member Name | Type | Description |
|---|---|---|
Duration |
??float |
Gets the duration in seconds this keyframed movement will take. Fails if a fixed duration is not known (ex: looping animations). |
Entity |
entity |
The parent entity of this component.
|
FinishedEvent |
unknown |
Get the event that fires when the animations ends, failing if the animation is of infinite duration |
KeyframeReachedEvent |
unknown |
Signaled when any keyframe is reached. (Keyframe:int, IsReversed:logic). |
PausedEvent |
unknown |
Get the event that fires when the animation is Paused. |
PlayedEvent |
unknown |
Get the event that fires when the animation begins or resumes Playing. |
StoppedEvent |
unknown |
Get the event that fires when the animation is Stopped. |
TickEvents |
?tick_events |
Set callbacks to |
Functions
| Function Name | Description |
|---|---|
HasValidAnimation |
Is there a valid set of playable keyframes? |
IsInScene |
Succeeds if the component is currently in the scene.
|
IsPaused |
Is the animation paused? |
IsPlaying |
Is the animation currently playing? |
IsSimulating |
Succeeds if the component is currently simulating.
|
OnAddedToScene |
Called when the component is added to the scene by parenting it under the simulation entity or another entity already in the scene.
|
OnBeginSimulation |
Called when the component begins simulating within the scene.
|
OnEndSimulation |
Called when the component ends simulation within the scene.
|
OnRemovingFromScene |
Called when the component is about to be removed from the scene.
|
OnSimulate |
Called when the component begins simulating within the scene.
|
Pause |
Pause movement. Subsequently calling Play() will resume from the point in the animation when it was paused. |
Play |
Begin or resume playback. |
RemoveFromEntity |
Removes the component from the entity.
|
SendDown |
Send a scene event to this component. Return true to consume the event and halt propogation. |
SetKeyframes |
Stop any ongoing animation, sets the animation path and rebases it relative to the actor's current transform. Does not start playing until you call Play(). |
Stop |
Stop and reset transform to the initial state. Subsequently calling Play() will begin the animation anew. |
Stop |
Stop and reset transform to the initial state. Subsequently calling Play() will begin the animation anew. |