# SingleContactResult

Class · category: Physics

Source: https://github.com/playcanvas/engine/blob/f059dc005842f76e052cdf44d8370c8c7ec475ac/src/framework/components/rigid-body/single-contact-result.js#L28

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](https://api.playcanvas.com/engine/classes/RigidBodyComponentSystem.md). Individual rigid body components receive instances of
[ContactResult](https://api.playcanvas.com/engine/classes/ContactResult.md) instead.

Instances are pooled and reused by the physics system, so a result and its vectors are only
valid inside the event handler that receives them. Copy any values that are needed later.

**Example**

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

## Properties

### a

```ts
a: Entity
```

The first entity involved in the contact.

### b

```ts
b: Entity
```

The second entity involved in the contact.

### impulse

```ts
impulse: number
```

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

### localPointA

```ts
localPointA: Vec3
```

The point on Entity A where the contact occurred, in the local space of A's rigid body (see
[ContactPoint#localPoint](https://api.playcanvas.com/engine/classes/ContactPoint.md#localpoint)).

### localPointB

```ts
localPointB: Vec3
```

The point on Entity B where the contact occurred, in the local space of B's rigid body.

### normal

```ts
normal: Vec3
```

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

### pointA

```ts
pointA: Vec3
```

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

### pointB

```ts
pointB: Vec3
```

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