| 1 | // Copyright (C) 2023 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #include "qphysxtriggerbody_p.h" |
| 5 | |
| 6 | #include "qphysicsutils_p.h" |
| 7 | #include "qtriggerbody_p.h" |
| 8 | |
| 9 | #include "PxRigidActor.h" |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | QPhysXTriggerBody::QPhysXTriggerBody(QTriggerBody *frontEnd) : QPhysXActorBody(frontEnd) { } |
| 14 | |
| 15 | DebugDrawBodyType QPhysXTriggerBody::getDebugDrawBodyType() |
| 16 | { |
| 17 | return DebugDrawBodyType::Trigger; |
| 18 | } |
| 19 | |
| 20 | void QPhysXTriggerBody::sync(float /*deltaTime*/, |
| 21 | QHash<QQuick3DNode *, QMatrix4x4> & /*transformCache*/) |
| 22 | { |
| 23 | auto *triggerBody = static_cast<QTriggerBody *>(frontendNode); |
| 24 | const physx::PxTransform trf = QPhysicsUtils::toPhysXTransform(position: triggerBody->scenePosition(), |
| 25 | rotation: triggerBody->sceneRotation()); |
| 26 | actor->setGlobalPose(pose: trf); |
| 27 | } |
| 28 | |
| 29 | QT_END_NAMESPACE |
| 30 |
