XrSpatialAnchor QML Type

Tracks a specific location or object in real space. More...

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

QtObject

Status: Technical Preview

Properties

Detailed Description

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

Spatial anchors are accessed through an XrSpatialAnchorListModel.

Note: Anchor objects are provided by the system. They cannot be created in QML.

See the Qt Quick 3D - XR Spatial Anchors Example for how to use this type.

Property Documentation

Classification : enumeration [read-only]

The classification of the spatial anchor.

The Classification enum provides a set of predefined category types that 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

The following table shows the mapping between the classification type in Qt Quick 3D Xr, 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 is provided by the classificationString property.

Note: 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 : enumeration [read-only]

The classification type of 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 [read-only]

The classification type of the spatial anchor as a string.

This property returns the classification type as a string if one exists. 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 [read-only]

The 2D extent of the spatial anchor.

This property holds the spatial anchor's size in two dimensions (width and height) within the X/Z plane. It is valid when has2DBounds is true.

See also has2DBounds and offset2D.


extent3D : vector3d [read-only]

The 3D extent of the spatial anchor.

This property specifies the spatial anchor's volume in three dimensions (width, height, and depth). It is valid when has3DBounds is true.

See also offset3D and has3DBounds.


has2DBounds : bool [read-only]

Indicates whether the spatial anchor has 2D bounds.

This property holds true if the spatial anchor has 2D bounds, described by offset2D and extent2D, indicating that it represents a flat surface (for example, a floor or wall).

Otherwise, it returns false.

See also offset2D, extent2D, and has3DBounds.


has3DBounds : bool [read-only]

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 or a cupboard). The bounds are described by offset3D and extent3D.

Otherwise, it returns false.

See also offset3D, extent3D, and has2DBounds.


identifier : string [read-only]

A unique identifier for this spatial anchor.

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


offset2D : vector2d [read-only]

The 2D offset of the spatial anchor.

This property holds the offset of the anchor's bounds within the X/Z plane. It is valid when has2DBounds is true.

See also has2DBounds and extent2D.


offset3D : vector3d [read-only]

The 3D offset of the spatial anchor.

This property provides the 3D offset of the anchor's bounds (in meters) from the anchor's position.

See also offset3D and has3DBounds.


position : vector3d [read-only]

The position of the spatial anchor.

This property returns the 3D position (in meters) of the spatial anchor's origin within the session's coordinate system.


rotation : quaternion [read-only]

The orientation of the spatial anchor.

This property provides the spatial anchor's rotation (as a quaternion).


© 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.