Table of Contents

Class BallSocketConstraintComponent

Namespace
Stride.BepuPhysics.Constraints
Assembly
Stride.BepuPhysics.dll

Creates a spherical joint (also known as a ball and socket joint) that constrains two bodies to share a connection point.

This constraint keeps a specific point on body A (defined by LocalOffsetA) coincident with a specific point on body B (defined by LocalOffsetB), while still allowing full rotational freedom around the connection point.

Common uses include:

  • Character joint connections (shoulders, hips, etc.)
  • Chain links
  • Pendulums
  • Rag doll physics
  • Cloth and soft body simulation
[DataContract]
[DefaultEntityComponentProcessor(typeof(ConstraintProcessor), ExecutionMode = ExecutionMode.Runtime)]
[ComponentCategory("Physics - Bepu Constraint")]
public sealed class BallSocketConstraintComponent : TwoBodyConstraintComponent<BallSocket>, IIdentifiable
Inheritance
BallSocketConstraintComponent
Implements
Inherited Members

Constructors

BallSocketConstraintComponent()

public BallSocketConstraintComponent()

Properties

LocalOffsetA

Offset from the center of body A to its attachment in A's local space.

public Vector3 LocalOffsetA { get; set; }

Property Value

Vector3

LocalOffsetB

Offset from the center of body B to its attachment in B's local space.

public Vector3 LocalOffsetB { get; set; }

Property Value

Vector3

SpringDampingRatio

Gets or sets the ratio of the spring's actual damping to its critical damping. 0 is undamped, 1 is critically damped, and higher values are overdamped. Higher damping ratios reduce oscillations and make the connection less elastic.

public float SpringDampingRatio { get; set; }

Property Value

float

SpringFrequency

Gets or sets the target number of undamped oscillations per unit of time. Higher frequency values create stiffer connections, while lower values allow more elasticity in the joint.

public float SpringFrequency { get; set; }

Property Value

float