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

CylinderGrabSurface Class

Extends MonoBehaviour
This type of surface defines a cylinder in which the grip pose is valid around an object.
An angle and offset can be used to constrain the cylinder and not use a full circle. The radius is automatically specified as the distance from the axis of the cylinder to the original grip position.

Protected Fields

Signature
CylinderSurfaceData Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface._data

Properties

ArcLength : float
[Get][Set]
The maximum angle for the surface of the cylinder, starting from the ArcOffset.
To invert the direction of the angle, swap the caps order.
Signature
float Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.ArcLength
ArcOffset : float
[Get][Set]
Degrees from the starting radius from which the arc section starts.
Signature
float Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.ArcOffset

Protected Methods

CalculateRotationOffset ( surfacePoint , relativeTo )
Signature
Quaternion Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.CalculateRotationOffset(Vector3 surfacePoint, Transform relativeTo)
Parameters
surfacePoint: Vector3
relativeTo: Transform
Returns
Quaternion
MinimalRotationPoseAtSurface ( userPose , relativeTo )
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.MinimalRotationPoseAtSurface(in Pose userPose, Transform relativeTo)
Parameters
userPose: in Pose
relativeTo: Transform
Returns
Pose
MinimalTranslationPoseAtSurface ( userPose , relativeTo )
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.MinimalTranslationPoseAtSurface(in Pose userPose, Transform relativeTo)
Parameters
userPose: in Pose
relativeTo: Transform
Returns
Pose
NearestPointInSurface ( targetPosition , relativeTo )
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.NearestPointInSurface(Vector3 targetPosition, Transform relativeTo)
Parameters
targetPosition: Vector3
relativeTo: Transform
Returns
Vector3
Reset ()
Signature
virtual void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.Reset()
Returns
void
Start ()
Signature
virtual void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.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.CylinderGrabSurface.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.CylinderGrabSurface.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.CylinderGrabSurface.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.CylinderGrabSurface.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.CylinderGrabSurface.CreateMirroredSurface(GameObject gameObject)
Parameters
gameObject: GameObject  The gameobject in which to place the new IGrabSurface.
Returns
IGrabSurface  A mirror of this IGrabSurface.
GetDirection ( relativeTo )
Direction of the cylinder, from the start cap to the end cap.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetDirection(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Direction in world space
GetEndArcDir ( relativeTo )
Direction from the axis of the cylinder to the maximum angle allowance.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetEndArcDir(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Direction in world space
GetEndPoint ( relativeTo )
End cap of the cylinder, in world coordinates.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetEndPoint(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Position in world space
GetPerpendicularDir ( relativeTo )
Direction from the axis of the cylinder to the original grip position.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetPerpendicularDir(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Direction in world space
GetRadius ( relativeTo )
The generated radius of the cylinder.
Represents the distance from the axis of the cylinder to the original grip position.
Signature
float Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.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 cylinder as the point from the relative transform to the reference pose to ensure that the cylinder covers this pose.
Signature
Pose Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetReferencePose(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Pose  Pose in world space
GetStartArcDir ( relativeTo )
Direction from the axis of the cylinder to the minimum angle allowance.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetStartArcDir(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Direction in world space
GetStartPoint ( relativeTo )
Base cap of the cylinder, in world coordinates.
Signature
Vector3 Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.GetStartPoint(Transform relativeTo)
Parameters
relativeTo: Transform  The reference transform to apply the surface to
Returns
Vector3  Position in world space
InjectAllCylinderSurface ( data , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.InjectAllCylinderSurface(CylinderSurfaceData data, Transform relativeTo)
Parameters
relativeTo: Transform
Returns
void
InjectData ( data )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.InjectData(CylinderSurfaceData data)
Parameters
Returns
void
InjectRelativeTo ( relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.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.CylinderGrabSurface.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.
SetEndPoint ( point , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.SetEndPoint(Vector3 point, Transform relativeTo)
Parameters
point: Vector3
relativeTo: Transform
Returns
void
SetStartPoint ( point , relativeTo )
Signature
void Oculus.Interaction.Grab.GrabSurfaces.CylinderGrabSurface.SetStartPoint(Vector3 point, Transform relativeTo)
Parameters
point: Vector3
relativeTo: Transform
Returns
void