Physics Components
Interaction SDK can work agnostically of physics, but sometimes you want to interact with non-kinematic rigidbodies. There are two common solutions when grabbing non-kinematic objects in Unity, either force them to be kinematic during the grab, or grab them in a “physics friendly” way so they keep their properties. To simplify interacting with non-kinematic rigidbodies, Interaction SDK offers these physics components.
Note:
If the global Unity setting
Physics.autoSimulation is set to
false, you may need to manually trigger Physics updates for some interactions like
Grab and
HandGrab that utilize
CollisionInteractionRegistry under the hood. After each time you manually simulate a physics step, call
InteractableTriggerBroadcaster.ForceGlobalUpdateTriggers to update the trigger overlap mapping.
PhysicsGrabbable makes the GameObject it’s attached to kinematic during a grab. As a result, the GameObject can be transformed 1-1 without any undesirable effects.
PhysicsGrabbable also can apply a velocity to the GameObject when it’s released. For that to happen, in the associated interactable (eg.
GrabInteractable,
HandGrabInteractable), set the
Physics Grabbable property to the GameObject.
StandardVelocityCalculator
Note:
As of v65,
StandardVelocityCalculatorand
RANSACVelocityCalculator are still supported but have been replaced by the
Grabbable component.
StandardVelocityCalculator determines the final velocity of a thrown GameObject. To do this, it implements the
IVelocityCalculator interface, which buffers pose data from a hand or controller input device. Buffered pose data contains per-frame information such as linear velocity, angular velocity, transform values, and timestamp.
StandardVelocityCalculator uses the buffered pose data to determine the velocity of the GameObject after accounting for factors like trend velocity, tangential velocity, and external velocity. You can adjust the influence of these factors in the component properties.
The RigidbodyKinematicLocker manages the kinematic state of a Rigidbody component attached to a GameObject.