API reference

MRUKAnchor Class

Extends MonoBehaviour

Member Enumerations

Enumeration SceneLabels

FLOOR
= 1 << OVRSemanticLabels.Classification.Floor
CEILING
= 1 << OVRSemanticLabels.Classification.Ceiling
WALL_FACE
= 1 << OVRSemanticLabels.Classification.WallFace
TABLE
= 1 << OVRSemanticLabels.Classification.Table
COUCH
= 1 << OVRSemanticLabels.Classification.Couch
DOOR_FRAME
= 1 << OVRSemanticLabels.Classification.DoorFrame
WINDOW_FRAME
= 1 << OVRSemanticLabels.Classification.WindowFrame
OTHER
= 1 << OVRSemanticLabels.Classification.Other
STORAGE
= 1 << OVRSemanticLabels.Classification.Storage
BED
= 1 << OVRSemanticLabels.Classification.Bed
SCREEN
= 1 << OVRSemanticLabels.Classification.Screen
LAMP
= 1 << OVRSemanticLabels.Classification.Lamp
PLANT
= 1 << OVRSemanticLabels.Classification.Plant
WALL_ART
= 1 << OVRSemanticLabels.Classification.WallArt
GLOBAL_MESH
= 1 << OVRSemanticLabels.Classification.SceneMesh
INVISIBLE_WALL_FACE
= 1 << OVRSemanticLabels.Classification.InvisibleWallFace

Properties

OVRSemanticLabels.DeprecationMessage
SceneLabels Label[Get]
bool HasPlane[Get]
bool HasVolume[Get]
Mesh GlobalMesh[Get]

Fields

Rect? PlaneRect[Get]
Bounds? VolumeBounds[Get]
List< Vector2 > PlaneBoundary2D[Get]
OVRAnchor Anchor[Get]
MRUKRoom Room[Get]
MRUKAnchor ParentAnchor[Get]
List< MRUKAnchor > ChildAnchors[Get]

Member Functions

We prefer to avoid colliders and Physics.Raycast because:
  1. It requires tags/layers to filter out Scene API object hits from general raycasts. This can be intrusive to a dev's pipeline by altering their project settings
  2. It requires specific Plane & Volume prefabs that MRUK instantiates with colliders as children
  3. It seems like overkill, since we already "know" where all the Scene API primitives are; no need to raycast everywhere to find them
    Instead, we use Plane.Raycast and other methods to see if the ray has hit the surface of the object
bool IsPositionInBoundary
( Vector2 position )
void AddChildReference
( MRUKAnchor childObj )
void ClearChildReferences ( )
float GetDistanceToSurface
( Vector3 position )
float GetClosestSurfacePosition
( Vector3 testPosition,
out Vector3 closestPosition )
float GetClosestSurfacePosition
( Vector3 testPosition,
out Vector3 closestPosition,
out Vector3 normal )
Vector3 GetAnchorCenter ( )
A convenience function to get a transform-friendly Vector3 size of an anchor.
If you'd like the size of the quad or volume instead, use
See Also
MRUKAnchor.PlaneRect, MRUKAnchor.VolumeBounds
or
Vector3[] GetBoundsFaceCenters ( )
Test if a position is inside of this volume (couch, desk, etc.)
Mesh LoadGlobalMeshTriangles ( )
bool HasLabel
( string label )
bool HasAnyLabel
( List< string > labels )
See if an anchor contains any of the SceneLabels passed as a parameter.
OVRSemanticLabels.DeprecationMessage
Compares the current MRUKAnchor object with another Data.AnchorData object for equality.
Parameters
anchorData
The Data.AnchorData object to compare with.
Returns
True if both objects are equal, false otherwise.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon