WeaponTrace record struct
public readonly record struct WeaponTrace What a Trace hit.
- Assembly
- EvilEngine.Api
- Commit
- 4ff877b1
public readonly record struct WeaponTrace What a Trace hit.
public WeaponTrace(double Fraction, MapVector End, MapVector Normal) The fraction of the line travelled, where it ended and the surface’s normal there.
public double Fraction { get; init; } How far along the line it got, from 0 to 1, 1 when it hit nothing.
public MapVector End { get; init; } Where it stopped.
public MapVector Normal { get; init; } The surface’s normal where it hit, zero when it hit nothing.
public IPhysicsBody? Body { get; init; } The physics body it hit, or null for the world or nothing.
public bool Person { get; init; } Whether it hit a person’s body, which isn’t a physics body.
public int Group { get; init; } The hit group of the hitbox it hit on a person, as the person’s model numbers them, or 0.
public ContentId? Surface { get; init; } The surface record it hit, when the world or the model names one.
public ContentId? Material { get; init; } The material it hit, so a Plugin can tell the sky from a wall.
public ContentId? Impact { get; init; } The struck surface’s bullet effect, from its surface record’s effects, or a person’s body’s surface’s, or null when it names none. A weapon plays its own impact first and this one when it has none, as the engine does for bullets.
public bool Hit { get; } Whether it hit anything before the line’s end.