RectangularBoundsConstraint

Enforces rectangular boundary constraints on a physical body within a simulation.

The RectangularBoundsConstraint ensures that the nodes of a Body remain within a specified rectangular boundary during simulation. It provides options to customize the boundary dimensions, compliance factor, and the number of iterations for solving constraint violations. Additionally, it supports a bounce factor that modifies the behavior of the nodes when they collide with the boundary limits.

Constructors

Link copied to clipboard
constructor(body: Body)

Properties

Link copied to clipboard
val body: Body

the Body whose nodes are constrained by the rectangular boundary.

Link copied to clipboard

the bounce factor to apply upon collision with the boundary, influencing the restitution behavior of nodes.

Link copied to clipboard
var bounds: Rectangle

the rectangular region within which the nodes are constrained.

Link copied to clipboard

the compliance factor that softens or hardens the constraint by impacting how strongly violations are resolved.

Link copied to clipboard

the number of iterations to use for resolving constraint violations, affecting the accuracy and stability of the constraint-solving process.

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.