API reference

MRUKRoom Class

Extends MonoBehaviour

Fields

OVRAnchor Anchor[Get]

Properties

Contains all the scene anchors in the room.
Contains all the wall anchors in the room.
The floor anchor in the room.
The ceiling anchor in the room.
The global mesh anchor in the room.
List< CouchSeat > SeatPoses[Get]
Gets fired when a new anchor of this room has been created.
Gets fired after a component of the corresponding anchor has changed.
Gets fired when the anchor has been deleted.

Member Functions

Registers a callback function to be called when an anchor is created.
Parameters
callback
The function to be called when an anchor is created. It takes one parameter:
  • MRUKAnchor The created anchor object.
Registers a callback function to be called before an anchor is updated.
Parameters
callback
The function to be called when an anchor is updated. It takes one parameter:
  • MRUKAnchor The updated anchor object.
Registers a callback function to be called when an anchor is removed.
Parameters
callback
The function to be called when an anchor is removed. It takes one parameter:
  • MRUKAnchor The removed anchor object.
UnRegisters a callback function to be called when an anchor is created.
Parameters
callback
The function to be called when an anchor is created. It takes one parameter:
  • MRUKAnchor The created anchor object.
UnRegisters a callback function to be called before an anchor is updated.
Parameters
callback
The function to be called when an anchor is updated. It takes one parameter:
  • MRUKAnchor The updated anchor object.
UnRegisters a callback function to be called when an anchor is removed.
Parameters
callback
The function to be called when an anchor is removed. It takes one parameter:
  • MRUKAnchor The removed anchor object.
Returns all the Scene objects in the room.

Useful if you want to do your own calculations within the Mixed Reality Utility Kit framework.
Removes an anchor from the internal list and destroys the gameobject and it's children.
Parameters
anchor
The Anchor to remove and destroy
Get the floor anchor of this room.
Get the ceiling anchor of this room.
Get the global mesh anchor of this room.
Get the wall anchors of this room.
Returns a clockwise (when viewed top-down) list of wall corner points, at floor level.
A Key Wall has two requirements:
It's the longest wall in the room, and more importantly, has NO other room points behind it.

With a Key Wall, an artist can craft a more "stage-like" environment, avoiding the obligation of procedural art.
Cast a ray against ONLY Scene API objects, returning all results.

Use as a replacement for Physics.RaycastAll.
Cast a ray against ONLY Scene API objects, returning the closest result.

Use as a replacement for Physics.Raycast.
Cast a ray against ONLY Scene API objects, returning the closest result.

Use as a replacement for Physics.Raycast.
Cast a ray against ONLY Scene API objects, returning the closest result.

Use as a replacement for Physics.Raycast.
Cast a ray against ONLY Scene API objects, returning the closest result.

Use as a replacement for Physics.Raycast.
Use this if you want a "suggested" transform from hitting a Scene anchor, i.e.
how best to "place an app/widget" on a surface.
When hitting vertical surfaces; Y is world-up, Z is surface normal.
When hitting horizontal surfaces; Y is world-up, Z is best-guess at player-facing.
"best guess" = when on ceiling/floor, Z faces player; when on surface (desk/couch), Z faces closest edge to player
Pose GetBestPoseFromRaycast
( Ray ray,
float maxDist,
LabelFilter labelFilter,
out MRUKAnchor sceneAnchor,
MRUK.PositioningMethod positioningMethod )
Test if a position is inside the floor outline of the walls.

Optionally, test floor/ceiling so the room isn't an "infinity column"
Get a world-oriented bounding box of the room.
Test if a position is inside of a Scene volume, and optionally return the object.

To also check if a position is inside the room walls, use IsPositionInRoom().
Use distanceBuffer as a cheap way to check volume intersection.
Get a "likely" direction this anchor is facing.
For planes, this is always the normal (Z-forward). For volumes, we use contextual clues; primarily, the closest wall is the "back" of the volume, and the facing direction is its axis most aligned with this wall normal.
Test if a position is inside of a Scene volume (couch, desk, etc.).

To also check if a position is inside the room walls, use IsPositionInRoom().
Use distanceBuffer as a cheap way to check volume intersection.
Test if a position is inside of a Scene volume (couch, desk, etc.).

To also check if a position is inside the room walls, use IsPositionInRoom().
Use distanceBuffer as a cheap way to check volume intersection.
Returns the best-suggested seat, for something like remote caller placement.
Returns all seats in the room (a human-spaced position on a COUCH).
Return the parent of an anchor, if it exists.

This hierarchical relationship is by reference, not literally in the scene.
Returns the logical children of an anchor, if there are any.

This hierarchical relationship is by reference, not literally in the scene.
OVRSemanticLabels.DeprecationMessage
See if a room has all the provided Scene API labels.
The closest position on a SceneAPI surface.
MRUKAnchor FindLargestSurface
( string anchorLabel )
Returns the anchor with the largest available surface area.
A bit more flexible than HasTableSpace, can be adapted for other usage
Generate a random position in a room, while avoiding volume scene objects and points that are too close to surfaces.
This function uses random sampling and a maximum number of iterations.
Parameters
minDistanceToSurface
Reject points whose proximity to a surface is less than the parameter.
avoidVolumes
Do not allow points to be within volume scene objects.
Returns
A position that adhers to the constraints, null otherwise.
Generate a position on any valid surface in the room, limited by the type of surface and the classification of the object.
Parameters
surfaceTypes
The type of surface by which to limit the generation.
minDistanceToEdge
Limit the generated point to not being close to a surface's edges and corners.
labelFilter
The labels to include
position
The generated position. Vector3.zero is returned if no position was generated.
normal
The generated surface normal. Vector3.zero is returned if nothing was generated.
Returns
True if a position was found, false otherwise.
Compares the current MRUKRoom data to another room data.
If all the anchors contained within it are identical then this function returns true.
Parameters
roomData
The other room data.
Returns
True if the two rooms are identical, false otherwise.
Checks to see if the room is the same.
They are classed as the same room if any of the anchors contained within it have the same UUID, even if some anchors may have been added, removed or modified.
Parameters
roomData
The other room data.
Returns
True if the two rooms are the same, false otherwise.

Static Member Functions

static List< MRUKAnchor > SortWallsByWidth
( List< MRUKAnchor > walls )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon