Skip to content
EvilEngine.Formats.Collision

CollisionBody record

public sealed record CollisionBody

One part of a jointed collision, such as a ragdoll’s forearm: which colliders it owns, where it sits in the model’s bind pose, and how it moves. Source’s .phy gives one for each solid of a model with more than one, named after the solid’s bone.

When a body dies into a ragdoll, the host makes one dynamic physics body of each part with convex colliders, places it on its bone of the dying pose by Name, or at its bind pose when there’s no pose or it has no such bone, and joins the parts by the collision’s Joints. A part with no convex collider is left out.

Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

CollisionBody constructor

public CollisionBody(string Name, IReadOnlyList<int> Colliders)

Makes a part named name that owns colliders, at the model’s origin, unturned, with its mass from its volume.

Name property

public string Name { get; init; }

The part’s name. A Source ragdoll’s is its bone’s, which the ragdoll is posed and drawn by.

Colliders property

public IReadOnlyList<int> Colliders { get; init; }

The indices of the Colliders the part owns. Each collider must be in exactly one part for the collision to be written.

Position property

public Vector3 Position { get; init; }

Where the part’s origin is in the model’s bind pose, in metres. Its colliders and its joints’ frames are placed against it.

Rotation property

public Quaternion Rotation { get; init; }

How the part is turned in the bind pose, as a System.Numerics.Quaternion. Identity unless set.

Mass property

public double? Mass { get; init; }

The part’s mass in kilograms, above 0, or null for its volume times its surface’s density. A .phy solid’s mass.

Damping property

public double? Damping { get; init; }

How much of its speed the part sheds each second, or null for the physics world’s own. A .phy solid’s damping.

SpinDamping property

public double? SpinDamping { get; init; }

How much of its spin the part sheds each second, or null for the physics world’s own. A .phy solid’s rotdamping.

Inertia property

public double? Inertia { get; init; }

A scale on the part’s inertia, or null for 1. A .phy solid’s inertia. The physics body carries it, but the physics world doesn’t apply it yet.