XR Meshes
Updated
Shows the scanned shape of the real room.
- Type
comp-xr-meshes- Script class
XRMeshesComponent- Per entity
- One
- Version
- 1.0.0
Read about it in XR world: what it does, how to use it from a script, and examples.
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
XRMeshes::detectedXRMeshes::updatedXRMeshes::lost
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Bounce balls on the real roomXR Planes with an XR Plane Collider and XR Meshes with an XR Mesh Collider make the detected room solid, drawn as translucent blue as in the runtime AR Placement demo. Balls drop every two seconds and bounce on the real floor and furniture.
This one needs AR: enter AR on a device that detects planes or room meshes and the balls land on real surfaces. On a desktop nothing is detected, so a virtual floor catches them.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(XRMeshesComponent); if (component) log(component.props);}