Table of Contents

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 Vector3

Initial position of the first body.

b Vector3

Initial position of the second body.

c Vector3

Initial position of the third body.

springSettings SpringSettings

Spring settings to apply to the volume constraint.

Fields

SpringSettings

Spring frequency and damping parameters.

public SpringSettings SpringSettings

Field Value

SpringSettings

TargetScaledArea

2 times the target area of the triangle. Computed from ||ab x ac||.

public float TargetScaledArea

Field Value

float

Properties

ConstraintTypeId

Gets the type id of the constraint that this is a description of.

public static int ConstraintTypeId { get; }

Property Value

int

TypeProcessorType

Gets the type of the type batch which contains described constraints.

public static Type TypeProcessorType { get; }

Property Value

Type

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 TypeBatch

Batch to modify.

bundleIndex int

Index of the target constraint's bundle.

innerIndex int

Index 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 TypeBatch

Batch to read.

bundleIndex int

Index of the source constraint's bundle.

innerIndex int

Index of the source constraint within its bundle.

description AreaConstraint

Description of the constraint.

CreateTypeProcessor()

Creates a type processor for this constraint type.

public static TypeProcessor CreateTypeProcessor()

Returns

TypeProcessor