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

NavMeshSurface Class

Extends MonoBehaviour
Encapsulating class that wraps a Unity navigation mesh as an ISurface for use in Interaction SDK logic (comparable to how ColliderSurface wraps a Unity Collider).
NavMeshSurface is primarily used in locomotion scenarios to allow an entire floorspace to be navigated as a single large interactable.

Protected Fields

_started : bool
Signature
bool Oculus.Interaction.Surfaces.NavMeshSurface._started

Fields

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

Properties

CalculateHitNormals : bool
[Get][Set]
Determines whether normals on hit calculations are calculated robustly or just assumed to be the world-space up vector.
Since most navigation meshes are flat, typical usage should this setting as false (the default).
Signature
bool Oculus.Interaction.Surfaces.NavMeshSurface.CalculateHitNormals
SnapDistance : float
[Get][Set]
The default distance, in world space, across which targeting should "snap" to the navigation mesh.
Functionally, this value works as a constant addition to the maxDistance argument of ClosestSurfacePoint(in Vector3, out SurfaceHit, float).
Signature
float Oculus.Interaction.Surfaces.NavMeshSurface.SnapDistance
VoxelSize : float
[Get][Set]
Used in internal traversal calculations; making this value larger may reduce compute costs when dealing with large-scale locomotion, but at the cost of precision.
Signature
float Oculus.Interaction.Surfaces.NavMeshSurface.VoxelSize

Protected Methods

Start ()
Signature
virtual void Oculus.Interaction.Surfaces.NavMeshSurface.Start()
Returns
void

Methods

ClosestSurfacePoint ( point , surfaceHit , 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.NavMeshSurface.ClosestSurfacePoint(in Vector3 point, out SurfaceHit surfaceHit, float maxDistance=0)
Parameters
point: in Vector3
surfaceHit: out SurfaceHit
maxDistance: float
Returns
bool
InjectOptionalAgentIndex ( agentIndex )
Signature
void Oculus.Interaction.Surfaces.NavMeshSurface.InjectOptionalAgentIndex(int agentIndex)
Parameters
agentIndex: int
Returns
void
InjectOptionalAreaName ( areaName )
Signature
void Oculus.Interaction.Surfaces.NavMeshSurface.InjectOptionalAreaName(string areaName)
Parameters
areaName: string
Returns
void
Raycast ( ray , surfaceHit , 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.NavMeshSurface.Raycast(in Ray ray, out SurfaceHit surfaceHit, float maxDistance=0)
Parameters
ray: in Ray
surfaceHit: out SurfaceHit
maxDistance: float
Returns
bool