Table of Contents

Class PointOnPlane

Namespace
Jitter2.Dynamics.Constraints
Assembly
Jitter2.dll

Constrains a fixed point in the reference frame of one body to a plane that is fixed in the reference frame of another body. This constraint removes one degree of translational freedom if the limit is enforced.

public class PointOnPlane : Constraint<PointOnPlane.SliderData>, IDebugDrawable
Inheritance
PointOnPlane
Implements
Inherited Members

Properties

Bias

Gets or sets the bias factor controlling how aggressively positional error is corrected.

public float Bias { get; set; }

Property Value

float

Default is 0.01. Range [0, 1]. Higher values correct errors faster but may cause instability.

Impulse

Gets the accumulated impulse applied by this constraint during the last step.

public float Impulse { get; }

Property Value

float

Softness

Gets or sets the softness (compliance) of the constraint.

public float Softness { get; set; }

Property Value

float

Default is 0.00001. Higher values allow more positional error but improve stability.

Methods

Create()

Sets the Iterate and PrepareForIteration function pointer fields on this instance. Override this in derived classes to assign the correct solver methods. The pointers are later written into ConstraintData when the constraint is enabled.

protected override void Create()

DebugDraw(IDebugDrawer)

Draws a debug visualization of this constraint.

public override void DebugDraw(IDebugDrawer drawer)

Parameters

drawer IDebugDrawer

The debug drawer to receive visualization primitives.

Exceptions

NotImplementedException

Thrown if the derived class does not override this method.

Initialize(JVector, JVector, JVector)

Initializes the constraint from world-space parameters.

public void Initialize(JVector axis, JVector anchor1, JVector anchor2)

Parameters

axis JVector

The plane normal in world space, fixed in the reference frame of body 1.

anchor1 JVector

Anchor point on body 1 defining the plane origin in world space.

anchor2 JVector

Anchor point on body 2 constrained to the plane in world space.

Remarks

Computes local anchor points and axis from the current body poses. Default values: Bias = DefaultLinearBias, Softness = DefaultLinearSoftness.

Initialize(JVector, JVector, JVector, LinearLimit)

Initializes the constraint from world-space parameters.

public void Initialize(JVector axis, JVector anchor1, JVector anchor2, LinearLimit limit)

Parameters

axis JVector

The plane normal in world space, fixed in the reference frame of body 1.

anchor1 JVector

Anchor point on body 1 defining the plane origin in world space.

anchor2 JVector

Anchor point on body 2 constrained to the plane in world space.

limit LinearLimit

Distance limit from the plane.

Remarks

Computes local anchor points and axis from the current body poses. Default values: Bias = DefaultLinearBias, Softness = DefaultLinearSoftness.

IteratePointOnPlane(ref ConstraintData, float)

public static void IteratePointOnPlane(ref ConstraintData constraint, float idt)

Parameters

constraint ConstraintData
idt float

PrepareForIterationPointOnPlane(ref ConstraintData, float)

public static void PrepareForIterationPointOnPlane(ref ConstraintData constraint, float idt)

Parameters

constraint ConstraintData
idt float