6#include <QtQuick3D/QQuick3DGeometry>
7#include <extensions/PxExtensionsAPI.h>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
28
29
30
31
32
34QBoxShape::QBoxShape() =
default;
35QBoxShape::~QBoxShape()
37 delete m_physXGeometry;
40QVector3D QBoxShape::extents()
const
45physx::PxGeometry *QBoxShape::getPhysXGeometry()
47 if (!m_physXGeometry || m_scaleDirty) {
48 updatePhysXGeometry();
50 return m_physXGeometry;
53void QBoxShape::setExtents(QVector3D extents)
55 if (m_extents == extents)
59 updatePhysXGeometry();
61 emit needsRebuild(
this);
62 emit extentsChanged(m_extents);
65void QBoxShape::updatePhysXGeometry()
67 delete m_physXGeometry;
68 const QVector3D half = m_extents * sceneScale() * 0.5f;
69 m_physXGeometry =
new physx::PxBoxGeometry(half.x(), half.y(), half.z());
Combined button and popup list for selecting options.