Skip to content
EvilEngine.Api.Weapons

WeaponTrace record struct

public readonly record struct WeaponTrace

What a Trace hit.

Assembly
EvilEngine.Api
Commit
4ff877b1

Members

WeaponTrace constructor

public WeaponTrace(double Fraction, MapVector End, MapVector Normal)

The fraction of the line travelled, where it ended and the surface’s normal there.

Fraction property

public double Fraction { get; init; }

How far along the line it got, from 0 to 1, 1 when it hit nothing.

End property

public MapVector End { get; init; }

Where it stopped.

Normal property

public MapVector Normal { get; init; }

The surface’s normal where it hit, zero when it hit nothing.

Body property

public IPhysicsBody? Body { get; init; }

The physics body it hit, or null for the world or nothing.

Person property

public bool Person { get; init; }

Whether it hit a person’s body, which isn’t a physics body.

Group property

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.

Surface property

public ContentId? Surface { get; init; }

The surface record it hit, when the world or the model names one.

Material property

public ContentId? Material { get; init; }

The material it hit, so a Plugin can tell the sky from a wall.

Impact property

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.

Hit property

public bool Hit { get; }

Whether it hit anything before the line’s end.