PhysicsEngine
The entry point to the physics system; an engine represents the manager of all physics resources and structures. An engine is tied to a specific physics backend, and allows creating native objects to interface with the physics backend.
The units used throughout the engine are metric: meters, radians, seconds, kilograms.
Thread safety
Physics structures used by the engine are not thread-safe, so must be treated carefully when interacting with them from multiple threads. Typically, the user of e.g. a PhysicsSpace or RigidBody would wrap accesses to that object in a lock. To enforce this, you can specify a java.util.concurrent.locks.ReentrantLock on some structures. Before any read or write access, this lock will be checked to make sure the current thread holds an exclusive lock. If it does not, an exception will be thrown.
Types
Utility class for building a PhysicsEngine, allowing defining properties required for the engine.
Properties
Functions
Creates a RigidBody with default parameters, which is not attached to any PhysicsSpace.
Creates a Collider with default parameters, which is not attached to any RigidBody or PhysicsSpace.
Creates a Joint with default parameters, which is not attached to any RigidBody or PhysicsSpace.
Creates a baked, physics-ready form of a Geometry, which starts with a reference count of 1. See RefCounted for information on using ref-counted objects.
Creates an independent container for physics structures from the specified settings.
Simulates an update for a collection of spaces in parallel, with the given time step.