Table of Contents

Struct ContactEventData

Namespace
Stride.CommunityToolkit.Box2D.Events
Assembly
Stride.CommunityToolkit.Box2D.dll

A contact event delivered to IContactEventHandler implementations: the two entities and shapes involved, plus impact data for Hit events.

public readonly record struct ContactEventData : IEquatable<ContactEventData>
Implements
Inherited Members

Constructors

ContactEventData(ContactEventType, Entity, Entity, B2ShapeId, B2ShapeId, Vector2, Vector2, float)

A contact event delivered to IContactEventHandler implementations: the two entities and shapes involved, plus impact data for Hit events.

public ContactEventData(ContactEventType Type, Entity EntityA, Entity EntityB, B2ShapeId ShapeIdA, B2ShapeId ShapeIdB, Vector2 Point, Vector2 Normal, float ApproachSpeed)

Parameters

Type ContactEventType

The kind of contact event.

EntityA Entity

The entity owning the first shape.

EntityB Entity

The entity owning the second shape.

ShapeIdA B2ShapeId

The first shape involved.

ShapeIdB B2ShapeId

The second shape involved.

Point Vector2

World-space contact point; zero for begin/end touch events.

Normal Vector2

World-space contact normal; zero for begin/end touch events.

ApproachSpeed float

Approach speed of the impact; zero for begin/end touch events.

Properties

ApproachSpeed

Approach speed of the impact; zero for begin/end touch events.

public float ApproachSpeed { get; init; }

Property Value

float

EntityA

The entity owning the first shape.

public Entity EntityA { get; init; }

Property Value

Entity

EntityB

The entity owning the second shape.

public Entity EntityB { get; init; }

Property Value

Entity

Normal

World-space contact normal; zero for begin/end touch events.

public Vector2 Normal { get; init; }

Property Value

Vector2

Point

World-space contact point; zero for begin/end touch events.

public Vector2 Point { get; init; }

Property Value

Vector2

ShapeIdA

The first shape involved.

public B2ShapeId ShapeIdA { get; init; }

Property Value

B2ShapeId

ShapeIdB

The second shape involved.

public B2ShapeId ShapeIdB { get; init; }

Property Value

B2ShapeId

Type

The kind of contact event.

public ContactEventType Type { get; init; }

Property Value

ContactEventType