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

IGrabSurface Interface

This interface defines the methods needed to use grab surfaces, such as finding the nearest poses at the surface to a given set of parameters and duplicating and mirroring the surface.
For a canonical example of an implementation of this interface, see ColliderGrabSurface.

Member Functions

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
Method for mirroring a Pose around the surface.
Different surfaces will prefer mirroring along different axes. For example, BoxGrabSurface mirrors along its "left-right" axis, whereas BezierGrabSurface does not support mirroring and simply returns the provided gripPose .
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.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon