Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
34{
36 &QAbstractCollisionShape::handleScaleChange);
37}
38
40
42{
43 return m_enableDebugDraw;
44}
45
47{
48 if (m_enableDebugDraw == enableDebugDraw)
49 return;
50
51 if (auto world = QPhysicsWorld::getWorld(this); world != nullptr && enableDebugDraw)
52 world->setHasIndividualDebugDraw();
53
54 m_enableDebugDraw = enableDebugDraw;
55 emit enableDebugDrawChanged(m_enableDebugDraw);
56}
57
58void QAbstractCollisionShape::handleScaleChange()
59{
60 auto newScale = sceneScale();
61 if (!qFuzzyCompare(newScale, m_prevScale)) {
62 m_prevScale = newScale;
63 m_scaleDirty = true;
64 emit needsRebuild(this); // TODO: remove signal argument?
65 }
66}
67
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:2960
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:333
#define emit
QLatin1StringView world("world")