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

Implements

Index

Constructors

constructor

  • RealisticSolver(config: DeepRequired<{ contactSolveBias?: ContactSolveBias; positionIterations?: number; slop?: number; steeringFactor?: number; velocityIterations?: number; warmStart?: boolean } | undefined>): RealisticSolver
  • Parameters

    • config: DeepRequired<{ contactSolveBias?: ContactSolveBias; positionIterations?: number; slop?: number; steeringFactor?: number; velocityIterations?: number; warmStart?: boolean } | undefined>

    Returns RealisticSolver

Properties

publicconfig

config: DeepRequired<{ contactSolveBias?: ContactSolveBias; positionIterations?: number; slop?: number; steeringFactor?: number; velocityIterations?: number; warmStart?: boolean } | undefined>

directionMap

directionMap: Map<string, horizontal | vertical> = ...

distanceMap

distanceMap: Map<string, number> = ...

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