Namespace Stride.BepuPhysics.Constraints
Classes
- BallSocketConstraintComponent
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
- CenterDistanceConstraintComponent
Constrains the center of two bodies to be separated by a target distance. This constraint ensures that the distance between the center points of two bodies attempts to match a specific target value. Unlike DistanceServoConstraintComponent, this constraint operates directly on the body centers rather than on specific points on the bodies.
- CenterDistanceLimitConstraintComponent
Constrains the center of two bodies to be separated by a distance within a range. This constraint ensures that the distance between the center points of two bodies remains within a minimum and maximum range. Unlike DistanceLimitConstraintComponent, this constraint operates directly on the body centers rather than on specific points on the bodies.
- DistanceLimitConstraintComponent
Constrains points on two bodies to be separated by a distance within a specified range. This constraint ensures that the distance between two points on two bodies remains within a minimum and maximum range. It is useful for creating elastic or flexible connections between bodies, where the distance can vary within the specified limits.
- DistanceServoConstraintComponent
Constrains points on two bodies to be separated by a target distance using servo settings. This constraint attempts to maintain a specific distance between two points on two bodies by applying forces to reach the target distance. It uses servo settings to control the speed and force applied to achieve the target distance.
- OneBodyAngularServoConstraintComponent
Constrains a single body to a target orientation in space, controlling both rotation and tilt.
This constraint applies torque to make a body gradually align with a specific target orientation. It works like a spring system that pulls the body's orientation (rotation around any axis, including tilt) toward the specified target orientation.
Common uses include:
- Stabilizing objects to maintain a specific orientation
- Creating motorized joints that rotate/tilt objects to desired angles
- Simulating gyroscopic or magnetic orientation control
The spring and servo settings control how quickly and forcefully the body moves toward the target orientation.