Engine API Reference - v2.7.3
    Preparing search index...

    Class SingleContactResult

    Represents the detailed data of a single contact point between two rigid bodies in the physics simulation. This class provides comprehensive information about the contact, including the entities involved, the exact contact points in both local and world space coordinates, the contact normal, and the collision impulse force.

    Instances of this class are created by the physics engine when collision events occur and are passed to event handlers only through the global contact event on the RigidBodyComponentSystem. Individual rigid body components receive instances of ContactResult instead.

    app.systems.rigidbody.on('contact', (result) => {
    console.log(`Contact between ${result.a.name} and ${result.b.name}`);
    });
    Index

    Properties

    The first entity involved in the contact.

    The second entity involved in the contact.

    impulse: number

    The total accumulated impulse applied by the constraint solver during the last sub-step. Describes how hard two bodies collided.

    localPointA: Vec3

    The point on Entity A where the contact occurred, relative to A.

    localPointB: Vec3

    The point on Entity B where the contact occurred, relative to B.

    normal: Vec3

    The normal vector of the contact on Entity B, in world space.

    pointA: Vec3

    The point on Entity A where the contact occurred, in world space.

    pointB: Vec3

    The point on Entity B where the contact occurred, in world space.