queryHit QML Value Type

Represents the result of a spatial physics query hit (raycast, sweep, or overlap). More...

Import Statement: import QtQuick3D.Physics
Since: Qt 6.13
Inherited By:

locationHit

Properties

  • body : PhysicsNode (since 6.13)
  • shape : CollisionShape (since 6.13)

Detailed Description

The queryHit struct provides hit information returned by spatial queries in the physics world.

See also PhysicsNode and CollisionShape.

Property Documentation

body : PhysicsNode [read-only, since 6.13]

Holds the physical body (PhysicsNode) intersected by the spatial query.

This property was introduced in Qt 6.13.

shape : CollisionShape [read-only, since 6.13]

Holds the specific collision shape (CollisionShape) intersected by the spatial query. Returns null if the underlying PhysX shape has no associated Qt collision shape.

Note: When a query intersects a CharacterController, the body property is populated, but the shape property will be null because character controllers do not assign individual shape metadata.

This property was introduced in Qt 6.13.