Struct MotionSynthesizerHolder
This struct hold and setup the synthesizer and its dependencies. The synthesizer cannot hold directly its own dependencies because they are managed code and synthesizer need to be unmanaged in order to be used by Burst
Namespace: Unity.Kinematica
Syntax
public struct MotionSynthesizerHolder
Properties
Binary
Allows direct access to the underlying Kinematica runtime asset.
Declaration
public Binary Binary { get; }
Property Value
| Type | Description |
|---|---|
| Binary |
IsValid
Return true if the synthesizer is initialized and ready to be used, false otherwise
Declaration
public bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Synthesizer
Allows direct access to the motion synthesizer.
Declaration
public MemoryRef<MotionSynthesizer> Synthesizer { get; }
Property Value
| Type | Description |
|---|---|
| MemoryRef<MotionSynthesizer> |
Remarks
Most of Kinematica's API methods can be found in the motion synthesizer. API methods that are specific to the game object wrapper can be found on the Kinematica component directly.
Methods
Create(Transform, BinaryReference, Single, Int32)
Create synthesizer holder
Declaration
public static MotionSynthesizerHolder Create(Transform transform, BinaryReference resource, float blendDuration, int capacity = 1024)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | transform | Start root transform |
| BinaryReference | resource | Reference to Kinematica binary |
| Single | blendDuration | Blend duration between segments in seconds |
| Int32 | capacity | Initial alllocated memory in bytes for the task graph data |
Returns
| Type | Description |
|---|---|
| MotionSynthesizerHolder |
CreateInvalid()
Create uninitialized synthesizer holder, which can still be checked for validity by checking
IsValid property
Declaration
public static MotionSynthesizerHolder CreateInvalid()
Returns
| Type | Description |
|---|---|
| MotionSynthesizerHolder |
Dispose()
Dispose the internal buffers
Declaration
public void Dispose()
Remarks
This method releases all internally constructed objects and unregisters the Kinematica component from the snapshot debugger.
OnEarlyUpdate(Boolean)
To be called during the regular OnEarlyUpdate loop.
Declaration
public void OnEarlyUpdate(bool rewind)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | rewind |
OnReadPostProcess(Buffer)
Perform the SnapshotDebugger OnPostProcess(Buffer buffer) method on the synthesizer.
Declaration
public void OnReadPostProcess(Buffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Buffer | buffer |
OnWritePostProcess(Buffer)
Perform the SnapshotDebugger OnPostProcess() method on the synthesizer with the provided buffer.
Declaration
public void OnWritePostProcess(Buffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Buffer | buffer |
ReadFromStream(Buffer)
Forward the SnapshotDebugger ReadFromStream call to the synthesizer
Declaration
public void ReadFromStream(Buffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Buffer | buffer |
Update()
To be called during the regular game object update loop.
Declaration
public void Update()
WriteToStream(Buffer)
Forward the SnapshotDebugger WriteToStream call to the synthesizer
Declaration
public void WriteToStream(Buffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Buffer | buffer |