PhysicsNode QML Type

物理场景中所有对象的基本类型。更多

Import Statement: import QtQuick3D.Physics
Since: Qt 6.4
Inherits:

Node

Inherited By:

PhysicsBody and TriggerBody

属性

信号

详细说明

物理节点(PhysicsNode)是所有参与物理模拟的对象的基本类型。这些对象具有三维空间中的位置和几何形状。

属性文档

collisionShapes : list<CollisionShape>

该属性包含碰撞形状列表。这些形状将被组合在一起,在与其他物体相互作用时充当单一刚体。

另请参阅 形状和刚体概述文档


filterGroup : int

此属性决定了此刚体属于哪个过滤组。

默认值为0

范围:[0, 32]

另请参阅 PhysicsNode::filterIgnoreGroups


filterIgnoreGroups : int

此属性决定此主体应过滤哪些组的碰撞。

注意: 该数字被解释为位掩码,也就是说,如果位i 被设置,那么与filterGroup 编号i 的碰撞将被过滤。例如,要过滤134 组,则将该值设为0b11010

另请参阅 PhysicsNode::filterGroup


receiveContactReports : bool

该属性决定了该机构在与其他机构碰撞时是否会收到联系报告。如果激活,这意味着在与sendContactReports 设置为 true 的机构碰撞时,将发出bodyContact 信号。

默认值:false


receiveTriggerReports : bool

此属性决定了此机构在进入或离开触发机构时是否会收到报告。

默认值:false


sendContactReports : bool

此属性决定此车身在与其他车身碰撞时是否会发送接触报告。

默认值false


sendTriggerReports : bool

该属性用于确定本体在进入或离开触发体时是否会发送报告。

默认值:false


信号文档

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

当动态体与其他任何体发生碰撞时,都会发出该信号。本体中的receiveContactReports 和碰撞体中的sendContactReports 需设为 true。参数bodypositionsimpulsesnormals 包含相同索引处每个接触点的其他体、位置、冲力和法线。

注: 相应的处理程序是onBodyContact

另请参阅 CharacterController::shapeHit,PhysicsWorld::reportKinematicKinematicCollisions, 和PhysicsWorld::reportStaticKinematicCollisions


enteredTriggerBody(TriggerBody *body)

当本机构进入指定的触发器body 时,将发出该信号。

注: 仅当receiveTriggerReportstrue

注: 相应的处理程序是onEnteredTriggerBody

另请参阅 receiveTriggerReportsexitedTriggerBody


exitedTriggerBody(TriggerBody *body)

本体退出指定触发器body 时发出该信号。

注: 仅当receiveTriggerReportstrue

注: 相应的处理程序是onExitedTriggerBody

另请参阅 receiveTriggerReportsenteredTriggerBody


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