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()
Called when the world creates this constraint. Override to set DispatchId to the ID returned by registering the constraint's solver methods.
protected override void Create()