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

BoxGrabSurface Class

Extends MonoBehaviour, IGrabSurface
This GrabSurface defines a Rectangle around which the grip point is valid.
Since the grip point might be offset from the fingers, a valid range for each opposite side of the rectangle can be set so the grabbing fingers are constrained to the object bounds.

Protected Fields

Member Functions

The origin pose of the surface.
This is the point from which the base of the box must start.
Parameters
relativeTo
The reference transform to apply the surface to
Returns
Pose in world space
The lateral displacement of the grip point in the main side.
Parameters
relativeTo
The reference transform to apply the surface to
Returns
Lateral displacement in world space
void SetWidthOffset
( float widthOffset,
Transform relativeTo )
The range at which the sides are constrained.
X,Y for the back and forward sides range. Z,W for the left and right sides range.
Parameters
relativeTo
The reference transform to apply the surface to
Returns
Offsets in world space
void SetSnapOffset
( Vector4 snapOffset,
Transform relativeTo )
The size of the rectangle.
Y is ignored.
Parameters
relativeTo
The reference transform to apply the surface to
Returns
Size in world space
void SetSize
( Vector3 size,
Transform relativeTo )
The rotation of the rectangle from the Grip point
Parameters
relativeTo
The reference transform to apply the surface to
Returns
Rotation in world space
void SetRotation
( Quaternion rotation,
Transform relativeTo )
The forward direction of the rectangle (based on its rotation)
Parameters
relativeTo
The reference transform to apply the surface to
Returns
Direction in world space
Method for mirroring a Pose around the surface.
Different surfaces will prefer mirroring along different axis.
Parameters
gripPose
The Pose to be mirrored.
relativeTo
Reference transform to mirror the pose around
Returns
A new pose mirrored at this surface.
Creates a new IGrabSurface under the selected gameobject that is a mirror version of the current.
Parameters
gameObject
The gameobject in which to place the new IGrabSurface.
Returns
A mirror of this IGrabSurface.
Creates a new IGrabSurface under the selected gameobject with the same data as this one.
Parameters
gameObject
The gameobject in which to place the new IGrabSurface.
Returns
A clone of this IGrabSurface.
Finds the Pose at the surface that is the closest to the given pose.
Parameters
targetPose
The root pose to find the nearest to.
bestPose
The best found pose at the surface.<
scoringModifier
Weight used to decide which target pose to select
relativeTo
Reference transform to measure the poses against
Returns
The score indicating how good the found pose was, -1 for invalid result.
Finds the Pose at the surface that is the closest to the given pose.
Parameters
targetPose
The root pose to find the nearest to.
offset
The offset from the root, for accurate scoring
bestPose
The best found pose at the surface.<
scoringModifier
Weight used to decide which target pose to select
relativeTo
Reference transform to measure the poses against
Returns
The score indicating how good the found pose was, -1 for invalid result.
Finds the Pose at the surface that is the closest to the given ray.
Parameters
targetRay
Ray searching for the nearest snap pose
bestPose
The best found pose at the surface.
relativeTo
Reference transform to measure the poses against
Returns
True if the pose was found
void InjectAllBoxSurface
Transform relativeTo )
void InjectData
void InjectRelativeTo
( Transform relativeTo )

Protected Functions

virtual void Reset ( )
virtual void Start ( )
Vector3 NearestPointInSurface
( Vector3 targetPosition,
Transform relativeTo )
Pose MinimalRotationPoseAtSurface
( in Pose userPose,
Transform relativeTo )
Pose MinimalTranslationPoseAtSurface
( in Pose userPose,
Transform relativeTo )
Did you find this page helpful?