PhysicsSpace

An independent object storing simulation data for a set of physics structures. This takes ownership of objects like RigidBody and Collider instances, and allows manipulating and querying the internal structures. An instance can be created through PhysicsEngine.createSpace.

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class OnCollision(val state: PhysicsSpace.OnCollision.State, val colliderA: ColliderKey, val colliderB: ColliderKey, val manifolds: List<ContactManifold>)
Link copied to clipboard
data class OnContactForce(val dt: Double, val totalMagnitude: Double, val colliderA: ColliderKey, val colliderB: ColliderKey, val manifolds: List<ContactManifold>)
Link copied to clipboard
data class OnFilterContactPair(val colliderA: ColliderKey, val colliderB: ColliderKey, val bodyA: RigidBodyKey?, val bodyB: RigidBodyKey?, var solverFlags: PhysicsSpace.SolverFlags = SolverFlags.COMPUTE_IMPULSES)
Link copied to clipboard
data class OnFilterIntersectionPair(val colliderA: ColliderKey, val colliderB: ColliderKey, val bodyA: RigidBodyKey?, val bodyB: RigidBodyKey?, var createPair: Boolean = true)
Link copied to clipboard
data class OnModifySolverContacts(val colliderA: ColliderKey, val colliderB: ColliderKey, val bodyA: RigidBodyKey?, val bodyB: RigidBodyKey?, val manifold: ContactManifold, var normal: DVec3)
Link copied to clipboard
@ConfigSerializable
data class Settings(val gravity: DVec3 = DVec3(0.0, -9.81, 0.0))

Simulation parameters for a physics space.

Link copied to clipboard
interface SimpleContainer<R, W, O, K>
Link copied to clipboard
value class SolverFlags(val flags: Int)

Properties

Link copied to clipboard

Provides access to the Collider instances in this space.

Link copied to clipboard

Provides access to the ImpulseJoint instances in this space.

Link copied to clipboard
abstract var lock: ReentrantLock?

The lock used for checking thread-safe access (see PhysicsEngine).

Link copied to clipboard

Provides access to the MultibodyJoint instances in this space.

Link copied to clipboard
abstract val onCollision: EventDispatch<PhysicsSpace.OnCollision>

Runs when a collision between two Colliders is either started or stopped. Runs only when ColliderEvent.COLLISION is marked on at least one of the colliders.

Link copied to clipboard
abstract val onContactForce: EventDispatch<PhysicsSpace.OnContactForce>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val query: PhysicsQuery

Provides access to performing queries on this physics space, such as raycasts.

Link copied to clipboard

Provides access to the RigidBody instances in this space.

Link copied to clipboard

Settings for the simulation of the physics space. Note that not all options will be configurable here, as some are considered implementation details. In this case, the settings need to be configured with the actual implementation.

Functions

Link copied to clipboard
abstract fun destroy()