Struct ContactEventData
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
TypeContactEventTypeThe kind of contact event.
EntityAEntityThe entity owning the first shape.
EntityBEntityThe entity owning the second shape.
ShapeIdAB2ShapeIdThe first shape involved.
ShapeIdBB2ShapeIdThe second shape involved.
PointVector2World-space contact point; zero for begin/end touch events.
NormalVector2World-space contact normal; zero for begin/end touch events.
ApproachSpeedfloatApproach 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
EntityA
The entity owning the first shape.
public Entity EntityA { get; init; }
Property Value
EntityB
The entity owning the second shape.
public Entity EntityB { get; init; }
Property Value
Normal
World-space contact normal; zero for begin/end touch events.
public Vector2 Normal { get; init; }
Property Value
Point
World-space contact point; zero for begin/end touch events.
public Vector2 Point { get; init; }
Property Value
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; }