ContactHitEvent

data class ContactHitEvent(val shapeA: Shape, val shapeB: Shape, val point: Vec2, val normal: Vec2, val approachSpeed: Float)

Event generated when two shapes collide with significant impact.

Hit events are only generated when the approach speed exceeds the world's hit event threshold (configurable in WorldDef).

Parameters

shapeA

The first shape involved in the collision

shapeB

The second shape involved in the collision

point

The point of impact in world coordinates

normal

Normal vector pointing from shapeA to shapeB

approachSpeed

The speed at which the shapes were approaching (always positive), typically in meters per second

Constructors

Link copied to clipboard
constructor(shapeA: Shape, shapeB: Shape, point: Vec2, normal: Vec2, approachSpeed: Float)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val point: Vec2
Link copied to clipboard
Link copied to clipboard