Arbiter

class Arbiter(a: TranslatableBody, b: TranslatableBody)

Creates manifolds to detect collisions and apply forces to them. Discrete in nature and only evaluates pairs of bodies in a single manifold.

Constructors

Link copied to clipboard
fun Arbiter(a: TranslatableBody, b: TranslatableBody)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun narrowPhase()

Conducts a narrow phase detection and creates a contact manifold.

Link copied to clipboard
fun penetrationResolution()

Resolves any penetrations that are left overlapping between shapes. This can be cause due to integration errors of the solvers integration method. Based on linear projection to move the shapes away from each other based on a correction constant and scaled relative to the inverse mass of the objects.

Link copied to clipboard
fun solve()

Solves the current contact manifold and applies impulses based on any contacts found.

Properties

Link copied to clipboard
val a: TranslatableBody

Getter for Body A.

Link copied to clipboard
val b: TranslatableBody

Getter for Body B.

Link copied to clipboard
var contactCount: Int = 0
Link copied to clipboard
var contactNormal: Vec2
Link copied to clipboard
val contacts: Array<Vec2>

Array to save the contact points of the objects body's in world space.

Link copied to clipboard
var restitution: Double = 0.0