![]() |
Jolt Physics
A multi core friendly Game Physics Engine
|
Contains the creation settings of a set of bodies. More...
#include <PhysicsScene.h>
Classes | |
| class | ConnectedConstraint |
| A constraint and how it is connected to the bodies in the scene. More... | |
Public Types | |
| using | PhysicsSceneResult = Result<Ref<PhysicsScene>> |
Static Public Member Functions | |
| static PhysicsSceneResult | sRestoreFromBinaryState (StreamIn &inStream) |
| Restore a saved scene from inStream. | |
Static Public Member Functions inherited from RefTarget< PhysicsScene > | |
| static int | sInternalGetRefCountOffset () |
| INTERNAL HELPER FUNCTION USED BY SERIALIZATION. | |
Static Public Attributes | |
| static constexpr uint32 | cFixedToWorld = 0xffffffff |
| Body constant to use to indicate that the constraint is attached to the fixed world. | |
Additional Inherited Members | |
Protected Attributes inherited from RefTarget< PhysicsScene > | |
| atomic< uint32 > | mRefCount |
| Current reference count. | |
Static Protected Attributes inherited from RefTarget< PhysicsScene > | |
| static constexpr uint32 | cEmbedded |
| A large value that gets added to the refcount to mark the object as embedded. | |
Contains the creation settings of a set of bodies.
| void PhysicsScene::AddBody | ( | const BodyCreationSettings & | inBody | ) |
Add a body to the scene.
| void PhysicsScene::AddConstraint | ( | const TwoBodyConstraintSettings * | inConstraint, |
| uint32 | inBody1, | ||
| uint32 | inBody2 ) |
Add a constraint to the scene
| inConstraint | Constraint settings |
| inBody1 | Index in the bodies list of first body to attach constraint to |
| inBody2 | Index in the bodies list of the second body to attach constraint to |
| void PhysicsScene::AddSoftBody | ( | const SoftBodyCreationSettings & | inSoftBody | ) |
Add a soft body to the scene.
| bool PhysicsScene::CreateBodies | ( | PhysicsSystem * | inSystem | ) | const |
Instantiate all bodies, returns false if not all bodies could be created.
| bool PhysicsScene::FixInvalidScales | ( | ) |
Go through all body creation settings and fix shapes that are scaled incorrectly (note this will change the scene a bit).
| void PhysicsScene::FromPhysicsSystem | ( | const PhysicsSystem * | inSystem | ) |
For debugging purposes: Construct a scene from the current state of the physics system.
|
inline |
|
inline |
Access to the body settings for this scene.
|
inline |
|
inline |
Access to the constraints for this scene.
|
inline |
Get number of bodies in this scene.
|
inline |
Get number of constraints in this scene.
|
inline |
Get number of bodies in this scene.
|
inline |
|
inline |
Access to the soft body settings for this scene.
| void PhysicsScene::SaveBinaryState | ( | StreamOut & | inStream, |
| bool | inSaveShapes, | ||
| bool | inSaveGroupFilter ) const |
Saves the state of this object in binary form to inStream.
| inStream | The stream to save the state to |
| inSaveShapes | If the shapes should be saved as well (these could be shared between physics scenes, in which case the calling application may want to write custom code to restore them) |
| inSaveGroupFilter | If the group filter should be saved as well (these could be shared) |
|
static |
Restore a saved scene from inStream.
Body constant to use to indicate that the constraint is attached to the fixed world.