Class Kinematica
This component is a wrapper around the motion synthesizer.
Inherited Members
Namespace: Unity.Kinematica
Syntax
public class Kinematica : SnapshotProvider, Serializable, FrameDebugProvider<AnimationFrameDebugInfo>, FrameDebugProvider
Remarks
The motion synthesizer represents the actual core implementation of Kinematica which can be used in a pure DOTS environment directly. It provides a raw transform buffer which represents the current character pose and does not provide any infrastructure to feed the current pose to the character.
The Kinematica component is a wrapper around the motion synthesizer that can be used in scenarios where Kinematica is to be used in conjunction with stock Unity Game Objects.
It establishes a Playable graph that forwards the character pose to the Animator component. It also provides automatic snapshots and rewind functionality, i.e. no additional user code is required to support snapshot debugging of the Kinematica component.
Fields
_deltaTime
Denotes the delta time in seconds to be used during this frame.
Declaration
protected float _deltaTime
Field Value
Type | Description |
---|---|
Single |
Remarks
The delta time in seconds mirrors Time.deltaTime during play mode unless the snapshot debugger rewinds to a recorded snapshot. The current frame delta time is recorded as part of a snapshot to guarantee the exact same evaluation result when in case the snapshot debugger rewinds to a previous snapshot frame.
applyRootMotion
Declaration
public bool applyRootMotion
Field Value
Type | Description |
---|---|
Boolean |
blendDuration
Denotes the default blend duration for the motion synthesizer.
Declaration
public float blendDuration
Field Value
Type | Description |
---|---|
Single |
resource
Allows access to the underlying Kinematica runtime asset.
Declaration
public BinaryReference resource
Field Value
Type | Description |
---|---|
BinaryReference |
Properties
Binary
Allows direct access to the underlying Kinematica runtime asset.
Declaration
public Binary Binary { get; }
Property Value
Type | Description |
---|---|
Binary |
Query
Generates a new semantic query.
Declaration
public Query Query { get; }
Property Value
Type | Description |
---|---|
Query |
Remarks
This method generates an empty semantic query which should be filled out by specifying tag trait constraints and/or marker trait constraint.
See Also
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
AddJobDependency(JobHandle)
Schedules the job handle passed as argument as a dependency of the Animator component.
Declaration
public void AddJobDependency(JobHandle jobHandle)
Parameters
Type | Name | Description |
---|---|---|
JobHandle | jobHandle | Job handle that should be scheduled as a dependency of the Animator component. |
Remarks
This method allows to schedule a job to be executed before the Animator component job executes. This in turn guarantees that the job passed as argument executes before Kinematica's motion synthesizer executes.
EarlyUpdate()
This callback will be automatically invoked during UnityEngine.PlayerLoop.EarlyUpdate().
Declaration
public virtual void EarlyUpdate()
GetDisplayName()
Declaration
public string GetDisplayName()
Returns
Type | Description |
---|---|
String |
Implements
GetFrameDebugInfo()
Declaration
public List<AnimationFrameDebugInfo> GetFrameDebugInfo()
Returns
Type | Description |
---|---|
List<AnimationFrameDebugInfo> |
Implements
GetUniqueIdentifier()
Declaration
public int GetUniqueIdentifier()
Returns
Type | Description |
---|---|
Int32 |
Implements
OnAnimatorMove()
Handler method which gets invoked during the animator update.
Declaration
public virtual void OnAnimatorMove()
Remarks
The motion synthesizer maintains the full world space transform of the character at all times. This method simply forwards this transform to the game object's transform.
OnDisable()
Override for OnDisable()
Declaration
public override void OnDisable()
Overrides
Remarks
This method releases all internally constructed objects and unregisters the Kinematica component from the snapshot debugger.
OnEarlyUpdate(Boolean)
Override for OnEarlyUpdate() which will be invoked as part of the snapshot debugger infrastructure during the execution of UnityEngine.PlayerLoop.EarlyUpdate.
Declaration
public override void OnEarlyUpdate(bool rewind)
Parameters
Type | Name | Description |
---|---|---|
Boolean | rewind | True when the snapshot debugger rewinds to a previously recorded snapshot, false otherwise. |
Overrides
OnEnable()
Override for OnEnable().
Declaration
public override void OnEnable()
Overrides
Remarks
The Playable graph that forwards the current character pose to the Animator component gets constructed during the execution of this method.
This method also registers the Kinematica component with the snapshot debugger.
OnPostProcess()
Override of the OnPostProcess() method which gets invoked during snapshot debugging.
Declaration
public override Buffer OnPostProcess()
Returns
Type | Description |
---|---|
Buffer |
Overrides
OnPostProcess(Buffer)
Override of the OnPostProcess() method which gets invoked during snapshot debugging.
Declaration
public override void OnPostProcess(Buffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer |
Overrides
Push(QueryResult)
Pushes a pose sequence to the motion synthesizer.
Declaration
public void Push(QueryResult queryResult)
Parameters
Type | Name | Description |
---|---|---|
QueryResult | queryResult | Pose sequence that should be pushed to the motion synthesizer. |
Remarks
Forwards the call to the motion synthesizer.
See Also
ReadFromStream(Buffer)
Retrieves the contents of the Kinematica component from the buffer passed as argument.
Declaration
public override void ReadFromStream(Buffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer that the contents of the Kinematica component should be read from. |
Overrides
Update()
Called during the regular game object update loop.
Declaration
public void Update()
WriteToStream(Buffer)
Stores the contents of the Kinematica component in the buffer passed as argument.
Declaration
public override void WriteToStream(Buffer buffer)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer that the contents of the Kinematica component should be written to. |