Class ConstraintComponentBase
- Namespace
- Stride.BepuPhysics.Constraints
- Assembly
- Stride.BepuPhysics.dll
[DataContract(Inherited = true)]
[DefaultEntityComponentProcessor(typeof(ConstraintProcessor), ExecutionMode = ExecutionMode.Runtime)]
[ComponentCategory("Physics - Bepu Constraint")]
public abstract class ConstraintComponentBase : EntityComponent, IIdentifiable
- Inheritance
-
objectConstraintComponentBase
- Implements
- Derived
- Inherited Members
Constructors
ConstraintComponentBase(int)
protected ConstraintComponentBase(int bodies)
Parameters
bodiesint
Fields
Logger
protected static Logger Logger
Field Value
Properties
Attached
Whether this constraint is in a valid state and actively constraining its targets.
public abstract bool Attached { get; }
Property Value
Remarks
May not be attached if it is not in a scene, when not Enabled, when any of its target is null, not in a scene or in a different simulation
Bodies
public ReadOnlySpan<BodyComponent?> Bodies { get; }
Property Value
Enabled
public bool Enabled { get; set; }
Property Value
this[int]
protected BodyComponent? this[int i] { get; set; }
Parameters
iint
Property Value
Methods
BodiesChanged()
protected abstract void BodiesChanged()
GetAccumulatedForceMagnitude()
Returns the sum of all forces this constraint applied on the last tick
public abstract float GetAccumulatedForceMagnitude()
Returns
Remarks
This can be used to compare with a given motor constraints' MaximumForce property for example.
GetAccumulatedImpulseMagnitude()
Returns the sum of all impulses this constraint applied on the last tick
public abstract float GetAccumulatedImpulseMagnitude()
Returns
Remarks
Impulses increase depending on FixedTimeStep, as well as the amount of SolverSubStep. You may want to use GetAccumulatedForceMagnitude() instead.