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>.
|
#include "qphysicsworld_p.h"
#include "physxnode/qabstractphysxnode_p.h"
#include "physxnode/qphysxworld_p.h"
#include "qabstractphysicsnode_p.h"
#include "qdebugdrawhelper_p.h"
#include "qphysicsutils_p.h"
#include "qstaticphysxobjects_p.h"
#include "qboxshape_p.h"
#include "qsphereshape_p.h"
#include "qconvexmeshshape_p.h"
#include "qtrianglemeshshape_p.h"
#include "qcharactercontroller_p.h"
#include "qcapsuleshape_p.h"
#include "qplaneshape_p.h"
#include "qheightfieldshape_p.h"
#include "PxPhysicsAPI.h"
#include "cooking/PxCooking.h"
#include <QtQuick3D/private/qquick3dobject_p.h>
#include <QtQuick3D/private/qquick3dnode_p.h>
#include <QtQuick3D/private/qquick3dmodel_p.h>
#include <QtQuick3D/private/qquick3ddefaultmaterial_p.h>
#include <QtQuick3DUtils/private/qssgutils_p.h>
#include <QtEnvironmentVariables>
#include "qphysicsworld.moc"
Go to the source code of this file.
Classes | |
class | SimulationWorker |
struct | QWorldManager |
Macros | |
#define | PHYSX_ENABLE_PVD 0 |
Functions | |
QT_BEGIN_NAMESPACE | Q_LOGGING_CATEGORY (lcQuick3dPhysics, "qt.quick3d.physics") |
\qmltype PhysicsWorld \inqmlmodule QtQuick3D.Physics | |
static void | collectPhysicsNodes (QQuick3DObject *node, QList< QAbstractPhysicsNode * > &nodes) |
Variables | |
static QWorldManager | worldManager = QWorldManager {} |
#define PHYSX_ENABLE_PVD 0 |
Definition at line 32 of file qphysicsworld.cpp.
|
static |
Definition at line 890 of file qphysicsworld.cpp.
References child, and collectPhysicsNodes().
Referenced by collectPhysicsNodes().
QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY | ( | lcQuick3dPhysics | , |
"qt.quick3d.physics" | ) |
\qmltype PhysicsWorld \inqmlmodule QtQuick3D.Physics
Controls the physics simulation.
The PhysicsWorld type controls the physics simulation. This node is used to create an instance of the physics world as well as define its properties. There can only be one physics world. All collision nodes in the qml will get added automatically to the physics world.
\qmlproperty vector3d PhysicsWorld::gravity This property defines the gravity vector of the physics world. The default value is (0, -981, 0). Set the value to
{Qt.vector3d(0, -9.81, 0)} if your unit of measurement is meters and you are simulating Earth gravity.
\qmlproperty bool PhysicsWorld::running This property starts or stops the physical simulation. The default value is true
.
\qmlproperty bool PhysicsWorld::forceDebugDraw This property enables debug drawing of all active shapes in the physics world. The default value is false
.
\qmlproperty bool PhysicsWorld::enableCCD This property enables continuous collision detection. This will reduce the risk of bodies going through other bodies at high velocities (also known as tunnelling). The default value is false
.
\qmlproperty float PhysicsWorld::typicalLength This property defines the approximate size of objects in the simulation. This is used to estimate certain length-related tolerances. Objects much smaller or much larger than this size may not behave properly. The default value is 100
.
Range: {[0, inf]}
\qmlproperty float PhysicsWorld::typicalSpeed This property defines the typical magnitude of velocities of objects in simulation. This is used to estimate whether a contact should be treated as bouncing or resting based on its impact velocity, and a kinetic energy threshold below which the simulation may put objects to sleep.
For normal physical environments, a good choice is the approximate speed of an object falling under gravity for one second. The default value is 1000
.
Range: {[0, inf]}
\qmlproperty float PhysicsWorld::defaultDensity This property defines the default density of dynamic objects, measured in kilograms per cubic unit. This is equal to the weight of a cube with side 1
.
The default value is 0.001
, corresponding to 1 g/cm³: the density of water. If your unit of measurement is meters, a good value would be 1000
. Note that only positive values are allowed.
Range: {(0, inf]}
\qmlproperty Node PhysicsWorld::viewport This property defines the viewport where debug components will be drawn if \l{forceDebugDraw} is enabled. If unset the \l{scene} node will be used.
\qmlproperty float PhysicsWorld::minimumTimestep This property defines the minimum simulation timestep in milliseconds. The default value is 16.667
which corresponds to 60
frames per second.
Range: {[0, maximumTimestep]}
\qmlproperty float PhysicsWorld::maximumTimestep This property defines the maximum simulation timestep in milliseconds. The default value is 33.333
which corresponds to 30
frames per second.
Range: {[0, inf]}
\qmlproperty Node PhysicsWorld::scene
This property defines the top-most Node that contains all the nodes of the physical simulation. All physics objects that are an ancestor of this node will be seen as part of this PhysicsWorld.
\qmlsignal PhysicsWorld::frameDone(float timestep)
This signal is emitted when the physical simulation is done simulating a frame. The timestep parameter is how long in milliseconds the timestep was in the simulation.
\qmlproperty int PhysicsWorld::numThreads
This property defines the number of threads used for the physical simulation. This is how the range of values are interpreted:
\table \header
{[-inf, -1]}
{{0}}
{[1, inf]} The default value is {-1}, meaning automatic thread count.
\qmlproperty bool PhysicsWorld::reportKinematicKinematicCollisions
This property controls if collisions between pairs of {kinematic} dynamic rigid bodies will trigger a contact report.
The default value is {false}.
\qmlproperty bool PhysicsWorld::reportStaticKinematicCollisions
This property controls if collisions between a static rigid body and a {kinematic} dynamic rigid body will trigger a contact report.
The default value is {false}.
|
static |
Definition at line 359 of file qphysicsworld.cpp.
Referenced by QPhysicsWorld::QPhysicsWorld(), QPhysicsWorld::~QPhysicsWorld(), QPhysicsWorld::deregisterNode(), QPhysicsWorld::getWorld(), and QPhysicsWorld::registerNode().