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

BoxGrabSurface Class

Extends MonoBehaviour
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

Signature
BoxGrabSurfaceData Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface._data

Protected Methods

MinimalRotationPoseAtSurface ( userPose , relativeTo )
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.MinimalRotationPoseAtSurface(in Pose userPose, Transform relativeTo)
Parameters
userPose: in Pose
relativeTo: Transform
Returns
Pose
MinimalTranslationPoseAtSurface ( userPose , relativeTo )
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.MinimalTranslationPoseAtSurface(in Pose userPose, Transform relativeTo)
Parameters
userPose: in Pose
relativeTo: Transform
Returns
Pose
NearestPointInSurface ( targetPosition , relativeTo )
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.NearestPointInSurface(Vector3 targetPosition, Transform relativeTo)
Parameters
targetPosition: Vector3
relativeTo: Transform
Returns
Vector3
Reset ()
Signature
virtual void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.Reset()
Returns
void
Start ()
Signature
virtual void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.Start()
Returns
void

Methods

CalculateBestPoseAtSurface ( targetPose , bestPose , scoringModifier , relativeTo )
Finds the Pose at the surface that is the closest to the given pose.
Signature
GrabPoseScore Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.CalculateBestPoseAtSurface(in Pose targetPose, out Pose bestPose, in PoseMeasureParameters scoringModifier, Transform relativeTo)
Parameters
targetPose: in Pose  The root pose to find the nearest to.
bestPose: out Pose  The best found pose at the surface.<
scoringModifier: in PoseMeasureParameters  Weight used to decide which target pose to select
relativeTo: Transform  Reference transform to measure the poses against
Returns
GrabPoseScore  The score indicating how good the found pose was, -1 for invalid result.
CalculateBestPoseAtSurface ( targetPose , offset , bestPose , scoringModifier , relativeTo )
Finds the Pose at the surface that is the closest to the given pose.
Signature
GrabPoseScore Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.CalculateBestPoseAtSurface(in Pose targetPose, in Pose offset, out Pose bestPose, in PoseMeasureParameters scoringModifier, Transform relativeTo)
Parameters
targetPose: in Pose  The root pose to find the nearest to.
offset: in Pose  The offset from the root, for accurate scoring
bestPose: out Pose  The best found pose at the surface.<
scoringModifier: in PoseMeasureParameters  Weight used to decide which target pose to select
relativeTo: Transform  Reference transform to measure the poses against
Returns
GrabPoseScore  The score indicating how good the found pose was, -1 for invalid result.
CalculateBestPoseAtSurface ( targetRay , bestPose , relativeTo )
Finds the Pose at the surface that is the closest to the given ray.
Signature
bool Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.CalculateBestPoseAtSurface(Ray targetRay, out Pose bestPose, Transform relativeTo)
Parameters
targetRay: Ray  Ray searching for the nearest snap pose
bestPose: out Pose  The best found pose at the surface.
relativeTo: Transform  Reference transform to measure the poses against
Returns
bool  True if the pose was found
CreateDuplicatedSurface ( gameObject )
Creates a new IGrabSurface under the selected gameobject with the same data as this one.
Signature
IGrabSurface Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.CreateDuplicatedSurface(GameObject gameObject)
Parameters
gameObject: GameObject  The gameobject in which to place the new IGrabSurface.
Returns
IGrabSurface  A clone of this IGrabSurface.
CreateMirroredSurface ( gameObject )
Creates a new IGrabSurface under the selected gameobject that is a mirror version of the current.
Signature
IGrabSurface Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.CreateMirroredSurface(GameObject gameObject)
Parameters
gameObject: GameObject  The gameobject in which to place the new IGrabSurface.
Returns
IGrabSurface  A mirror of this IGrabSurface.
GetDirection ( relativeTo )
The forward direction of the rectangle (based on its rotation)
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.GetDirection(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Direction in world space
GetReferencePose ( relativeTo )
The origin pose of the surface.
This is the point from which the base of the box must start.
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.GetReferencePose(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Pose  Pose in world space
GetRotation ( relativeTo )
The rotation of the rectangle from the Grip point.
Signature
Quaternion Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.GetRotation(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Quaternion  Rotation in world space
GetSize ( relativeTo )
The size of the rectangle.
Y is ignored.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.GetSize(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Size in world space
GetSnapOffset ( 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.
Signature
Vector4 Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.GetSnapOffset(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector4  Offsets in world space
GetWidthOffset ( relativeTo )
The lateral displacement of the grip point in the main side.
Signature
float Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.GetWidthOffset(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
float  Lateral displacement in world space
InjectAllBoxSurface ( data , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.InjectAllBoxSurface(BoxGrabSurfaceData data, Transform relativeTo)
Parameters
relativeTo: Transform
Returns
void
InjectData ( data )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.InjectData(BoxGrabSurfaceData data)
Parameters
Returns
void
InjectRelativeTo ( relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.InjectRelativeTo(Transform relativeTo)
Parameters
relativeTo: Transform
Returns
void
MirrorPose ( gripPose , relativeTo )
Method for mirroring a Pose around the surface.
Different surfaces will prefer mirroring along different axis.
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.MirrorPose(in Pose pose, Transform relativeTo)
Parameters
gripPose: in Pose  The Pose to be mirrored.
relativeTo: Transform  Reference transform to mirror the pose around
Returns
Pose  A new pose mirrored at this surface.
SetRotation ( rotation , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.SetRotation(Quaternion rotation, Transform relativeTo)
Parameters
rotation: Quaternion
relativeTo: Transform
Returns
void
SetSize ( size , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.SetSize(Vector3 size, Transform relativeTo)
Parameters
size: Vector3
relativeTo: Transform
Returns
void
SetSnapOffset ( snapOffset , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.SetSnapOffset(Vector4 snapOffset, Transform relativeTo)
Parameters
snapOffset: Vector4
relativeTo: Transform
Returns
void
SetWidthOffset ( widthOffset , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.BoxGrabSurface.SetWidthOffset(float widthOffset, Transform relativeTo)
Parameters
widthOffset: float
relativeTo: Transform
Returns
void