Twilight Princess
Remastered version of the GameCube game
Loading...
Searching...
No Matches
Unity.Collections.NativeCurve Struct Reference

NativeCurve is a simple re-implementation of AnimationCurve in a Job/Burst friendly way. This container can be constructed directly from an AnimationCurve, or by using an array of keyframes. Once created this container cannot be modified, which makes it very safe to use from multiple threads at once. More...

+ Inheritance diagram for Unity.Collections.NativeCurve:
+ Collaboration diagram for Unity.Collections.NativeCurve:

Classes

struct  KeyFrame
 

Public Member Functions

 NativeCurve (AnimationCurve curve, Allocator allocator=Allocator.Persistent)
 Constructs a new NativeCurve that is an exact copy of the input AnimationCurve.
 
 NativeCurve (IList< Keyframe > keyframes, Allocator allocator=Allocator.Persistent, UnityEngine.WrapMode preWrapMode=UnityEngine.WrapMode.Clamp, UnityEngine.WrapMode postWrapMode=UnityEngine.WrapMode.Clamp)
 Constructs a new NativeCurve given a list of Keyframes. Can optionally specify the pre and post wrap modes.
 
 NativeCurve (IList< KeyFrame > keyframes, Allocator allocator=Allocator.Persistent, UnityEngine.WrapMode preWrapMode=UnityEngine.WrapMode.Clamp, UnityEngine.WrapMode postWrapMode=UnityEngine.WrapMode.Clamp)
 Constructs a new NativeCurve given a list of KeyFrames. Can optionally specify the pre and post wrap modes.
 
 NativeCurve (NativeSlice< KeyFrame > keyframes, Allocator allocator=Allocator.Persistent, UnityEngine.WrapMode preWrapMode=UnityEngine.WrapMode.Clamp, UnityEngine.WrapMode postWrapMode=UnityEngine.WrapMode.Clamp)
 Constructs a new NativeCurve given a native slice of KeyFrames. Can optionally specify the pre and post wrap modes.
 
void Dispose ()
 Disposed of this container. Once disposed, it cannot be used.
 
float Evaluate (float t)
 Evaluates the curve at the given time.
 

Public Attributes

DisposeSentinel m_DisposeSentinel
 

Properties

bool IsCreated [get]
 Returns whether or not this NativeCurve has been created or not. Once disposed this method will return false.
 
int Count [get]
 Returns the number of keyframes stored in this curve container.
 
float StartTime [get]
 Returns the start time of this curve in seconds.
 
float EndTime [get]
 Returns the end time of this curve in seconds.
 
float Duration [get]
 Returns the duration of this curve in seconds.
 
KeyFrame this[int index] [get, private set]
 Returns the KeyFrame located at the given index.
 

Private Member Functions

 NativeCurve (int keyframes, Allocator allocator, UnityEngine.WrapMode preWrapMode, UnityEngine.WrapMode postWrapMode)
 
void Init ()
 
void AdjustTimeWithMode (ref float t, UnityEngine.WrapMode mode)
 
float EvalCurved (KeyFrame keyframe0, KeyFrame keyframe1, float time)
 

Private Attributes

int _count
 
float _startTime
 
float _endTime
 
UnityEngine.WrapMode _preWrapMode
 
UnityEngine.WrapMode _postWrapMode
 
IntPtr m_Buffer
 
Allocator m_AllocatorLabel
 

Detailed Description

NativeCurve is a simple re-implementation of AnimationCurve in a Job/Burst friendly way. This container can be constructed directly from an AnimationCurve, or by using an array of keyframes. Once created this container cannot be modified, which makes it very safe to use from multiple threads at once.

This container must be manually disposed of when you are finished with it, by calling Dispose. Alternatively you can also attribute it with [DeallocateOnJobCompletion] and it will be automatically disposed of when that job is finished.

NOTE that this curve representation does not currently support custom curve weights!

Constructor & Destructor Documentation

◆ NativeCurve() [1/5]

Unity.Collections.NativeCurve.NativeCurve ( AnimationCurve curve,
Allocator allocator = Allocator::Persistent )

Constructs a new NativeCurve that is an exact copy of the input AnimationCurve.

◆ NativeCurve() [2/5]

Unity.Collections.NativeCurve.NativeCurve ( IList< Keyframe > keyframes,
Allocator allocator = Allocator::Persistent,
UnityEngine.WrapMode preWrapMode = UnityEngine::WrapMode::Clamp,
UnityEngine.WrapMode postWrapMode = UnityEngine::WrapMode::Clamp )

Constructs a new NativeCurve given a list of Keyframes. Can optionally specify the pre and post wrap modes.

◆ NativeCurve() [3/5]

Unity.Collections.NativeCurve.NativeCurve ( IList< KeyFrame > keyframes,
Allocator allocator = Allocator::Persistent,
UnityEngine.WrapMode preWrapMode = UnityEngine::WrapMode::Clamp,
UnityEngine.WrapMode postWrapMode = UnityEngine::WrapMode::Clamp )

Constructs a new NativeCurve given a list of KeyFrames. Can optionally specify the pre and post wrap modes.

◆ NativeCurve() [4/5]

Unity.Collections.NativeCurve.NativeCurve ( NativeSlice< KeyFrame > keyframes,
Allocator allocator = Allocator::Persistent,
UnityEngine.WrapMode preWrapMode = UnityEngine::WrapMode::Clamp,
UnityEngine.WrapMode postWrapMode = UnityEngine::WrapMode::Clamp )

Constructs a new NativeCurve given a native slice of KeyFrames. Can optionally specify the pre and post wrap modes.

◆ NativeCurve() [5/5]

Unity.Collections.NativeCurve.NativeCurve ( int keyframes,
Allocator allocator,
UnityEngine.WrapMode preWrapMode,
UnityEngine.WrapMode postWrapMode )
private

Member Function Documentation

◆ AdjustTimeWithMode()

void Unity.Collections.NativeCurve.AdjustTimeWithMode ( ref float t,
UnityEngine.WrapMode mode )
private

◆ Dispose()

void Unity.Collections.NativeCurve.Dispose ( )

Disposed of this container. Once disposed, it cannot be used.

◆ EvalCurved()

float Unity.Collections.NativeCurve.EvalCurved ( KeyFrame keyframe0,
KeyFrame keyframe1,
float time )
private

◆ Evaluate()

float Unity.Collections.NativeCurve.Evaluate ( float t)

Evaluates the curve at the given time.

◆ Init()

void Unity.Collections.NativeCurve.Init ( )
private

Member Data Documentation

◆ _count

int Unity.Collections.NativeCurve._count
private

◆ _endTime

float Unity.Collections.NativeCurve._endTime
private

◆ _postWrapMode

UnityEngine.WrapMode Unity.Collections.NativeCurve._postWrapMode
private

◆ _preWrapMode

UnityEngine.WrapMode Unity.Collections.NativeCurve._preWrapMode
private

◆ _startTime

float Unity.Collections.NativeCurve._startTime
private

◆ m_AllocatorLabel

Allocator Unity.Collections.NativeCurve.m_AllocatorLabel
private

◆ m_Buffer

IntPtr Unity.Collections.NativeCurve.m_Buffer
private

◆ m_DisposeSentinel

DisposeSentinel Unity.Collections.NativeCurve.m_DisposeSentinel

Property Documentation

◆ Count

int Unity.Collections.NativeCurve.Count
get

Returns the number of keyframes stored in this curve container.

◆ Duration

float Unity.Collections.NativeCurve.Duration
get

Returns the duration of this curve in seconds.

◆ EndTime

float Unity.Collections.NativeCurve.EndTime
get

Returns the end time of this curve in seconds.

◆ IsCreated

bool Unity.Collections.NativeCurve.IsCreated
get

Returns whether or not this NativeCurve has been created or not. Once disposed this method will return false.

◆ StartTime

float Unity.Collections.NativeCurve.StartTime
get

Returns the start time of this curve in seconds.

◆ this[int index]

KeyFrame Unity.Collections.NativeCurve.this[int index]
getprivate set

Returns the KeyFrame located at the given index.


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