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

SphereGrabSurface Class

Extends MonoBehaviour
Specifies an entire sphere around an object in which the grip point is valid.
One of the main advantages of spheres is that the rotation of the hand pose does not really matters, as it will always fit the surface correctly.

Protected Fields

Signature
SphereGrabSurfaceData Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface._data

Protected Methods

MinimalRotationPoseAtSurface ( userPose , relativeTo )
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.MinimalRotationPoseAtSurface(in Pose userPose, Transform relativeTo)
Parameters
userPose: in Pose
relativeTo: Transform
Returns
Pose
MinimalTranslationPoseAtSurface ( userPose , relativeTo )
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.MinimalTranslationPoseAtSurface(in Pose userPose, Transform relativeTo)
Parameters
userPose: in Pose
relativeTo: Transform
Returns
Pose
NearestPointInSurface ( targetPosition , relativeTo )
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.NearestPointInSurface(Vector3 targetPosition, Transform relativeTo)
Parameters
targetPosition: Vector3
relativeTo: Transform
Returns
Vector3
Reset ()
Signature
virtual void Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.Reset()
Returns
void
RotationAtPoint ( surfacePoint , baseRot , desiredRotation , relativeTo )
Signature
Quaternion Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.RotationAtPoint(Vector3 surfacePoint, Quaternion baseRot, Quaternion desiredRotation, Transform relativeTo)
Parameters
surfacePoint: Vector3
baseRot: Quaternion
desiredRotation: Quaternion
relativeTo: Transform
Returns
Quaternion
Start ()
Signature
virtual void Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.Start()
Returns
void

Methods

CalculateBestPoseAtSurface ( targetRay , bestPose , relativeTo )
Finds the Pose at the surface that is the closest to the given ray.
Signature
bool Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.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
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.SphereGrabSurface.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.SphereGrabSurface.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.
CreateDuplicatedSurface ( gameObject )
Creates a new IGrabSurface under the selected gameobject with the same data as this one.
Signature
IGrabSurface Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.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.SphereGrabSurface.CreateMirroredSurface(GameObject gameObject)
Parameters
gameObject: GameObject  The gameobject in which to place the new IGrabSurface.
Returns
IGrabSurface  A mirror of this IGrabSurface.
GetCentre ( relativeTo )
The center of the sphere in world coordinates.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.GetCentre(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Position in world space
GetDirection ( relativeTo )
The direction of the sphere, measured from the center to the original grip position.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.GetDirection(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Direction in world space
GetRadius ( relativeTo )
The radius of the sphere, this is automatically calculated as the distance between the center and the original grip pose.
Signature
float Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.GetRadius(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
float  Distance in world space
GetReferencePose ( relativeTo )
The reference pose of the surface.
It defines the radius of the sphere as the point from the relative transform to the reference pose to ensure that the sphere covers this pose.
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.GetReferencePose(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Pose  Pose in world space
InjectAllSphereSurface ( data , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.InjectAllSphereSurface(SphereGrabSurfaceData data, Transform relativeTo)
Parameters
relativeTo: Transform
Returns
void
InjectData ( data )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.InjectData(SphereGrabSurfaceData data)
Parameters
Returns
void
InjectRelativeTo ( relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.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.SphereGrabSurface.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.
SetCentre ( point , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.SphereGrabSurface.SetCentre(Vector3 point, Transform relativeTo)
Parameters
point: Vector3
relativeTo: Transform
Returns
void