Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QDynamicRigidBody Class Reference

#include <qdynamicrigidbody_p.h>

Inheritance diagram for QDynamicRigidBody:
Collaboration diagram for QDynamicRigidBody:

Public Types

enum class  MassMode {
  DefaultDensity , CustomDensity , Mass , MassAndInertiaTensor ,
  MassAndInertiaMatrix
}
enum  AxisLock { LockNone = 0 , LockX = 1 , LockY = 2 , LockZ = 4 }
Public Types inherited from QQuick3DNode
enum  TransformSpace { LocalSpace , ParentSpace , SceneSpace }
enum  StaticFlags { None }

Signals

void massChanged (float mass)
void densityChanged (float density)
void isKinematicChanged (bool isKinematic)
 Q_REVISION (6, 5) void linearAxisLockChanged()
 Q_REVISION (6, 5) void angularAxisLockChanged()
void gravityEnabledChanged ()
void massModeChanged ()
void inertiaTensorChanged ()
void centerOfMassPositionChanged ()
void centerOfMassRotationChanged ()
void inertiaMatrixChanged ()
 Q_REVISION (6, 5) void kinematicPositionChanged(const QVector3D &kinematicPosition)
 Q_REVISION (6, 5) void kinematicRotationChanged(const QQuaternion &kinematicRotation)
 Q_REVISION (6, 5) void kinematicEulerRotationChanged(const QVector3D &kinematicEulerRotation)
 Q_REVISION (6, 5) void kinematicPivotChanged(const QVector3D &kinematicPivot)
 Q_REVISION (6, 9) void isSleepingChanged(bool isSleeping)
Signals inherited from QAbstractPhysicsBody
void physicsMaterialChanged ()
void simulationEnabledChanged ()
Signals inherited from QAbstractPhysicsNode
void bodyContact (QAbstractPhysicsNode *body, const QVector< QVector3D > &positions, const QVector< QVector3D > &impulses, const QVector< QVector3D > &normals)
void sendContactReportsChanged (float sendContactReports)
void receiveContactReportsChanged (float receiveContactReports)
 Q_REVISION (6, 5) void sendTriggerReportsChanged(float sendTriggerReports)
 Q_REVISION (6, 5) void receiveTriggerReportsChanged(float receiveTriggerReports)
 Q_REVISION (6, 5) void enteredTriggerBody(QAbstractPhysicsNode *body)
 Q_REVISION (6, 5) void exitedTriggerBody(QAbstractPhysicsNode *body)
 Q_REVISION (6, 7) void filterGroupChanged()
 Q_REVISION (6, 7) void filterIgnoreGroupsChanged()
Signals inherited from QQuick3DNode
void xChanged ()
void yChanged ()
void zChanged ()
void rotationChanged ()
void eulerRotationChanged ()
void positionChanged ()
void scaleChanged ()
void pivotChanged ()
void localOpacityChanged ()
void visibleChanged ()
void forwardChanged ()
void upChanged ()
void rightChanged ()
void sceneTransformChanged ()
void scenePositionChanged ()
void sceneRotationChanged ()
void sceneScaleChanged ()
void staticFlagsChanged ()
void layersChanged ()
Signals inherited from QQuick3DObject
void parentChanged ()
void childrenChanged ()
void stateChanged ()
Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.

Public Member Functions

 QDynamicRigidBody ()
 \qmltype DynamicRigidBody \inqmlmodule QtQuick3D.Physics \inherits PhysicsBody
 ~QDynamicRigidBody ()
float mass () const
void setMass (float mass)
float density () const
void setDensity (float density)
bool isKinematic () const
void setIsKinematic (bool isKinematic)
 Q_REVISION (6, 5) AxisLock linearAxisLock() const
 Q_REVISION (6, 5) void setLinearAxisLock(AxisLock new AxisLockLinear)
 Q_REVISION (6, 5) AxisLock angularAxisLock() const
 Q_REVISION (6, 5) void setAngularAxisLock(AxisLock new AxisLockAngular)
bool gravityEnabled () const
void setGravityEnabled (bool gravityEnabled)
Q_INVOKABLE void applyCentralForce (const QVector3D &force)
Q_INVOKABLE void applyForce (const QVector3D &force, const QVector3D &position)
Q_INVOKABLE void applyTorque (const QVector3D &torque)
Q_INVOKABLE void applyCentralImpulse (const QVector3D &impulse)
Q_INVOKABLE void applyImpulse (const QVector3D &impulse, const QVector3D &position)
Q_INVOKABLE void applyTorqueImpulse (const QVector3D &impulse)
Q_INVOKABLE void setAngularVelocity (const QVector3D &angularVelocity)
Q_INVOKABLE void setLinearVelocity (const QVector3D &linearVelocity)
Q_INVOKABLE void reset (const QVector3D &position, const QVector3D &eulerRotation)
QQueue< QPhysicsCommand * > & commandQueue ()
void updateDefaultDensity (float defaultDensity)
MassMode massMode () const
void setMassMode (const MassMode newMassMode)
const QVector3DinertiaTensor () const
void setInertiaTensor (const QVector3D &newInertiaTensor)
const QVector3DcenterOfMassPosition () const
void setCenterOfMassPosition (const QVector3D &newCenterOfMassPosition)
const QQuaternioncenterOfMassRotation () const
void setCenterOfMassRotation (const QQuaternion &newCenterOfMassRotation)
const QList< float > & readInertiaMatrix () const
void setInertiaMatrix (const QList< float > &newInertiaMatrix)
const QMatrix3x3inertiaMatrix () const
 Q_REVISION (6, 5) void setKinematicPosition(const QVector3D &position)
 Q_REVISION (6, 5) QVector3D kinematicPosition() const
 Q_REVISION (6, 5) void setKinematicRotation(const QQuaternion &rotation)
 Q_REVISION (6, 5) QQuaternion kinematicRotation() const
 Q_REVISION (6, 5) void setKinematicEulerRotation(const QVector3D &rotation)
 Q_REVISION (6, 5) QVector3D kinematicEulerRotation() const
 Q_REVISION (6, 5) void setKinematicPivot(const QVector3D &pivot)
 Q_REVISION (6, 5) QVector3D kinematicPivot() const
 Q_REVISION (6, 9) void setIsSleeping(bool new IsSleeping)
 Q_REVISION (6, 9) bool isSleeping() const
QAbstractPhysXNodecreatePhysXBackend () final
Public Member Functions inherited from QAbstractPhysicsBody
 QAbstractPhysicsBody ()
 \qmltype PhysicsBody \inherits PhysicsNode \inqmlmodule QtQuick3D.Physics
QPhysicsMaterialphysicsMaterial () const
void setPhysicsMaterial (QPhysicsMaterial *newPhysicsMaterial)
 Q_REVISION (6, 7) bool simulationEnabled() const
 Q_REVISION (6, 7) void setSimulationEnabled(bool new SimulationEnabled)
Public Member Functions inherited from QAbstractPhysicsNode
 QAbstractPhysicsNode ()
 \qmltype PhysicsNode \inherits Node \inqmlmodule QtQuick3D.Physics
 ~QAbstractPhysicsNode () override
QQmlListProperty< QAbstractCollisionShapecollisionShapes ()
const QVector< QAbstractCollisionShape * > & getCollisionShapesList () const
void updateFromPhysicsTransform (const physx::PxTransform &transform)
void registerContact (QAbstractPhysicsNode *body, const QVector< QVector3D > &positions, const QVector< QVector3D > &impulses, const QVector< QVector3D > &normals)
bool sendContactReports () const
void setSendContactReports (bool sendContactReports)
bool receiveContactReports () const
void setReceiveContactReports (bool receiveContactReports)
 Q_REVISION (6, 5) bool sendTriggerReports() const
 Q_REVISION (6, 5) void setSendTriggerReports(bool sendTriggerReports)
 Q_REVISION (6, 5) bool receiveTriggerReports() const
 Q_REVISION (6, 5) void setReceiveTriggerReports(bool receiveTriggerReports)
bool hasStaticShapes () const
 Q_REVISION (6, 7) int filterGroup() const
 Q_REVISION (6, 7) void setfilterGroup(int new filterGroup)
 Q_REVISION (6, 7) int filterIgnoreGroups() const
 Q_REVISION (6, 7) void setFilterIgnoreGroups(int new FilterIgnoreGroups)
Public Member Functions inherited from QQuick3DNode
 QQuick3DNode (QQuick3DNode *parent=nullptr)
 \qmltype Node \inherits Object3D \inqmlmodule QtQuick3D
 ~QQuick3DNode () override
float x () const
 \qmlproperty real QtQuick3D::Node::x
float y () const
 \qmlproperty real QtQuick3D::Node::y
float z () const
 \qmlproperty real QtQuick3D::Node::z
QQuaternion rotation () const
 \qmlproperty quaternion QtQuick3D::Node::rotation
QVector3D eulerRotation () const
 \qmlproperty vector3d QtQuick3D::Node::eulerRotation
QVector3D position () const
 \qmlproperty vector3d QtQuick3D::Node::position
QVector3D scale () const
 \qmlproperty vector3d QtQuick3D::Node::scale
QVector3D pivot () const
 \qmlproperty vector3d QtQuick3D::Node::pivot
float localOpacity () const
 \qmlproperty real QtQuick3D::Node::opacity
bool visible () const
 \qmlproperty bool QtQuick3D::Node::visible
int staticFlags () const
 \qmlproperty int QtQuick3D::Node::staticFlags
QQuick3DNodeparentNode () const
QVector3D forward () const
 \qmlproperty vector3d QtQuick3D::Node::forward \readonly
QVector3D up () const
 \qmlproperty vector3d QtQuick3D::Node::up \readonly
QVector3D right () const
 \qmlproperty vector3d QtQuick3D::Node::right \readonly
QVector3D scenePosition () const
 \qmlproperty vector3d QtQuick3D::Node::scenePosition \readonly
QQuaternion sceneRotation () const
 \qmlproperty quaternion QtQuick3D::Node::sceneRotation \readonly
QVector3D sceneScale () const
 \qmlproperty vector3d QtQuick3D::Node::sceneScale \readonly
QMatrix4x4 sceneTransform () const
 \qmlproperty matrix4x4 QtQuick3D::Node::sceneTransform \readonly
Q_INVOKABLE void rotate (qreal degrees, const QVector3D &axis, QQuick3DNode::TransformSpace space)
 \qmlmethod QtQuick3D::Node::rotate(real degrees, vector3d axis, enumeration space)
Q_INVOKABLE QVector3D mapPositionToScene (const QVector3D &localPosition) const
 \qmlmethod vector3d QtQuick3D::Node::mapPositionToScene(vector3d localPosition)
Q_INVOKABLE QVector3D mapPositionFromScene (const QVector3D &scenePosition) const
 \qmlmethod vector3d QtQuick3D::Node::mapPositionFromScene(vector3d scenePosition)
Q_INVOKABLE QVector3D mapPositionToNode (const QQuick3DNode *node, const QVector3D &localPosition) const
 \qmlmethod vector3d QtQuick3D::Node::mapPositionToNode(QtQuick3D::Node node, vector3d localPosition)
Q_INVOKABLE QVector3D mapPositionFromNode (const QQuick3DNode *node, const QVector3D &localPosition) const
 \qmlmethod vector3d QtQuick3D::Node::mapPositionFromNode(QtQuick3D::Node node, vector3d localPosition)
Q_INVOKABLE QVector3D mapDirectionToScene (const QVector3D &localDirection) const
 \qmlmethod vector3d QtQuick3D::Node::mapDirectionToScene(vector3d localDirection)
Q_INVOKABLE QVector3D mapDirectionFromScene (const QVector3D &sceneDirection) const
 \qmlmethod vector3d QtQuick3D::Node::mapDirectionFromScene(vector3d sceneDirection)
Q_INVOKABLE QVector3D mapDirectionToNode (const QQuick3DNode *node, const QVector3D &localDirection) const
 \qmlmethod vector3d QtQuick3D::Node::mapDirectionToNode(QtQuick3D::Node node, vector3d localDirection)
Q_INVOKABLE QVector3D mapDirectionFromNode (const QQuick3DNode *node, const QVector3D &localDirection) const
 \qmlmethod vector3d QtQuick3D::Node::mapDirectionFromNode(QtQuick3D::Node node, vector3d localDirection)
void markAllDirty () override
int layers () const
 \qmlproperty int QtQuick3D::Node::layers
Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
QString objectName () const
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QBindable< QStringbindableObjectName ()
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
bool isQmlObjectType () const
 Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership().
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
QThreadthread () const
 Returns the thread in which the object lives.
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
void killTimer (int id)
 Kills the timer with timer identifier, id.
void killTimer (Qt::TimerId id)
template<typename T>
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
template<typename T>
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
template<typename T>
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const QObjectListchildren () const
 Returns a list of child objects.
void setParent (QObject *parent)
 Makes the object a child of parent.
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
bool disconnect (const QObject *receiver, const char *member=nullptr) const
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
bool setProperty (const char *name, QVariant &&value)
QVariant property (const char *name) const
 Returns the value of the object's name property.
QList< QByteArraydynamicPropertyNames () const
QBindingStoragebindingStorage ()
const QBindingStoragebindingStorage () const
QObjectparent () const
 Returns a pointer to the parent object.
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
Public Member Functions inherited from QQmlParserStatus
 QQmlParserStatus ()
virtual ~QQmlParserStatus ()

Properties

float mass
float density
AxisLock linearAxisLock
AxisLock angularAxisLock
bool isKinematic
bool gravityEnabled
MassMode massMode
QVector3D inertiaTensor
QVector3D centerOfMassPosition
QQuaternion centerOfMassRotation
QList< float > inertiaMatrix
QVector3D kinematicPosition
QVector3D kinematicEulerRotation
QQuaternion kinematicRotation
QVector3D kinematicPivot
bool isSleeping
Properties inherited from QAbstractPhysicsBody
QPhysicsMaterialphysicsMaterial
bool simulationEnabled
Properties inherited from QAbstractPhysicsNode
QQmlListProperty< QAbstractCollisionShapecollisionShapes
bool sendContactReports
bool receiveContactReports
bool sendTriggerReports
bool receiveTriggerReports
int filterGroup
int filterIgnoreGroups
Properties inherited from QQuick3DNode
float x
float y
float z
QQuaternion rotation
QVector3D eulerRotation
QVector3D position
QVector3D scale
QVector3D pivot
float opacity
bool visible
QVector3D forward
QVector3D up
QVector3D right
QVector3D scenePosition
QQuaternion sceneRotation
QVector3D sceneScale
QMatrix4x4 sceneTransform
int staticFlags
int layers
Properties inherited from QQuick3DObject
QQuick3DObjectparent
 \qmlproperty Object3D QtQuick3D::Object3D::parent This property holds the parent of the Object3D in a 3D scene.
Properties inherited from QObject
QString objectName
 the name of this object

Additional Inherited Members

Public Slots inherited from QQuick3DNode
void setX (float x)
void setY (float y)
void setZ (float z)
void setRotation (const QQuaternion &rotation)
void setEulerRotation (const QVector3D &eulerRotation)
void setPosition (const QVector3D &position)
void setScale (const QVector3D &scale)
void setPivot (const QVector3D &pivot)
void setLocalOpacity (float opacity)
void setVisible (bool visible)
void setStaticFlags (int staticFlags)
void setLayers (int newLayers)
Public Slots inherited from QQuick3DObject
void update ()
void setParentItem (QQuick3DObject *parentItem)
Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
template<typename Func1>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
Protected Member Functions inherited from QQuick3DNode
void connectNotify (const QMetaMethod &signal) override
void disconnectNotify (const QMetaMethod &signal) override
void componentComplete () override
 Invoked after the root component that caused this instantiation has completed construction.
 QQuick3DNode (QQuick3DNodePrivate &dd, QQuick3DNode *parent=nullptr)
QSSGRenderGraphObjectupdateSpatialNode (QSSGRenderGraphObject *node) override
virtual void itemChange (ItemChange, const ItemChangeData &) override
Protected Member Functions inherited from QQuick3DObject
 QQuick3DObject (QQuick3DObjectPrivate &dd, QQuick3DObject *parent=nullptr)
void classBegin () override
 Invoked after class creation, but before any properties have been set.
void componentComplete () override
 Invoked after the root component that caused this instantiation has completed construction.
bool isComponentComplete () const
virtual void preSync ()
Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
int senderSignalIndex () const
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
bool isSignalConnected (const QMetaMethod &signal) const
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr

Detailed Description

Definition at line 30 of file qdynamicrigidbody_p.h.

Member Enumeration Documentation

◆ AxisLock

Enumerator
LockNone 
LockX 
LockY 
LockZ 

Definition at line 42 of file qdynamicrigidbody_p.h.

◆ MassMode

enum class QDynamicRigidBody::MassMode
strong
Enumerator
DefaultDensity 
CustomDensity 
Mass 
MassAndInertiaTensor 
MassAndInertiaMatrix 

Definition at line 33 of file qdynamicrigidbody_p.h.

Constructor & Destructor Documentation

◆ QDynamicRigidBody()

QT_BEGIN_NAMESPACE QDynamicRigidBody::QDynamicRigidBody ( )
default

\qmltype DynamicRigidBody \inqmlmodule QtQuick3D.Physics \inherits PhysicsBody

Since
6.4

A physical body that can move or be moved.

This type defines a dynamic rigid body: an object that is part of the physics scene and behaves like a physical object with mass and velocity.

Note
\l{TriangleMeshShape}{triangle mesh}, \l{HeightFieldShape}{height field} and \l{PlaneShape}{plane} geometry shapes are not allowed as collision shapes when \l isKinematic is false.

\qmlproperty real DynamicRigidBody::mass

This property defines the mass of the body. Note that this is only used when massMode is not {DynamicRigidBody.CustomDensity} or {DynamicRigidBody.DefaultDensity}. Also note that a value of 0 is interpreted as infinite mass and that negative numbers are not allowed.

Default value: 1

Range: {[0, inf]}

See also
massMode

\qmlproperty real DynamicRigidBody::density

This property defines the density of the body. This is only used when massMode is set to {DynamicRigidBody.CustomDensity}.

Default value: {0.001}

Range: {(0, inf]}

See also
massMode

\qmlproperty AxisLock DynamicRigidBody::linearAxisLock

This property locks the linear velocity of the body along the axes defined by the DynamicRigidBody.AxisLock enum. To lock several axes just bitwise-or their enum values.

Available options:

\value DynamicRigidBody.None No axis lock.

\value DynamicRigidBody.LockX Lock X axis.

\value DynamicRigidBody.LockY Lock Y axis.

\value DynamicRigidBody.LockZ Lock Z axis.

Default value: {DynamicRigidBody.None}

\qmlproperty AxisLock DynamicRigidBody::angularAxisLock

This property locks the angular velocity of the body along the axes defined by the DynamicRigidBody.AxisLock enum. To lock several axes just bitwise-or their enum values.

Available options:

\value DynamicRigidBody.None No axis lock.

\value DynamicRigidBody.LockX Lock X axis.

\value DynamicRigidBody.LockY Lock Y axis.

\value DynamicRigidBody.LockZ Lock Z axis.

Default value: {DynamicRigidBody.None}

\qmlproperty bool DynamicRigidBody::isKinematic This property defines whether the object is kinematic or not. A kinematic object does not get influenced by external forces and can be seen as an object of infinite mass. If this property is set then in every simulation frame the physical object will be moved to its target position regardless of external forces. Note that to move and rotate the kinematic object you need to use the kinematicPosition, kinematicRotation, kinematicEulerRotation and kinematicPivot properties.

Default value: {false}

See also
kinematicPosition, kinematicRotation, kinematicEulerRotation, kinematicPivot

\qmlproperty bool DynamicRigidBody::gravityEnabled This property defines whether the object is going to be affected by gravity or not.

Default value: {true}

\qmlproperty MassMode DynamicRigidBody::massMode

This property holds the enum which describes how mass and inertia are calculated for this body.

Available options:

\value DynamicRigidBody.DefaultDensity Use the density specified in the \l {PhysicsWorld::}{defaultDensity} property in PhysicsWorld to calculate mass and inertia assuming a uniform density.

\value DynamicRigidBody.CustomDensity Use specified density in the specified in the \l {DynamicRigidBody::}{density} to calculate mass and inertia assuming a uniform density.

\value DynamicRigidBody.Mass Use the specified mass to calculate inertia assuming a uniform density.

\value DynamicRigidBody.MassAndInertiaTensor Use the specified mass value and inertia tensor.

\value DynamicRigidBody.MassAndInertiaMatrix Use the specified mass value and calculate inertia from the specified inertia matrix.

Default value: {DynamicRigidBody.DefaultDensity}

\qmlproperty vector3d DynamicRigidBody::inertiaTensor

Defines the inertia tensor vector, using a parameter specified in mass space coordinates.

This is the diagonal vector of a 3x3 diagonal matrix, if you have a non diagonal world/actor space inertia tensor then you should use \l{DynamicRigidBody::inertiaMatrix}{inertiaMatrix} instead.

The inertia tensor components must be positive and a value of 0 in any component is interpreted as infinite inertia along that axis. Note that this is only used when massMode is set to DynamicRigidBody.MassAndInertiaTensor.

Default value: {(1, 1, 1)}

See also
massMode, inertiaMatrix

\qmlproperty vector3d DynamicRigidBody::centerOfMassPosition

Defines the position of the center of mass relative to the body. Note that this is only used when massMode is set to DynamicRigidBody.MassAndInertiaTensor.

Default value: {(0, 0, 0)}

See also
massMode, inertiaTensor

\qmlproperty quaternion DynamicRigidBody::centerOfMassRotation

Defines the rotation of the center of mass pose, i.e. it specifies the orientation of the body's principal inertia axes relative to the body. Note that this is only used when massMode is set to DynamicRigidBody.MassAndInertiaTensor.

Default value: {(1, 0, 0, 0)}

See also
massMode, inertiaTensor

\qmlproperty list<real> DynamicRigidBody::inertiaMatrix

Defines the inertia tensor matrix. This is a 3x3 matrix in column-major order. Note that this matrix is expected to be diagonalizable. Note that this is only used when massMode is set to DynamicRigidBody.MassAndInertiaMatrix.

Default value: A 3x3 identity matrix

See also
massMode, inertiaTensor

\qmlproperty vector3d DynamicRigidBody::kinematicPosition

Since
6.5

Defines the position of the object when it is kinematic, i.e. when \l isKinematic is set to true. On each iteration of the simulation the physical object will be updated according to this value.

Default value: {(0, 0, 0)}

See also
isKinematic, kinematicRotation, kinematicEulerRotation, kinematicPivot

\qmlproperty quaternion DynamicRigidBody::kinematicRotation

Since
6.5

Defines the rotation of the object when it is kinematic, i.e. when \l isKinematic is set to true. On each iteration of the simulation the physical object will be updated according to this value.

Default value: {(1, 0, 0, 0)}

See also
isKinematic, kinematicPosition, kinematicEulerRotation, kinematicPivot

\qmlproperty vector3d DynamicRigidBody::kinematicEulerRotation

Since
6.5

Defines the euler rotation of the object when it is kinematic, i.e. when \l isKinematic is set to true. On each iteration of the simulation the physical object will be updated according to this value.

Default value: {(0, 0, 0)}

See also
isKinematic, kinematicPosition, kinematicEulerRotation, kinematicPivot

\qmlproperty vector3d DynamicRigidBody::kinematicPivot

Since
6.5

Defines the pivot of the object when it is kinematic, i.e. when \l isKinematic is set to true. On each iteration of the simulation the physical object will be updated according to this value.

Default value: {(0, 0, 0)}

See also
isKinematic, kinematicPosition, kinematicEulerRotation, kinematicRotation

\qmlproperty bool DynamicRigidBody::isSleeping

Since
6.9

Is set to {true} if the body is sleeping. While it is technically possible to set this property it should be seen as a read-only property that is set on every frame the physics simulation is running.

\qmlmethod DynamicRigidBody::applyCentralForce(vector3d force)

Applies a force on the center of the body.

\qmlmethod DynamicRigidBody::applyForce(vector3d force, vector3d position)

Applies a force at a position on the body.

\qmlmethod DynamicRigidBody::applyTorque(vector3d torque)

Applies a torque on the body.

\qmlmethod DynamicRigidBody::applyCentralImpulse(vector3d impulse)

Applies an impulse on the center of the body.

\qmlmethod DynamicRigidBody::applyImpulse(vector3d impulse, vector3d position)

Applies an impulse at a position on the body.

\qmlmethod DynamicRigidBody::applyTorqueImpulse(vector3d impulse)

Applies a torque impulse on the body.

\qmlmethod DynamicRigidBody::setAngularVelocity(vector3d angularVelocity)

Sets the angularVelocity of the body.

\qmlmethod DynamicRigidBody::setLinearVelocity(vector3d linearVelocity)

Sets the linearVelocity of the body.

\qmlmethod DynamicRigidBody::reset(vector3d position, vector3d eulerRotation)

Resets the body's position and eulerRotation.

◆ ~QDynamicRigidBody()

QDynamicRigidBody::~QDynamicRigidBody ( )

Definition at line 316 of file qdynamicrigidbody.cpp.

Member Function Documentation

◆ applyCentralForce()

void QDynamicRigidBody::applyCentralForce ( const QVector3D & force)

Definition at line 591 of file qdynamicrigidbody.cpp.

◆ applyCentralImpulse()

void QDynamicRigidBody::applyCentralImpulse ( const QVector3D & impulse)

Definition at line 606 of file qdynamicrigidbody.cpp.

◆ applyForce()

void QDynamicRigidBody::applyForce ( const QVector3D & force,
const QVector3D & position )

Definition at line 596 of file qdynamicrigidbody.cpp.

◆ applyImpulse()

void QDynamicRigidBody::applyImpulse ( const QVector3D & impulse,
const QVector3D & position )

Definition at line 611 of file qdynamicrigidbody.cpp.

◆ applyTorque()

void QDynamicRigidBody::applyTorque ( const QVector3D & torque)

Definition at line 601 of file qdynamicrigidbody.cpp.

◆ applyTorqueImpulse()

void QDynamicRigidBody::applyTorqueImpulse ( const QVector3D & impulse)

Definition at line 616 of file qdynamicrigidbody.cpp.

◆ centerOfMassPosition()

const QVector3D & QDynamicRigidBody::centerOfMassPosition ( ) const

Definition at line 340 of file qdynamicrigidbody.cpp.

◆ centerOfMassPositionChanged

void QDynamicRigidBody::centerOfMassPositionChanged ( )
signal

◆ centerOfMassRotation()

const QQuaternion & QDynamicRigidBody::centerOfMassRotation ( ) const

Definition at line 322 of file qdynamicrigidbody.cpp.

◆ centerOfMassRotationChanged

void QDynamicRigidBody::centerOfMassRotationChanged ( )
signal

◆ commandQueue()

QQueue< QPhysicsCommand * > & QDynamicRigidBody::commandQueue ( )

Definition at line 580 of file qdynamicrigidbody.cpp.

◆ createPhysXBackend()

QAbstractPhysXNode * QDynamicRigidBody::createPhysXBackend ( )
finalvirtual

Implements QAbstractPhysicsNode.

Definition at line 686 of file qdynamicrigidbody.cpp.

◆ density()

float QDynamicRigidBody::density ( ) const

Definition at line 506 of file qdynamicrigidbody.cpp.

◆ densityChanged

void QDynamicRigidBody::densityChanged ( float density)
signal

◆ gravityEnabled()

bool QDynamicRigidBody::gravityEnabled ( ) const

Definition at line 477 of file qdynamicrigidbody.cpp.

◆ gravityEnabledChanged

void QDynamicRigidBody::gravityEnabledChanged ( )
signal

◆ inertiaMatrix()

const QMatrix3x3 & QDynamicRigidBody::inertiaMatrix ( ) const

Definition at line 462 of file qdynamicrigidbody.cpp.

◆ inertiaMatrixChanged

void QDynamicRigidBody::inertiaMatrixChanged ( )
signal

◆ inertiaTensor()

const QVector3D & QDynamicRigidBody::inertiaTensor ( ) const

Definition at line 411 of file qdynamicrigidbody.cpp.

◆ inertiaTensorChanged

void QDynamicRigidBody::inertiaTensorChanged ( )
signal

◆ isKinematic()

bool QDynamicRigidBody::isKinematic ( ) const

Definition at line 472 of file qdynamicrigidbody.cpp.

◆ isKinematicChanged

void QDynamicRigidBody::isKinematicChanged ( bool isKinematic)
signal

◆ mass()

float QDynamicRigidBody::mass ( ) const

Definition at line 467 of file qdynamicrigidbody.cpp.

◆ massChanged

void QDynamicRigidBody::massChanged ( float mass)
signal

◆ massMode()

QDynamicRigidBody::MassMode QDynamicRigidBody::massMode ( ) const

Definition at line 369 of file qdynamicrigidbody.cpp.

◆ massModeChanged

void QDynamicRigidBody::massModeChanged ( )
signal

◆ Q_REVISION() [1/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [2/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [3/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [4/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [5/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [6/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION [7/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  )
signal

◆ Q_REVISION [8/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &
signal

◆ Q_REVISION [9/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &
signal

◆ Q_REVISION [10/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &
signal

◆ Q_REVISION [11/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &
signal

◆ Q_REVISION [12/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  )
signal

◆ Q_REVISION() [13/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  )
new

◆ Q_REVISION() [14/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &

◆ Q_REVISION() [15/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &

◆ Q_REVISION() [16/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &

◆ Q_REVISION() [17/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  ) const &

◆ Q_REVISION() [18/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
5  )
new

◆ Q_REVISION() [19/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
9  ) const

◆ Q_REVISION [20/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
9  )
signal

◆ Q_REVISION() [21/21]

QDynamicRigidBody::Q_REVISION ( 6 ,
9  )
new

◆ readInertiaMatrix()

const QList< float > & QDynamicRigidBody::readInertiaMatrix ( ) const

Definition at line 428 of file qdynamicrigidbody.cpp.

◆ reset()

void QDynamicRigidBody::reset ( const QVector3D & position,
const QVector3D & eulerRotation )

Definition at line 626 of file qdynamicrigidbody.cpp.

◆ setAngularVelocity()

void QDynamicRigidBody::setAngularVelocity ( const QVector3D & angularVelocity)

Definition at line 549 of file qdynamicrigidbody.cpp.

◆ setCenterOfMassPosition()

void QDynamicRigidBody::setCenterOfMassPosition ( const QVector3D & newCenterOfMassPosition)

Definition at line 345 of file qdynamicrigidbody.cpp.

◆ setCenterOfMassRotation()

void QDynamicRigidBody::setCenterOfMassRotation ( const QQuaternion & newCenterOfMassRotation)

Definition at line 327 of file qdynamicrigidbody.cpp.

◆ setDensity()

void QDynamicRigidBody::setDensity ( float density)

Definition at line 511 of file qdynamicrigidbody.cpp.

◆ setGravityEnabled()

void QDynamicRigidBody::setGravityEnabled ( bool gravityEnabled)

Definition at line 539 of file qdynamicrigidbody.cpp.

◆ setInertiaMatrix()

void QDynamicRigidBody::setInertiaMatrix ( const QList< float > & newInertiaMatrix)

Definition at line 446 of file qdynamicrigidbody.cpp.

◆ setInertiaTensor()

void QDynamicRigidBody::setInertiaTensor ( const QVector3D & newInertiaTensor)

Definition at line 416 of file qdynamicrigidbody.cpp.

◆ setIsKinematic()

void QDynamicRigidBody::setIsKinematic ( bool isKinematic)

Definition at line 523 of file qdynamicrigidbody.cpp.

◆ setLinearVelocity()

void QDynamicRigidBody::setLinearVelocity ( const QVector3D & linearVelocity)

Definition at line 621 of file qdynamicrigidbody.cpp.

◆ setMass()

void QDynamicRigidBody::setMass ( float mass)

Definition at line 482 of file qdynamicrigidbody.cpp.

◆ setMassMode()

void QDynamicRigidBody::setMassMode ( const MassMode newMassMode)

Definition at line 374 of file qdynamicrigidbody.cpp.

◆ updateDefaultDensity()

void QDynamicRigidBody::updateDefaultDensity ( float defaultDensity)

Definition at line 585 of file qdynamicrigidbody.cpp.

Property Documentation

◆ angularAxisLock

QDynamicRigidBody::AxisLock QDynamicRigidBody::angularAxisLock
readwrite

Definition at line 56 of file qdynamicrigidbody_p.h.

◆ centerOfMassPosition

QVector3D QDynamicRigidBody::centerOfMassPosition
read

Definition at line 66 of file qdynamicrigidbody_p.h.

◆ centerOfMassRotation

QQuaternion QDynamicRigidBody::centerOfMassRotation
read

Definition at line 68 of file qdynamicrigidbody_p.h.

◆ density

float QDynamicRigidBody::density
readwrite

Definition at line 52 of file qdynamicrigidbody_p.h.

◆ gravityEnabled

bool QDynamicRigidBody::gravityEnabled
readwrite

Definition at line 60 of file qdynamicrigidbody_p.h.

◆ inertiaMatrix

QList<float> QDynamicRigidBody::inertiaMatrix
readwrite

Definition at line 70 of file qdynamicrigidbody_p.h.

◆ inertiaTensor

QVector3D QDynamicRigidBody::inertiaTensor
readwrite

Definition at line 64 of file qdynamicrigidbody_p.h.

◆ isKinematic

bool QDynamicRigidBody::isKinematic
readwrite

Definition at line 59 of file qdynamicrigidbody_p.h.

◆ isSleeping

bool QDynamicRigidBody::isSleeping
readwrite

Definition at line 83 of file qdynamicrigidbody_p.h.

◆ kinematicEulerRotation

QVector3D QDynamicRigidBody::kinematicEulerRotation
read

Definition at line 75 of file qdynamicrigidbody_p.h.

◆ kinematicPivot

QVector3D QDynamicRigidBody::kinematicPivot
readwrite

Definition at line 80 of file qdynamicrigidbody_p.h.

◆ kinematicPosition

QVector3D QDynamicRigidBody::kinematicPosition
readwrite

Definition at line 73 of file qdynamicrigidbody_p.h.

◆ kinematicRotation

QQuaternion QDynamicRigidBody::kinematicRotation
readwrite

Definition at line 78 of file qdynamicrigidbody_p.h.

◆ linearAxisLock

QDynamicRigidBody::AxisLock QDynamicRigidBody::linearAxisLock
readwrite

Definition at line 54 of file qdynamicrigidbody_p.h.

◆ mass

float QDynamicRigidBody::mass
readwrite

Definition at line 51 of file qdynamicrigidbody_p.h.

◆ massMode

MassMode QDynamicRigidBody::massMode
readwrite

Definition at line 63 of file qdynamicrigidbody_p.h.


The documentation for this class was generated from the following files: