Skip to content
EvilEngine.Formats.Collision

CollisionMotion record

public sealed record CollisionMotion

What a collision that’s one moving body says about how it moves. Only its mass is kept. Source’s .phy gives one for a prop of one solid.

var melon = new CollisionContent([new Collider(new ColliderShape.Sphere(0.2f), ["solid"])])
{
    Motion = new CollisionMotion { Mass = 10 }
};
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

CollisionMotion constructor

public CollisionMotion()

Makes a motion with no mass of its own.

Mass property

public double? Mass { get; init; }

The body’s mass in kilograms, above 0, or null. IPhysicsWorld.Add uses it when BodySpec.Mass isn’t set: 30 kg for Garry’s Mod’s oil drum, 10 for the melon. Left null, the body weighs its volume times its surface’s density, or 1,000 kg/m³ when the surface has none, and 1 kg when it has no volume.