Table of Contents

Struct Joint

Namespace
Box3D
Assembly
Box3D.NET.dll

A constraint between two bodies.

public readonly record struct Joint : IEquatable<Joint>

Implements

Inherited Members

Extension Methods

Examples

var hinge = world.CreateRevoluteJoint(
    RevoluteJointDefinition.Hinge(door, frame, worldHingePoint, Vector3.UnitY) with
    {
        LimitsEnabled = true,
        LowerAngle = 0.0f,
        UpperAngle = MathF.PI * 0.5f,
    });

// The generic handle is always available.
Console.WriteLine(hinge.AsJoint.Type); // Revolute

Remarks

Like Box3D.Body and Box3D.Shape, this is a handle rather than an object. It carries what every joint has in common; the specific types such as Box3D.RevoluteJoint add limits, motors and springs.

A joint dies with either of the bodies it connects, and with its world.

Properties

AngularSeparation

Gets how far the joint is from satisfying its angular constraint, usually in radians.

BodyA

Gets the first attached body.

BodyB

Gets the second attached body.

CollideConnected

Gets or sets a value indicating whether the two attached bodies may collide.

ConstraintForce

Gets the force the constraint is currently applying, in newtons.

ConstraintTorque

Gets the torque the constraint is currently applying, in newton-metres.

ForceThreshold

Gets or sets the force above which this joint raises an event, in newtons.

FrameA

Gets or sets the joint frame on Box3D.Joint.BodyA.

FrameB

Gets or sets the joint frame on Box3D.Joint.BodyB.

IsValid

Gets a value indicating whether this handle refers to a live joint.

LinearSeparation

Gets how far the joint is from satisfying its positional constraint, usually in metres.

TorqueThreshold

Gets or sets the torque above which this joint raises an event, in newton-metres.

Type

Gets the kind of constraint this joint applies.

UserData

Gets or sets the application identifier attached to this joint.

World

Gets the world this joint belongs to.

Methods

Destroy(bool)

Destroys this joint.

FramesFromWorldAnchor(Body, Body, Vector3, Vector3)

Builds a matched pair of joint frames from a world-space anchor and axis.

SetConstraintTuning(float, float)

Sets the constraint softness. Advanced.

WakeBodies()

Wakes both attached bodies.