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
qphysicsmaterial_p.h
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
4#ifndef QPHYSICSMATERIAL_H
5#define QPHYSICSMATERIAL_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DPhysics/qtquick3dphysicsglobal.h>
19#include <QtQml/QQmlEngine>
20
22
24{
26 Q_PROPERTY(float staticFriction READ staticFriction WRITE setStaticFriction NOTIFY
27 staticFrictionChanged)
28 Q_PROPERTY(float dynamicFriction READ dynamicFriction WRITE setDynamicFriction NOTIFY
29 dynamicFrictionChanged)
30 Q_PROPERTY(float restitution READ restitution WRITE setRestitution NOTIFY restitutionChanged)
31 QML_NAMED_ELEMENT(PhysicsMaterial)
32public:
33 explicit QPhysicsMaterial(QObject *parent = nullptr);
34
35 float staticFriction() const;
36 void setStaticFriction(float staticFriction);
37
38 float dynamicFriction() const;
39 void setDynamicFriction(float dynamicFriction);
40
41 float restitution() const;
42 void setRestitution(float restitution);
43
44 static constexpr float defaultStaticFriction = 0.5f;
45 static constexpr float defaultDynamicFriction = 0.5f;
46 static constexpr float defaultRestitution = 0.5f;
47
49 void staticFrictionChanged();
50 void dynamicFrictionChanged();
51 void restitutionChanged();
52
54 float m_staticFriction = defaultStaticFriction;
55 float m_dynamicFriction = defaultDynamicFriction;
56 float m_restitution = defaultRestitution;
57};
58
60
61#endif // QPHYSICSMATERIAL_H
\inmodule QtCore
Definition qobject.h:103
Combined button and popup list for selecting options.
GLfloat GLfloat f
#define QML_NAMED_ELEMENT(NAME)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
#define Q_QUICK3DPHYSICS_EXPORT
#define explicit