Skip to content
EvilEngine.Formats.Collision

ColliderShape.Box record

public sealed record ColliderShape.Box : ColliderShape

A collider shape that’s a box, centred on the collider’s origin and lined up with its axes. Turn it with the collider’s Rotation.

new Collider(new ColliderShape.Box(new Vector3(0.8f, 0.8f, 0.8f)), ["solid"])
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

ColliderShape.Box constructor

public ColliderShape.Box(Vector3 Size)

Makes a box of size.

Size property

public Vector3 Size { get; init; }

The box’s whole width, height and depth along the collider’s X, Y and Z axes, in metres, not its half sizes. Each must be above 0 for the collision to be written. A box with a size of 0 adds no volume, so it adds nothing to a body’s mass worked out from its volume.