crashcat docs
    Preparing search index...

    Function estimateCollisionResponse

    • estimate collision response between two bodies

      predicts post-collision velocities and impulses by running a mini PGS solver on a local copy of the velocities. designed to be called from onContactAdded to estimate impact strength before the actual solver runs.

      Parameters

      • result: CollisionEstimationResult

        result object to write to

      • body1: RigidBody

        first body

      • body2: RigidBody

        second body

      • manifold: ContactManifold

        contact manifold

      • combinedFriction: number

        combined friction coefficient

      • combinedRestitution: number

        combined restitution coefficient

      • minVelocityForRestitution: number = 1.0

        minimum relative velocity to apply restitution (default 1.0 m/s)

      • numIterations: number = 10

        number of PGS iterations (default 10)

      Returns void