NodeCollisionConstraint

Represents a constraint for resolving collisions between nodes within a physical body.

A NodeCollisionConstraint ensures that nodes within the Body do not overlap by applying positional corrections based on their physical properties such as position, radius, and inverse mass. This constraint is solved over successive time steps in a simulation.

Constructors

Link copied to clipboard
constructor(body: Body)

Initializes the constraint with the provided Body, which represents the collection of physical nodes to which the constraint will be applied.

Properties

Link copied to clipboard
val body: Body
Link copied to clipboard

A parameter controlling the flexibility of the constraint. A higher compliance value allows more deviation from the strict enforcement of the constraint, while a lower value enforces stricter adherence. It influences the degree of positional corrections during collision resolution.

Functions

Link copied to clipboard
open suspend override fun initialize()
Link copied to clipboard
open suspend override fun solve(body: Body, dt: Double)

Resolves constraints and updates the state of nodes within the given physical body over a time step.