Qt Quick 3D Physics API Changes from Tech Preview
Starting with the Qt 6.5.0 release, the Qt Quick 3D Physics module is no longer in Tech Preview. As a result of the API feedback and review process, some source-incompatible changes were made.
The majority of the changes are renaming types and properties for consistency with other APIs and to make the names more descriptive. The most noticeable rename is changing DynamicsWorld to PhysicsWorld, which will affect all applications.
The most important behavioral change is the handling of kinematic bodies. Changing the position/orientation of a kinematic body is no longer done by using the Node properties (position, rotation, etc.), but instead by using the new properties: kinematicPosition, kinematicEulerRotation, kinematicRotation, and kinematicPivot. The reason for this change was to make sure that the visual movement of kinematic bodies is synchronized with the rest of the simulation, instead of happening one simulation step too early.
The DynamicRigidBody.density property no longer treats negative values (and zero) as a special case. Instead, there are two new massMode enumeration values replacing Density:
DefaultDensity | The density of the body is defined by PhysicsWorld.defaultDensity. This is the default. |
CustomDensity | The density of the body is defined by the density property. |
The enableTriggerReports property has been renamed to sendTriggerReports. In addition, physics objects can now be notified when they enter a trigger body by setting receiveTriggerReports.
The following is a complete list of all the API changes:
- CollisionShape:
- renamed enableDebugView to enableDebugDraw
- Renamed the abstract base type
CollisionNodeto PhysicsNode- changed enableTriggerReports to sendTriggerReports and receiveTriggerReports
- CharacterController
- renamed
speedto movement
- renamed
- ConvexMeshShape
- renamed
meshSourceto source
- renamed
- HeightFieldShape
- renamed
heightMapto source
- renamed
- TriangleMeshShape
- renamed
meshSourceto source
- renamed
- PhysicsWorld (renamed from
DynamicsWorld)- renamed
forceDebugViewto forceDebugDraw - renamed
minTimestep/maxTimestepto minimumTimestep/maximumTimestep - removed sceneNode
- added scene
- added viewport
- renamed
- DynamicRigidBody
- changed the
axisLockLinearX/Y/Zproperties into a single property linearAxisLock that takes a bitfield - changed the
axisLockAngularX/Y/Zproperties into a single property angularAxisLock that takes a bitfield - added new properties kinematicPosition, kinematicEulerRotation, kinematicRotation, and kinematicPivot
- changed
Densityenum value to DefaultDensity/CustomDensity and removed special-casing of negative values. - replaced the
linearVelocityproperty with the method setLinearVelocity. - replaced the
angularVelocityproperty with the method setAngularVelocity.
- changed the