Variable: XRPlane
const
XRPlane:Component
<{_plane
: {default
:any
;type
:Object
; }; }>
Defined in: packages/core/src/scene-understanding/plane.ts:36
Component representing a detected real‑world plane surface in AR/VR environments. This component should be attached to entities by the SceneUnderstandingSystem and be queried by custom systems.
Remarks
- Automatically created by SceneUnderstandingSystem when planes are detected.
- Represents flat surfaces like floors, walls, and ceilings in the real world.
- Entities are destroyed when the corresponding real‑world plane is no longer detected.
- Requires WebXR session with 'plane‑detection' feature enabled.
- Users should not manually create entities with this component and let the scene understanding system manage them.
Example
ts
your-system.query({ required: [XRPlane] }).subscribe('qualify', (entity) => {
const plane = entity.getValue(XRPlane, 'plane')
console.log('Detected plane orientation:', plane.orientation)
console.log('Plane position:', entity.object3D?.position)
})