NodeRepulseForce

class NodeRepulseForce(val body: Body) : Force(source)

Represents a repulsive force applied to nodes within a specified search radius.

The NodeRepulseForce class implements the Force interface and applies a repelling force between nodes in a Body, based on their proximity to each other. Nodes within the searchRadius experience a force proportional to their distance, aimed at pushing them apart.

Constructors

Link copied to clipboard
constructor(body: Body)

Properties

Link copied to clipboard
val body: Body

The Body instance on which the force is applied.

Link copied to clipboard

The radius within which nodes repel each other. A larger value increases the distance at which nodes interact.

Link copied to clipboard

The magnitude of the repulsive force. A higher value results in stronger repulsion between nodes.

Functions

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