API reference

OVRTriangleMesh Struct

Extends IOVRAnchorComponent< OVRTriangleMesh >, IEquatable< OVRTriangleMesh >
Represents the Triangle Mesh component of an OVRAnchor.
This component can be accessed from an OVRAnchor that supports it by calling OVRAnchor.GetComponent<T> from the anchor.
See Also

Properties

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

Public Statics

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

Member Functions

OVRTask< bool > IOVRAnchorComponent< OVRTriangleMesh >. SetEnabledAsync
( bool enabled,
double timeout )
bool 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 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 GetHashCode ( )
Gets a hashcode suitable for use in a Dictionary or HashSet.
Returns
A hashcode for this component.
override string ToString ( )
Gets a string representation of this component.
Returns
A string representation of this component.
bool 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
See Also
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 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.
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 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 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 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.