- Qt 6.8
- Qt Quick 3D Physics
- QML Types
- PhysicsNode
- Qt Quick 3D Physics | Commercial or GPLv3

# PhysicsNode QML Type

Base type for all objects in the physics scene. More...

Import Statement: | import QtQuick3D.Physics
Since: | Qt 6.4
Inherits: | Node
Inherited By: | PhysicsBody and TriggerBody

- List of all members, including inherited members

## Properties

- collisionShapes : list<CollisionShape>
- filterGroup : int
- filterIgnoreGroups : int
- receiveContactReports : bool
- receiveTriggerReports : bool
- sendContactReports : bool
- sendTriggerReports : bool

## Signals

- bodyContact(PhysicsNode *body, list<vector3D> positions, list<vector3D> impulses, list<vector3D> normals)
- enteredTriggerBody(TriggerBody *body)
- exitedTriggerBody(TriggerBody *body)

## Detailed Description

PhysicsNode is the base type for all the objects that take part in the physics simulation. These objects have a position in three-dimensional space and a geometrical shape.

## Property Documentation

collisionShapes : list<CollisionShape>

This property contains the list of collision shapes. These shapes will be combined and act as a single rigid body when interacting with other bodies.

See also Shapes and Bodies overview documentation.

filterGroup : int

This property determines what filter group this body is part of.

Default value is `0`.

Range: `[0, 32]`

See also PhysicsNode::filterIgnoreGroups.

filterIgnoreGroups : int

This property determines what groups this body should filter out collisions with.

Note: This number is interpreted as a bitmask, meaning that if bit `i` is set then collisions with filterGroup number `i` will be filtered. For instance, to filter groups `1`, `3` and `4` then set the value to `0b11010`.

See also PhysicsNode::filterGroup.

receiveContactReports : bool

This property determines whether this body will receive contact reports when colliding with other bodies. If activated, this means that the bodyContact signal will be emitted on a collision with a body that has sendContactReports set to true.

Default value: `false`

receiveTriggerReports : bool

This property determines whether this body will receive reports when entering or leaving a trigger body.

Default value: `false`

sendContactReports : bool

This property determines whether this body will send contact reports when colliding with other bodies.

Default value: `false`

sendTriggerReports : bool

This property determines whether this body will send reports when entering or leaving a trigger body.

Default value: `false`

## Signal Documentation

bodyContact(PhysicsNode *body, list<vector3D> positions, list<vector3D> impulses, list<vector3D> normals)

This signal is emitted when there is a collision between a dynamic body and any other body. The receiveContactReports in this body and sendContactReports in the colliding body need to be set to true. The parameters body, positions, impulses and normals contain the other body, position, impulse force and normal for each contact point at the same index.

Note: The corresponding handler is `onBodyContact`.

See also CharacterController::shapeHit, PhysicsWorld::reportKinematicKinematicCollisions, and PhysicsWorld::reportStaticKinematicCollisions.

enteredTriggerBody(TriggerBody *body)

This signal is emitted when this body enters the specified trigger body.

Note: Only emitted when receiveTriggerReports is `true`

Note: The corresponding handler is `onEnteredTriggerBody`.

See also receiveTriggerReports and exitedTriggerBody.

exitedTriggerBody(TriggerBody *body)

This signal is emitted when this body exits the specified trigger body.

Note: Only emitted when receiveTriggerReports is `true`

Note: The corresponding handler is `onExitedTriggerBody`.

See also receiveTriggerReports and enteredTriggerBody.