PhysicsNode QML Type
物理场景中所有对象的基类。更多内容...
| Import Statement: | import QtQuick3D.Physics |
| Since: | Qt 6.4 |
| Inherits: | |
| Inherited By: | CharacterController, DynamicRigidBody, PhysicsBody, StaticRigidBody, and TriggerBody |
属性
- collisionShapes : list<CollisionShape>
- filterGroup : int
- filterIgnoreGroups : int
- receiveContactReports : bool
- receiveTriggerReports : bool
- sendContactReports : bool
- sendTriggerReports : bool
信号
- bodyContact(PhysicsNode *body, list<vector3D> positions, list<vector3D> impulses, list<vector3D> normals)
- enteredTriggerBody(TriggerBody *body)
- exitedTriggerBody(TriggerBody *body)
详细说明
PhysicsNode 是参与物理模拟的所有对象的基础类型。这些对象在三维空间中具有位置和几何形状。
属性文档
collisionShapes : list<CollisionShape>
该属性包含碰撞形状的列表。这些形状将被合并,并在与其他刚体交互时作为单个刚体发挥作用。
另请参阅《 Qt Quick 3D 》中的“物理形状、刚体和关节”。
filterGroup : int
此属性用于确定该正文属于哪个过滤器组。
默认值为0 。
取值范围:[0, 31]
另请参阅 PhysicsNode::filterIgnoreGroups 。
filterIgnoreGroups : int
此属性用于确定该实体应过滤与哪些组之间的碰撞。
注意:该 数字被解释为位掩码,这意味着如果位i 被设置,则将过滤与filterGroup 编号为i 的组之间的碰撞。例如,要过滤组1 、3 和4 ,请将该值设置为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`。参数 `body`、`positions`、`impulses ` 和 `normals ` 分别包含其他物体的位置、冲量、力以及每个接触点的法向量,对应相同的索引。
注意: 相应的处理程序 是onBodyContact 。
另请参阅 CharacterController::shapeHit 、PhysicsWorld::reportKinematicKinematicCollisions 和PhysicsWorld::reportStaticKinematicCollisions 。
enteredTriggerBody(TriggerBody *body)
当该实体进入指定的触发器body 时,会发出此信号。
注意:仅 当receiveTriggerReports 为true
注意: 仅当onEnteredTriggerBody 为真时才会发出该 信号。
另请参阅 receiveTriggerReports 和exitedTriggerBody 。
exitedTriggerBody(TriggerBody *body)
当该实体离开指定的触发器body 时,会发出此信号。
注意:仅当 receiveTriggerReports 为true
注意: 仅当onExitedTriggerBody 时才会发出此 信号。
© 2026 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.