Skip to content
EvilEngine.Formats.Collision

MeshPart record

public sealed record MeshPart

One piece of a ColliderShape.Mesh: triangles over corners of its own, and what they’re made of, so one mesh can be concrete in one place and metal in another.

new MeshPart([new(-5, 0, -5), new(5, 0, -5), new(-5, 0, 5), new(5, 0, 5)], [0, 2, 1, 1, 2, 3], CollisionSurface.None)
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

MeshPart constructor

public MeshPart(Vector3[] Positions, uint[] Indices, CollisionSurface Surface)

Makes a part from its corners, its triangles and its surface.

Positions property

public Vector3[] Positions { get; init; }

The corners in metres, in the collider’s own space.

Indices property

public uint[] Indices { get; init; }

The triangles, three indices into Positions each. A count that isn’t a whole number of triangles, or an index past the corners, keeps the mesh from being written.

Surface property

public CollisionSurface Surface { get; init; }

What these triangles are made of, as a CollisionSurface. It’s written with the part, where the mesh’s own surface isn’t.