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

MRUKRoom Class

Modifiers: final
Represents a spatial room containing anchors and surfaces detected by the Mixed Reality Utility Kit.
MRUKRoom manages room data including walls, floors, ceilings, and spatial anchors within a physical space. It provides functionality to access room surfaces, check if positions are contained within the room boundaries, and manage the room's lifecycle.

Signature

class MRUKRoom(var anchor: Anchor)

Constructors

MRUKRoom ( anchor )
Signature
constructor(anchor: Anchor)
Parameters
anchor: Anchor
  The primary anchor that represents this room's coordinate system
Returns

Properties

anchor : Anchor
[Get][Set]
Signature
var anchor: Anchor
anchors : MutableList
[Get]
List of all anchor entities in this room.
This includes all spatial anchors detected in the room such as walls, floors, ceilings, and furniture. Each entity contains components like MRUKAnchor, MRUKPlane, or MRUKVolume that describe its properties.
Signature
var anchors: MutableList<Entity>
ceilings : MutableList
[Get]
Signature
var ceilings: MutableList<Entity>
entity : Entity?
[Get][Set]
Signature
var entity: Entity?
floors : MutableList
[Get]
Signature
var floors: MutableList<Entity>
globalMesh : MRUKMesh?
[Get][Set]
Signature
var globalMesh: MRUKMesh?
roomBounds : Bound3D
[Get][Set]
Signature
var roomBounds: Bound3D
roomMesh : MRUKRoomMesh?
[Get][Set]
Signature
var roomMesh: MRUKRoomMesh?
walls : MutableList
[Get]
Signature
var walls: MutableList<Entity>

Functions

create ()
Creates and initializes the room entity.
This method must be called before using the room to ensure the entity is properly initialized.
Signature
fun create()
destroy ()
Destroys this room and all associated entities and anchors.
This method cleans up all resources associated with the room, including destroying all anchor entities and the room entity itself. After calling this method, the room should not be used.
Signature
fun destroy()
getKeyWall ()
Returns the wall entity with the largest width in the room.
The width is determined by measuring the x-axis extent of each wall's plane component. This is typically used to identify the most prominent wall for content placement or alignment.
Signature
fun getKeyWall(): Entity?
Returns
  The widest wall entity, or null if no walls exist or no walls have a MRUKPlane component
isPositionInRoom ( position , testVerticalBounds )
Checks if a given position is contained within the room's boundaries.
This method determines whether a 3D position falls within the spatial bounds of the room. It can optionally test vertical bounds to check if the position is between the floor and ceiling.
Signature
fun isPositionInRoom(position: Vector3, testVerticalBounds: Boolean = true): Boolean
Parameters
position: Vector3
  The 3D position to test in world coordinates
testVerticalBounds: Boolean
  If true, checks if the position is between floor and ceiling; if false, only checks horizontal (XZ plane) containment
Returns
Boolean
  True if the position is within the room boundaries, false otherwise
setPose ( pose )
Signature
fun setPose(pose: Pose)
Parameters
pose: Pose
Did you find this page helpful?