Struct TimeIndex
A time index is used to uniquely identfy an animation frame.
Namespace: Unity.Kinematica
Syntax
[Data("Time Index", DataType.Flag.None)]
public struct TimeIndex
Remarks
Time indices are used to uniquely identify animation frames in the motion library (which is contained in the runtime asset).
Collections of continuous animation frames that have been tagged with at least a single tag will be stored in the runtime asset during the build process. These continuous sequences are denoted as segments.
A time index in turn refers to a single animation frame that resides inside of a segment. Advancing playback time or performing any other kind of time-related manipulation uses the "time index" construct in order to ensure that reading from animation poses does not cross segment boundaries.
Fields
frameIndex
Denotes the frame index relative to the beginning of the segment that this time index refers to.
Declaration
public short frameIndex
Field Value
Type | Description |
---|---|
Int16 |
segmentIndex
Denotes the segment this time index refers to.
Declaration
public short segmentIndex
Field Value
Type | Description |
---|---|
Int16 |
Properties
Invalid
Invalid time index.
Declaration
public static TimeIndex Invalid { get; }
Property Value
Type | Description |
---|---|
TimeIndex |
IsValid
Determines if the given time index is valid or not.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean | True if the time index is valid; false otherwise. |
Methods
Create(Int32, Int32)
Creates a time index from a segment and frame index.
Declaration
public static TimeIndex Create(int segmentIndex, int frameIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | segmentIndex | The segment index that the time index should refer to. |
Int32 | frameIndex | The segment-relative frame index that the time index should refer to. |
Returns
Type | Description |
---|---|
TimeIndex |
Equals(TimeIndex)
Determines whether two time indices are equal.
Declaration
public bool Equals(TimeIndex timeIndex)
Parameters
Type | Name | Description |
---|---|---|
TimeIndex | timeIndex | The time index to compare against the current time index. |
Returns
Type | Description |
---|---|
Boolean | True if the specified time index is equal to the current time index; otherwise, false. |