Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qabstractcollisionshape.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
6#include <QtQml/QQmlListReference>
7
8#include "qphysicsworld_p.h"
9
11
32{
34 &QAbstractCollisionShape::handleScaleChange);
35}
36
38
40{
41 return m_enableDebugDraw;
42}
43
45{
46 if (m_enableDebugDraw == enableDebugDraw)
47 return;
48
49 if (auto world = QPhysicsWorld::getWorld(this); world != nullptr && enableDebugDraw)
50 world->setHasIndividualDebugDraw();
51
52 m_enableDebugDraw = enableDebugDraw;
53 emit enableDebugDrawChanged(m_enableDebugDraw);
54}
55
56void QAbstractCollisionShape::handleScaleChange()
57{
58 auto newScale = sceneScale();
59 if (!qFuzzyCompare(newScale, m_prevScale)) {
60 m_prevScale = newScale;
61 m_scaleDirty = true;
62 emit needsRebuild(this); // TODO: remove signal argument?
63 }
64}
65
void needsRebuild(QObject *)
void enableDebugDrawChanged(bool enableDebugDraw)
QAbstractCollisionShape(QQuick3DNode *parent=nullptr)
\qmltype CollisionShape \inherits Node \inqmlmodule QtQuick3D.Physics
void setEnableDebugDraw(bool enableDebugDraw)
virtual ~QAbstractCollisionShape()
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
static QPhysicsWorld * getWorld(QQuick3DNode *node)
QVector3D sceneScale
void sceneScaleChanged()
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
#define emit
QLatin1StringView world("world")
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent