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

com.meta.spatial.mruk

Package-level declarations

Types

NameSummary
data class AnchorData(val anchor: Anchor, val semanticClassifications: List<String>, val transform: TransformData, val planeBounds: PlaneBoundsData? = null, val volumeBounds: VolumeBoundsData? = null, val planeBoundary2D: List<Vector2>? = null, val globalMesh: GlobalMeshData? = null)
enum AnchorMeshScalingMode : Enum<AnchorMeshScalingMode>
Scaling mode when a mesh gets spawned.
enum AnchorMeshSelectionMode : Enum<AnchorMeshSelectionMode>
Selection mode when choosing from multiple meshes.
class AnchorMeshSpawner(val mrukFeature: MRUKFeature, var spawnGroups: Map<MRUKLabel, AnchorMeshSpawner.AnchorMeshGroup>, val spawnMode: MRUKSpawnMode = MRUKSpawnMode.CURRENT_ROOM_ONLY)
The AnchorMeshSpawner class is designed to facilitate the spawning of 3D meshes (glb/gltf) at scene anchor locations. It is intended for use in conjunction with the MRUKFeature. This class automatically spawns meshes in a room when new anchors are loaded by the MRUKFeature, ensuring that the meshes remain synchronized with the current anchors. The spawning behavior can be customized using the spawnMode. For usage examples, refer to the MrukSampleActivity. Note that if you want to generate walls and floors without providing meshes for it refer to the AnchorProceduralMesh. The spawnGroups parameter specifies which meshes to spawn based on a label. It is crucial to invoke the destroy() method when the AnchorMeshSpawner instance is no longer in use.
class AnchorProceduralMesh(val mrukFeature: MRUKFeature, var labelToConfig: Map<MRUKLabel, AnchorProceduralMeshConfig>, val spawnMode: MRUKSpawnMode = MRUKSpawnMode.CURRENT_ROOM_ONLY, var wallTexCoordModeU: MRUKWallTexCoordModeU = MRUKWallTexCoordModeU.METRIC, var wallTexCoordModeV: MRUKWallTexCoordModeV = MRUKWallTexCoordModeV.METRIC, var anchorTexCoordMode: MRUKAnchorTexCoordMode = MRUKAnchorTexCoordMode.STRETCH, var cutHoleLabels: List<MRUKLabel> = listOf(MRUKLabel.WINDOW_FRAME, MRUKLabel.DOOR_FRAME))
The AnchorProceduralMesh is designed to automatically generate meshes for the given labels in a room. It is able to generate planes and boxes. In addition, it’s possible to cut holes into planes. This can be useful for windows. It’s also possible to spawn physics colliders for the generated meshes. AnchorProceduralMesh is intended for use in conjunction with the MRUKFeature. This class automatically spawns meshes in a room when new anchors are loaded by the MRUKFeature, ensuring that the meshes remain synchronized with the current anchors. The spawning behavior can be customized using the spawnMode. For usage examples, refer to the MrukSampleActivity. If you want to be able to spawn 3D meshes from glb or gltf files refer to AnchorMeshSpawner. It is crucial to invoke the destroy() method when the AnchorMeshSpawner instance is no longer in use.
class AnchorProceduralMeshConfig
The AnchorProceduralMeshConfig contains configuration to generate a procedural mesh. It contains the material and whether a physics collider should be generated.
data class GlobalMeshData(val positions: FloatArray, val indices: IntArray)
enum MRUKAnchorTexCoordMode : Enum<MRUKAnchorTexCoordMode>
The texture coordinate mode for planes and volumes.
class MRUKFeature : SpatialFeature
MRUK - Mixed Reality Utility Kit
data class MRUKHit(val hitDistance: Float, val hitPosition: Vector3, val hitNormal: Vector3, val roomAnchorUuid: UUID, val sceneAnchorUuid: UUID)
enum MRUKLabel : Enum<MRUKLabel>
enum MRUKLoadDeviceResult : Enum<MRUKLoadDeviceResult>
Enum class representing the possible results of a load device operation.
data class MRUKMesh(val positions: FloatArray, val normals: FloatArray, val indices: IntArray)
class MRUKNativeResultException(val errorCode: Int) : Exception
data class MRUKPlaneUV(val offset: Vector2, val scale: Vector2)
Data container to store offset and scale of a planes UV coordinates.
class MRUKRoom(var anchor: Anchor)
interface MRUKSceneEventListener
Events that occur during the MRUK Scene lifecycle.
enum MRUKWallTexCoordModeU : Enum<MRUKWallTexCoordModeU>
The texture coordinate mode for walls U channel.
enum MRUKWallTexCoordModeV : Enum<MRUKWallTexCoordModeV>
The texture coordinate mode for walls V channel.
data class PlaneBoundsData(val min: Vector2, val max: Vector2)
data class RoomData(val anchor: Anchor, val roomLayout: RoomLayoutData, val anchors: List<AnchorData>)
data class RoomLayoutData(val floorUuid: UUID, val ceilingUuid: UUID, val wallsUuid: List<UUID>)
data class SceneData(val coordinateSystem: String, val rooms: List<RoomData>)
data class TransformData(val translation: Vector3, val rotation: Vector3)
data class VolumeBoundsData(val min: Vector3, val max: Vector3)

Functions

NameSummary
destroyWithChildren
fun Entity.destroyWithChildren()
getVolume
fun Bound3D.getVolume(): Float
mrukAnchorChildren
fun mrukAnchorChildren(entity: Entity): List<Entity>
Did you find this page helpful?
Thumbs up icon
Thumbs down icon