7#include <QtQuick3D/QQuick3DGeometry>
8#include <extensions/PxExtensionsAPI.h>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
29
30
31
32
33
35QBoxShape::QBoxShape() =
default;
36QBoxShape::~QBoxShape()
38 delete m_physXGeometry;
41QVector3D QBoxShape::extents()
const
46physx::PxGeometry *QBoxShape::getPhysXGeometry()
48 if (!m_physXGeometry || m_scaleDirty) {
49 updatePhysXGeometry();
51 return m_physXGeometry;
54void QBoxShape::setExtents(QVector3D extents)
56 if (m_extents == extents)
60 updatePhysXGeometry();
62 emit needsRebuild(
this);
63 emit extentsChanged(m_extents);
66void QBoxShape::updatePhysXGeometry()
68 delete m_physXGeometry;
69 const QVector3D half = m_extents * sceneScale() * 0.5f;
70 m_physXGeometry =
new physx::PxBoxGeometry(half.x(), half.y(), half.z());
Combined button and popup list for selecting options.