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
TThe 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
Methods
Create()
Sets the solver dispatch id used by this instance. Override this in derived classes to assign the correct registered solver pair. The id is later written into the unmanaged header when the constraint is enabled.
protected override void Create()