在本页

PhysicsNode QML Type

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

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

Node

Inherited By:

CharacterController, DynamicRigidBody, PhysicsBody, StaticRigidBody, 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

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