Skip to content
EvilEngine.Formats.Collision

CollisionSurface record

public sealed record CollisionSurface

What a collider is made of: a surface record’s id, a material’s id whose surface stands in for it, both or neither. A ColliderShape and each MeshPart carry one, and footsteps, impacts and bullet holes read it where something touches.

new ColliderShape.Box(new Vector3(1, 1, 1)) { Surface = new CollisionSurface(ContentId.Parse("gmod:surfaces/wood"), null) }
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

CollisionSurface constructor

public CollisionSurface(ContentId? Surface, ContentId? Material)

Makes a surface from a surface record’s id and a material’s id, either of them null.

None field

public static readonly CollisionSurface None

Neither a surface nor a material, what a shape has unless it’s given one.

Surface property

public ContentId? Surface { get; init; }

The surface record’s id, or null. A body made through IPhysicsWorld.Add takes its friction, bounce and density from the first collider that names one.

Material property

public ContentId? Material { get; init; }

The id of a material whose own surface stands in when Surface is null, as a map’s brushes name theirs, or null. Map collision and placed models read it; a body made through IPhysicsWorld.Add doesn’t.