NodeContourConstraint

Represents a constraint that enforces nodes within a body to remain near the defined contour of a rectangle.

The NodeContourConstraint ensures that the nodes of a body stay within a certain distance of the contour of a rectangle by iteratively applying corrections based on proximity calculations. It influences the position of nodes to enforce defined physical rules in relation to the contour, while respecting mass and other physical properties.

Parameters

body

the Body whose nodes are constrained by this constraint.

Constructors

Link copied to clipboard
constructor(body: Body)

Creates a NodeContourConstraint for the given physical body, which will affect its nodes.

Properties

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

the compliance factor that allows some flexibility in the constraint.

Link copied to clipboard
var contour: ShapeContour

the contour of the rectangle which the nodes are constrained to respect.

Link copied to clipboard

the number of iterations performed while solving the constraint, influencing accuracy.

Link copied to clipboard

an array of lambda values used internally for constraint resolution.

Link copied to clipboard

the radius within which nodes will search for the nearest contour point or edge.

Link copied to clipboard

the strength of the constraint's enforcement on the body.

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.