Skip to content

Impact

namespace Griff.Runtime;
public struct Impact

One hard knock in the last physics step: Struck was hit by By at Point, as hard as Strength says. Strength is the push it took to stop the two coming together where they met (an impulse: mass times speed), so a crate of Mass 1 landing on the floor at 5 units a second hits 5, and a ball of Mass 2 thrown at a crate of Mass 1 at 9 units a second hits about 6, shared by their weights. Both sides of a knock are told, once a step for each pair, the harder of the points where they met; gentle touches (closing at under a unit a second: resting, sliding, settling) aren’t knocks.

public Entity By { get; init; }
public Vector2 Point { get; init; }
public float Strength { get; init; }
public Entity Struck { get; init; }
public void Deconstruct(out Entity Struck, out Entity By, out float Strength, out Vector2 Point)
public override bool Equals(object obj)
public bool Equals(Impact other)
public override int GetHashCode()
public override string ToString()