API reference
API reference
Select your platform
No SDKs available
No versions available

BodyRef Class

Extends MonoBehaviour, IBody, IActiveState
BodyRef is a utility component that delegates all of its IBody implementation to the provided Body object.
BodyRef can be thought of as a "redirect," which is useful for making Unity Component configurations flexible with limited setup. For example, if making a prefab containing multiple body-referencing components which should be usable with either body, it is more convenient to have a single BodyRef at the root of the prefab (to which all the other Components connect) and connect only that to the desired body versus having to connect every Component individually for every instance of the prefab.

Properties

The underlying IBody to which this BodyRef is a shim.
All IBody methods invoked on this BodyRef will be passed along to this instance.
Retrieves the IBody.WhenBodyUpdated event of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.

Fields

Retrieves the IBody.IsConnected value of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.
Retrieves the IBody.IsHighConfidence value of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.
Retrieves the IBody.Scale value of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.
Retrieves the IBody.IsTrackedDataValid value of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.
Retrieves the IBody.CurrentDataVersion value of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.
Implements IActiveState.Active, in this case indicating whether the underlying Body is connected.
This is a remapping method which makes the IsConnected value available to consumers treating the BodyRef as an IActiveState.
Retrieves the IBody.SkeletonMapping value of the underlying Body.
This is a pure shim property equivalent to accessing the same property on the Body.

Protected Functions

virtual void Awake ( )
virtual void Start ( )

Member Functions

Invokes IBody.GetRootPose(out Pose) on the underlying Body.
This is a pure shim method equivalent to invoking the same method on the Body.
Invokes IBody.GetJointPose(BodyJointId bodyJointId, out Pose) on the underlying Body.
This is a pure shim method equivalent to invoking the same method on the Body.
Invokes IBody.GetJointPoseLocal(BodyJointId bodyJointId, out Pose) on the underlying Body.
This is a pure shim method equivalent to invoking the same method on the Body.
Invokes IBody.GetJointPoseFromRoot(BodyJointId bodyJointId, out Pose) on the underlying Body.
This is a pure shim method equivalent to invoking the same method on the Body.
Sets all required dependencies for a dynamically instantiated BodyRef.
This is a convenience method wrapping InjectBody(IBody). This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the an IBody as the Body for a dynamically instantiated BodyRef.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Did you find this page helpful?