Struct AreaConstraint
- Namespace
- BepuPhysics.Constraints
- Assembly
- BepuPhysics.dll
Constrains the area of a triangle connecting the centers of three bodies to match a goal area. Scaled volume computed from ||ab x ac||.
public struct AreaConstraint : IThreeBodyConstraintDescription<AreaConstraint>, IConstraintDescription<AreaConstraint>
- Implements
- Inherited Members
Constructors
AreaConstraint(Vector3, Vector3, Vector3, SpringSettings)
Creates a new area constraint, initializing the target area using a set of initial positions.
public AreaConstraint(Vector3 a, Vector3 b, Vector3 c, SpringSettings springSettings)
Parameters
a
Vector3Initial position of the first body.
b
Vector3Initial position of the second body.
c
Vector3Initial position of the third body.
springSettings
SpringSettingsSpring settings to apply to the volume constraint.
Fields
SpringSettings
Spring frequency and damping parameters.
public SpringSettings SpringSettings
Field Value
TargetScaledArea
2 times the target area of the triangle. Computed from ||ab x ac||.
public float TargetScaledArea
Field Value
Properties
ConstraintTypeId
Gets the type id of the constraint that this is a description of.
public static int ConstraintTypeId { get; }
Property Value
TypeProcessorType
Gets the type of the type batch which contains described constraints.
public static Type TypeProcessorType { get; }
Property Value
Methods
ApplyDescription(ref TypeBatch, int, int)
Changes the batch-held memory at a given location to match the given description.
public readonly void ApplyDescription(ref TypeBatch batch, int bundleIndex, int innerIndex)
Parameters
batch
TypeBatchBatch to modify.
bundleIndex
intIndex of the target constraint's bundle.
innerIndex
intIndex of the target constraint within its bundle.
BuildDescription(ref TypeBatch, int, int, out AreaConstraint)
Creates a description from the batch-held memory at a given location.
public static void BuildDescription(ref TypeBatch batch, int bundleIndex, int innerIndex, out AreaConstraint description)
Parameters
batch
TypeBatchBatch to read.
bundleIndex
intIndex of the source constraint's bundle.
innerIndex
intIndex of the source constraint within its bundle.
description
AreaConstraintDescription of the constraint.
CreateTypeProcessor()
Creates a type processor for this constraint type.
public static TypeProcessor CreateTypeProcessor()