GrabInteractable Class
The GrabInteractable class enables objects to be grabbable by controllers, provided they are within arm's reach.
This class implements interfaces for handling rigidbody physics and collider references, facilitating detailed control over the interaction dynamics.
Collider[] Colliders[Get]
Provides access to the Rigidbody component associated with the interactable object, allowing for physics-based interactions.
bool UseClosestPointAsGrabSource[Get]
Determines whether the closest point to the interactor should be used as the grab source, enhancing precision in grab interactions.
float ReleaseDistance[Get]
Specifies the distance at which the object will automatically be released from the grab, providing a limit to maintain realistic interactions.
bool ResetGrabOnGrabsUpdated[Get]
Indicates whether the grab should be reset when the grab points are updated, allowing for dynamic adjustment during ongoing interactions.
Pose GetGrabSourceForTarget ( Pose target )
Calculates the grab source position for a given target, which determines the initial location from which the object will be grabbed.
ParameterstargetThe pose of the interactor targeting the grabbable object.
ReturnsThe calculated Pose representing the grab source.
void ApplyVelocities ( Vector3 linearVelocity,
Vector3 angularVelocity )
Applies specified linear and angular velocities to the interactable's Rigidbody, if it has one, facilitating realistic physics interactions.
ParameterslinearVelocityThe linear velocity to apply.
angularVelocityThe angular velocity to apply.
void InjectAllGrabInteractable Adds a Rigidbody to a dynamically instantiated GameObject.
Adds a Rigidbody to the interactable, enabling physics interactions.
ParametersrigidbodyThe Rigidbody to be added to the interactable object.
void InjectOptionalGrabSource ( Transform grabSource )
Optionally sets a specific transform as the grab source for the interactable, allowing for customized grab initiation points.
ParametersgrabSourceThe transform to be used as the grab source.
void InjectOptionalReleaseDistance ( float releaseDistance )
Optionally sets a specific release distance for the interactable, defining how far the interactor can move before the grab is released.
ParametersreleaseDistanceThe release distance to be set.
void InjectOptionalPhysicsGrabbable Optionally adds a PhysicsGrabbable component to the interactable, which is now deprecated and should be replaced with Grabbable.
ParametersphysicsGrabbableThe PhysicsGrabbable component to be added.