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

PlaneSurface Class

Extends MonoBehaviour
A representation of an infinite plane which can serve as a surface for interactions.
Rarely used on its own, but frequently used as an underlying component of ClippedPlaneSurfaces.
While it is uncommon for a PlaneSurface to be used on its own (because few interactable elements can be considered infinite planes), it is quite common for multiple different ClippedPlaneSurfaces to exist on the same plane: consider multiple buttons on a single interactable UI. In such a scenario, many ClippedPlaneSurfaces can be backed by the same PlaneSurface, ensuring that they always remain coplanar regardless of edits to the underlying surface.

Fields

Transform : Transform
Implementation of ISurface.Transform; for details, please refer to the related documentation provided for that property.
Signature
Transform Oculus.Interaction.Surfaces.PlaneSurface.Transform

Properties

Bounds : Bounds
[Get]
Implementation of IBounds.Bounds; for details, please refer to the related documentation provided for that property.
Signature
Bounds Oculus.Interaction.Surfaces.PlaneSurface.Bounds
DoubleSided : bool
[Get][Set]
Determines whether this plane is double-sided.
If true, this plane can be interacted with from either side; otherwise, the plane is only considered to exist if perceived from the direction of its normal.
Signature
bool Oculus.Interaction.Surfaces.PlaneSurface.DoubleSided
Facing : NormalFacing
[Get][Set]
Gets or sets the direction (NormalFacing.Forward or NormalFacing.Backward) for this plane.
Signature
NormalFacing Oculus.Interaction.Surfaces.PlaneSurface.Facing
Normal : Vector3
[Get]
Returns either the forward direction or the backward direction depending on whether Facing is NormalFacing.Forward or NormalFacing.Backward, respectively.
Signature
Vector3 Oculus.Interaction.Surfaces.PlaneSurface.Normal

Methods

ClosestSurfacePoint ( point , hit , maxDistance )
Implementation of ISurface.ClosestSurfacePoint(in Vector3, out SurfaceHit, float); for details, please refer to the related documentation provided for that property.
Signature
bool Oculus.Interaction.Surfaces.PlaneSurface.ClosestSurfacePoint(in Vector3 point, out SurfaceHit hit, float maxDistance)
Parameters
point: in Vector3
hit: out SurfaceHit
maxDistance: float
Returns
bool
GetPlane ()
Gets a Unity Plane representation of the mathematical plane represented by this PlaneSurface.
Signature
Plane Oculus.Interaction.Surfaces.PlaneSurface.GetPlane()
Returns
Plane
InjectAllPlaneSurface ( facing , doubleSided )
Injects all required dependencies for a dynamically instantiated PlaneSurface; effectively wraps InjectNormalFacing(NormalFacing) and InjectDoubleSided(bool).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Surfaces.PlaneSurface.InjectAllPlaneSurface(NormalFacing facing, bool doubleSided)
Parameters
facing: NormalFacing
doubleSided: bool
Returns
void
InjectDoubleSided ( doubleSided )
Sets whether a dynamically instantiated PlaneSurface should be interactable from both sides.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Surfaces.PlaneSurface.InjectDoubleSided(bool doubleSided)
Parameters
doubleSided: bool
Returns
void
InjectNormalFacing ( facing )
Sets the NormalFacing value for a dynamically instantiated PlaneSurface.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Surfaces.PlaneSurface.InjectNormalFacing(NormalFacing facing)
Parameters
facing: NormalFacing
Returns
void
Raycast ( ray , hit , maxDistance )
Implementation of ISurface.Raycast(in Ray, out SurfaceHit, float); for details, please refer to the related documentation provided for that property.
Signature
bool Oculus.Interaction.Surfaces.PlaneSurface.Raycast(in Ray ray, out SurfaceHit hit, float maxDistance)
Parameters
ray: in Ray
hit: out SurfaceHit
maxDistance: float
Returns
bool

Inner Enum

NormalFacing Enum

Used for interaction with flat surfaces, and acts in much the same way as Unity’s Plane.

Enumeration Constants

MemberDescription
Backward
Normal faces along the transform's negative Z axis
Forward
Normal faces along the transform's positive Z axis