Gorgon
Show / Hide Table of Contents

Interface IGorgonAnimation

The interface that defines an animation.

Inherited Members
IGorgonNamedObject.Name
Namespace: Gorgon.Animation
Assembly: Gorgon.Animation.dll
Syntax
public interface IGorgonAnimation : IGorgonNamedObject
Remarks

An animation is composed of multiple tracks that represent various properties on an object that can be changed over time. Each track is itself composed of multiple markers in time called key frames. These markers indicate what the value of a property should be at a given time.

To create an animation, a GorgonAnimationBuilder is used to build up the key frames for each track that is to be animated. Because of this, the animation tracks and key frames are immutable.

The available tracks on an animation are for common usage scenarios such as moving, scaling, rotating, etc... Please note that some animation controllers will not make use of some track types.

In order to play an animation, a GorgonAnimationController<T> must be used.

Properties

| Edit this page View Source

ColorTracks

Property to return the track used to update any values using a GorgonColor.

Declaration
[JsonProperty("colortracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyGorgonColor>> ColorTracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyGorgonColor>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Fps

Property to return the frames per second for this animation.

Declaration
[JsonProperty("FPS")]
float Fps { get; }
Property Value
Type Description
float
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

IsLooped

Property to set or return whether this animation should be looping or not.

Declaration
bool IsLooped { get; set; }
Property Value
Type Description
bool
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Length

Property to return the length of the animation (in seconds).

Declaration
float Length { get; }
Property Value
Type Description
float
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

LoopCount

Property to set or return the number of times to loop an animation.

Declaration
int LoopCount { get; set; }
Property Value
Type Description
int
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

QuaternionTracks

Property to return the track used to update any values using a Quaternion.

Declaration
[JsonProperty("quaterniontracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyQuaternion>> QuaternionTracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyQuaternion>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

RectangleTracks

Property to return the track used to update any values using a SharpDX RectangleF.

Declaration
[JsonProperty("recttracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyRectangle>> RectangleTracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyRectangle>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

SingleTracks

Property to return the tracks used to update any values using a single floating point value.

Declaration
[JsonProperty("singletracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeySingle>> SingleTracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeySingle>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Speed

Property to set or return the speed of the animation.

Declaration
[JsonIgnore]
float Speed { get; set; }
Property Value
Type Description
float
Remarks

Setting this value to a negative value will make the animation play backwards.

See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Texture2DTracks

Property to return the tracks used for updating a 2D texture on an object.

Declaration
[JsonProperty("textures")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyTexture2D>> Texture2DTracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyTexture2D>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Vector2Tracks

Property to return the tracks used to update any values using a 2D vector.

Declaration
[JsonProperty("vector2tracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyVector2>> Vector2Tracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyVector2>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Vector3Tracks

Property to return the track used to update any values using a 3D vector.

Declaration
[JsonProperty("vector3tracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyVector3>> Vector3Tracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyVector3>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
| Edit this page View Source

Vector4Tracks

Property to return the track used to update any values using a 4D vector.

Declaration
[JsonProperty("vector4tracks")]
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyVector4>> Vector4Tracks { get; }
Property Value
Type Description
IReadOnlyDictionary<string, IGorgonAnimationTrack<GorgonKeyVector4>>
See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder

Methods

| Edit this page View Source

GetMaxKeyFrameCount()

Function to retrieve the maximum number of key frames across all tracks.

Declaration
int GetMaxKeyFrameCount()
Returns
Type Description
int

The maximum number of key frames across all tracks.

See Also
IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonAnimationExtensions.ToJson(IGorgonAnimation, bool)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

IGorgonAnimationTrack<T>
IGorgonKeyFrame
GorgonAnimationBuilder
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author