IUxrGrabbable Interface

Interface for all objects that can be grabbed/manipulated using the UxrGrabManager.

Namespace: UltimateXR.Manipulation
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public interface IUxrGrabbable


The IUxrGrabbable type exposes the following members.

Properties

NameDescription
Public propertygameObject Gets the associated GameObject. Since all components that implement the interface will be assigned to GameObjects, this allows to access them using the interface. It doesn’t follow the property PascalCase naming to make it compatible with Unity.
Public propertyIsBeingGrabbed Gets whether the object is being grabbed.
Public propertyIsGrabbable Gets or sets whether the object can be grabbed.
Public propertyIsKinematic Gets or sets whether the rigidbody that drives the object (if any) is kinematic.
Public propertytransform Gets the associated Transform component. Since all components that implement the interface will be assigned to GameObjects, this allows to access their transform using the interface. It doesn’t follow the property PascalCase naming to make it compatible with Unity.

Methods

NameDescription
Public methodReleaseGrabs Releases the object from all its grabs if there are any.
Public methodResetPositionAndState Resets the object to its initial position/rotation and state. If the object is currently being grabbed, it will be released.

Events

NameDescription
Public eventGrabbed Event called right after the object was grabbed. The grab event parameters use the same values as Grabbing.
Public eventGrabbing Event called when the object is about to be grabbed. The following properties from UxrManipulationEventArgs will contain meaningful data:  
  • GrabbableObject: Object that is about to be grabbed.
  • GrabbableAnchor: Target where the object is currently placed. Null if it isn’t on an anchor.
  • Grabber: Grabber that is about to grab the object.
  • GrabPointIndex: Grab point index of the object that is about to be grabbed.
  • IsMultiHands: true if it is already being grabbed with one hand and it will be grabbed with both hands after. False if no hand is currently grabbing it.
Public eventPlaced Event called right after the object was placed. An object is placed when the last grip is released and there is a compatible UxrGrabbableObjectAnchor near enough to place it on. The grab event parameters use the same values as Placed.
Public eventPlacing Event called when the object is about to be placed. An object is placed when the last grip is released and there is a compatible UxrGrabbableObjectAnchor near enough to place it on. The following properties from UxrManipulationEventArgs will contain meaningful data:  
Public eventReleased Event called right after the object was released. An object is released when the last grip is released and there is no compatible UxrGrabbableObjectAnchor near enough to place it on. The grab event parameters use the same values as Releasing.
Public eventReleasing Event called when the object is about to be released. An object is released when the last grip is released and there is no compatible UxrGrabbableObjectAnchor near enough to place it on. The following properties from UxrManipulationEventArgs will contain meaningful data:  
  • GrabbableObject: Object that is about to be released.
  • GrabbableAnchor: Anchor where the object was originally grabbed from. Null if it wasn’t on a target.
  • Grabber: Grabber that is about to release the object.
  • GrabPointIndex: Grab point index of the object that is being grabbed by the UxrGrabber.
  • IsMultiHands: true if it is already being grabbed with another hand that will keep it holding. False if no other hand is currently grabbing it.
  • IsSwitchHands: True if it was released because another UxrGrabber grabbed it, false otherwise. if IsMultiHands is true then IsSwitchHands will tell if it was released by both hands (false) or if it was just released by one hand and the other one still keeps it grabbed (true).
  • ReleaseVelocity: Velocity the object is being released with.
  • ReleaseAngularVelocity: Angular velocity the object is being released with.

See Also

Reference

UltimateXR.Manipulation Namespace