Skip to content
EvilEngine.Formats.Collision

CollisionJoint record

public sealed record CollisionJoint

A joint between two parts of a jointed collision, as a Source .phy’s ragdollconstraint gives one. It keeps the two together at its pivot and lets the child turn against the parent about the joint’s X, Y and Z axes, each within its own limit. A ragdoll’s joints become JointSpecs with these limits and friction, and the parts they join don’t collide with each other.

var elbow = new CollisionJoint(1, 2)
{
    Position = new Vector3(0.3f, 1.4f, 0),
    Limits = [new JointLimit(0, 0), new JointLimit(0, 0), new JointLimit(-2.4, 0)]
};
Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

CollisionJoint constructor

public CollisionJoint(int Parent, int Child)

Makes a joint from part parent to part child, by their index in Bodies, at the model’s origin, free on every axis and with no friction.

Parent property

public int Parent { get; init; }

The index of the part the joint hangs the child from. It must be another part than Child for the collision to be written.

Child property

public int Child { get; init; }

The index of the part that turns against the parent.

Position property

public Vector3 Position { get; init; }

Where the joint’s pivot is in the model’s bind pose, in metres. A .phy joint’s is its child’s bone.

Rotation property

public Quaternion Rotation { get; init; }

How the joint’s axes are turned in the bind pose, as a System.Numerics.Quaternion. Identity unless set.

Limits property

public IReadOnlyList<JointLimit> Limits { get; init; }

How far the child may turn about each of the joint’s X, Y and Z axes, three JointLimits in radians, all Free unless set. It must be exactly three for the collision to be written. A .phy constraint’s xmin to zmax are degrees, turned to radians and kept within -π to π.

Friction property

public IReadOnlyList<double> Friction { get; init; }

How hard each axis resists turning, as three numbers 0 or above, all 0 unless set. Above 0, the joint holds the child against turning about that axis up to that much torque. A .phy constraint’s xfriction, yfriction and zfriction.