Table of Contents

Class Constraint<T>

Namespace
Jitter2.Dynamics.Constraints
Assembly
Jitter2.dll

Generic base class for constraints that store custom data of type T.

public abstract class Constraint<T> : Constraint, IDebugDrawable where T : unmanaged

Type Parameters

T

The unmanaged data structure containing constraint-specific state. Must fit within ConstraintData (i.e., ConstraintSizeFull bytes).

Inheritance
Constraint<T>
Implements
Derived
Inherited Members

Remarks

Derive from this class to create constraints with custom data layouts. The Data property provides typed access to the constraint's unmanaged memory.

Properties

Data

Gets a reference to the constraint's typed data stored in unmanaged memory.

public ref T Data { get; }

Property Value

T

IsSmallConstraint

Gets whether this constraint uses the smaller data layout.

public override bool IsSmallConstraint { get; }

Property Value

bool

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()