Skip to main content

RealisticSolver

A collision solver figures out how to position colliders such that they are no longer overlapping

Solvers are executed in the order

  1. preSolve
  2. solveVelocity
  3. solvePosition
  4. postSolve
@inheritDoc

Implements

Index

Constructors

constructor

  • new RealisticSolver(config: Required<{ positionIterations?: number; slop?: number; steeringFactor?: number; velocityIterations?: number; warmStart?: boolean }>): RealisticSolver
  • Parameters

    • config: Required<{ positionIterations?: number; slop?: number; steeringFactor?: number; velocityIterations?: number; warmStart?: boolean }>

    Returns RealisticSolver

Properties

publicconfig

config: Required<{ positionIterations?: number; slop?: number; steeringFactor?: number; velocityIterations?: number; warmStart?: boolean }>

idToContactConstraint

idToContactConstraint: Map<string, ContactConstraintPoint[]> = ...

lastFrameContacts

lastFrameContacts: Map<string, CollisionContact> = ...

Methods

getContactConstraints

postSolve

preSolve

publicsolve

  • Solves overlapping contact in

    Solvers are executed in the order

    1. preSolve
    2. solveVelocity
    3. solvePosition
    4. postSolve

    Parameters

    Returns CollisionContact[]

solvePosition

  • Iteratively solve the position overlap constraint


    Parameters

    Returns void

solveVelocity

warmStart

  • Warm up body's based on previous frame contact points


    Parameters

    Returns void