XrSpatialAnchor QML Type

Represents a spatial anchor in an XR session. More...

Import Statement: import QtQuick3D.Xr
Since: Qt 6.8
Inherits:

Item

Status: Technical Preview

Properties

Signals

Detailed Description

This type represents a spatial anchor that can be used to track a specific location or object in real space. It provides information about the anchor's position, rotation, classification, and bounds.

They are accessed through an XrSpatialAnchorListModel.

Note: You can not create these in QML.

Property Documentation

Classification : enumeration

The classification of the spatial anchor.

The Classification enum provides a set of predefined category types that can be used to describe the purpose or context of a spatial anchor.

ConstantDescription
Classification.UnknownThe label has not been set or identified.
Classification.WallThe anchor represents a wall.
Classification.CeilingThe anchor represents a ceiling.
Classification.FloorThe anchor represents a floor.
Classification.TableThe anchor represents a table.
Classification.SeatThe anchor represents a seat.
Classification.WindowThe anchor represents a window.
Classification.DoorThe anchor represents a door.
Classification.OtherThe anchor was not identified as any of the above types. See: classificationString

Note: This list is meant to show the mapping between the classification type in QtQuick3DXr, OpenXR, and VisionOS. If the classification type from the system falls outside of the defined types then the Type is set to Other and the system type can be inspected by looking at the content of the classificationString property. Note that the classification string can also be "Other".

TypeOpenXRVisionOSDescription
Unknown--The label has not been set or identified.
WallWALL_FACEWallThe anchor represents a wall.
CeilingCEILINGCeilingThe anchor represents a ceiling.
FloorFLOORFloorThe anchor represents a floor.
TableTABLETableThe anchor represents a table.
SeatCOUCHSeatThe anchor represents a seat.
WindowWINDOW_FRAMEWindowThe anchor represents a window.
DoorDOOR_FRAMEDoorThe anchor represents a door.
Other--The anchor represents something else. See: classificationString

classification : string

The classification type associated with the spatial anchor.

This property returns the classification type for this anchor (for example,Table or Floor) describing the anchor's purpose or context.

Note: The classification type coming from the system might not be in the set of labels defined by the Classification enum, in which case the type will be set to Other and the classificationString property will contain the original label.

See also classificationString.


classificationString : string

The system classification type as a string for the spatial anchor.

This property returns the classification type as a string, if one exisits. If the classification type is not in the set of types defined by the Classification enums, the label is set to Other and this property can be used to access the type as it was reported by the system.

Note: This string can be empty, or change, depending on the system and how the anchor gets classified.

See also classification.


extent2D : vector2d

The 2D extent of the spatial anchor.

This property specifies the 2D size (width and height) of the spatial anchor within the 2D plane.


extent3D : vector3d

The 3D extent of the spatial anchor.

This property specifies the 3D size (width, height, and depth) of the spatial anchor within the 3D space.


has2DBounds : bool

Indicates whether the spatial anchor has 2D bounds.

This property returns true if the spatial anchor has 2D bounds, indicating that it represents a flat surface (for example, a floor or wall)

Otherwise, it returns false.


has3DBounds : bool

Indicates whether the spatial anchor has 3D bounds.

This property returns true if the spatial anchor has 3D bounds, indicating that it represents a volume (for example, a table). Otherwise, it returns false.


identifier : QUuid

A unique identifier for this spatial anchor.

This property returns a unique identifier associated with the spatial anchor. This is the same identified referenced by a XrSpatialAnchorListModel.


offset3D : vector3d

The 3D offset of the spatial anchor.

This property provides the 3D offset (in meters) from the anchor's origin to its position within the 3D space.


position : vector3d

The position of the spatial anchor.

This property returns the 3D position (in meters) of the spatial anchor within the session's coordinate system. It emits the `positionChanged` signal when updated.


rotation : quaternion

The rotation of the spatial anchor.

This property provides the 3D rotation (as a quaternion) of the spatial anchor. It emits the `rotationChanged` signal when updated.


Signal Documentation

classificationChanged()

Emitted when the Classification type associated with the spatial anchor changes.

This signal indicates that the classification property has been updated.

Note: The corresponding handler is onClassificationChanged.


classificationStringChanged()

Emitted when the classification string changes.

This signal indicates that the classificationString property has been updated.

Note: The corresponding handler is onClassificationStringChanged.


extent3DChanged()

Emitted when the 3D extent of the spatial anchor changes.

This signal indicates that the extent3D property has been updated.

Note: The corresponding handler is onExtent3DChanged.


has2DBoundsChanged()

Emitted when the 2D bounds state of the spatial anchor changes.

This signal indicates that the has2DBounds property has been updated.

Note: The corresponding handler is onHas2DBoundsChanged.


has3DBoundsChanged()

Emitted when the 3D bounds state of the spatial anchor changes.

This signal indicates that the has3DBounds property has been updated.

Note: The corresponding handler is onHas3DBoundsChanged.


offset3DChanged()

Emitted when the 3D offset of the spatial anchor changes.

This signal indicates that the offset3D property has been updated.

Note: The corresponding handler is onOffset3DChanged.


positionChanged()

Emitted when the position of the spatial anchor changes.

This signal indicates that the `position` property has been updated.

Note: The corresponding handler is onPositionChanged.


rotationChanged()

Emitted when the rotation of the spatial anchor changes.

This signal indicates that the rotation property has been updated.

Note: The corresponding handler is onRotationChanged.


© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.