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

OVRTriangleMesh Struct

Represents the Triangle Mesh component of an OVRAnchor.
OVRTriangleMesh extends IOVRAnchorComponent< OVRTriangleMesh >.
OVRTriangleMesh extends IEquatable< OVRTriangleMesh >.

Overview

Properties

SpaceComponentType IOVRAnchorComponent< OVRTriangleMesh >.
Type[Get]
Handle[Get]
bool
IsNull[Get]
Whether this object represents a valid anchor component.
bool
True if this component is enabled and no change to its enabled status is pending.
SpaceComponentType
Type[Get]
ulong
Handle[Get]

Static Fields

static readonly OVRTriangleMesh
Null[Get]
A null representation of an OVRTriangleMesh.

Public Member Functions

FromAnchor
( OVRAnchor anchor )
SetEnabledAsync
( bool enabled,
double timeout )
bool
Compares this component for equality with other .
override bool
Equals
( object obj )
Compares this component for equality with obj .
override int
Gets a hashcode suitable for use in a Dictionary or HashSet.
override string
Gets a string representation of this component.
bool
TryGetCounts
( out int vertexCount,
out int triangleCount )
Gets the number of vertices and triangles in the mesh.
bool
TryGetMeshRawUntransformed
( NativeArray< Vector3 > positions,
NativeArray< int > indices )
Gets the raw, untransformed triangle mesh.
bool
TryGetMesh
( NativeArray< Vector3 > positions,
NativeArray< int > indices )
Gets the triangle mesh.
JobHandle
ScheduleGetMeshJob
( NativeArray< Vector3 > positions,
NativeArray< int > indices,
JobHandle dependencies )
Schedules a job to get an anchor's triangle mesh.

Static Public Member Functions

static bool
Compares two components for equality.
static bool
Compares two components for inequality.

Details

Detailed Description

This component can be accessed from an OVRAnchor that supports it by calling OVRAnchor.GetComponent<T> from the anchor.

Properties

SpaceComponentType IOVRAnchorComponent<OVRTriangleMesh>. OVRTriangleMesh.Type
No description available.
ulong IOVRAnchorComponent<OVRTriangleMesh>. OVRTriangleMesh.Handle
No description available.
bool OVRTriangleMesh.IsNull
Whether this object represents a valid anchor component.
bool OVRTriangleMesh.IsEnabled
True if this component is enabled and no change to its enabled status is pending.
SpaceComponentType OVRTriangleMesh.Type
No description available.
ulong OVRTriangleMesh.Handle
No description available.

Public Statics

readonly OVRTriangleMesh OVRTriangleMesh.Null
A null representation of an OVRTriangleMesh.
Use this to compare with another component to determine whether it is null.

Member Functions

OVRTriangleMesh IOVRAnchorComponent< OVRTriangleMesh >. OVRTriangleMesh.FromAnchor
( OVRAnchor anchor )
No description available.
OVRTask< bool > IOVRAnchorComponent< OVRTriangleMesh >. OVRTriangleMesh.SetEnabledAsync
( bool enabled,
double timeout )
No description available.
bool OVRTriangleMesh.Equals
( OVRTriangleMesh other )
Compares this component for equality with other .
Parameters
other
The other component to compare with.
Returns
True if both components belong to the same OVRAnchor, otherwise false.
override bool OVRTriangleMesh.Equals
( object obj )
Compares this component for equality with obj .
Parameters
obj
The object to compare with.
Returns
True if obj is an OVRTriangleMesh and Equals(OVRTriangleMesh) is true, otherwise false.
override int OVRTriangleMesh.GetHashCode ( )
Gets a hashcode suitable for use in a Dictionary or HashSet.
Returns
A hashcode for this component.
override string OVRTriangleMesh.ToString ( )
Gets a string representation of this component.
Returns
A string representation of this component.
bool OVRTriangleMesh.TryGetCounts
( out int vertexCount,
out int triangleCount )
Gets the number of vertices and triangles in the mesh.
Use this method to get the required sizes of the vertex and triangle index buffers. The length of the indices array passed to TryGetMesh and should be three times triangleCount .
This method is thread-safe.
Parameters
vertexCount
The number of vertices in the mesh.
triangleCount
The number of triangles in the mesh. There are three times as many indices.
Returns
True if the counts were retrieved; otherwise, false.
bool OVRTriangleMesh.TryGetMeshRawUntransformed
( NativeArray< Vector3 > positions,
NativeArray< int > indices )
Gets the raw, untransformed triangle mesh.
bool OVRTriangleMesh.TryGetMesh
( NativeArray< Vector3 > positions,
NativeArray< int > indices )
Gets the triangle mesh.
The caller owns the memory of the input arrays and is responsible for allocating them to the appropriate size before passing them to this method. Use TryGetCounts to determine the required size of each array. Note that indices should be three times the number of triangles (triangleCount) indicated by TryGetCounts.
This method is thread-safe.
Parameters
positions
The vertex positions of the mesh.
indices
The triangle indices of the mesh.
Returns
True if the mesh data was retrieved; otherwise, false.
JobHandle OVRTriangleMesh.ScheduleGetMeshJob
( NativeArray< Vector3 > positions,
NativeArray< int > indices,
JobHandle dependencies )
Schedules a job to get an anchor's triangle mesh.
This schedules jobs with the Unity Job system to retrieve the mesh data and then perform the necessary conversion to Unity's coordinate space (see TryGetMeshRawUntransformed).
The caller owns the memory of the input arrays and is responsible for allocating them to the appropriate size before passing them to this method. Use TryGetCounts to determine the required size of each array. Note that indices should be three times the number of triangles (triangleCount) indicated by TryGetCounts.
If the triangle mesh cannot be retrieved, all indices will be set to zero. Use this to check for success after the job completes. For example, if the first three indices are zero, then the mesh is not valid.
Parameters
positions
The vertex positions of the triangle mesh.
indices
The triangle indices of the triangle mesh.
dependencies
(Optional) A job on which the new jobs will depend.
Returns
Returns the handle associated with the new job.

Static Member Functions

static bool OVRTriangleMesh.operator==
Compares two components for equality.
Parameters
lhs
The component to compare with rhs .
rhs
The component to compare with lhs .
Returns
True if both components belong to the same OVRAnchor, otherwise false.
static bool OVRTriangleMesh.operator!=
Compares two components for inequality.
Parameters
lhs
The component to compare with rhs .
rhs
The component to compare with lhs .
Returns
True if the components do not belong to the same OVRAnchor, otherwise false.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon