UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::Private::FPBDCollisionSolverJacobi Class Reference

#include <PBDCollisionSolverJacobi.h>

Public Member Functions

 FPBDCollisionSolverJacobi ()
 
FORCEINLINE_DEBUGGABLE void Reset ()
 
FORCEINLINE_DEBUGGABLE void ResetManifold ()
 
FORCEINLINE_DEBUGGABLE int32 AddManifoldPoint ()
 
FORCEINLINE_DEBUGGABLE FSolverReal StaticFriction () const
 
FORCEINLINE_DEBUGGABLE FSolverReal DynamicFriction () const
 
FORCEINLINE_DEBUGGABLE FSolverReal VelocityFriction () const
 
FORCEINLINE_DEBUGGABLE void SetFriction (const FSolverReal InStaticFriction, const FSolverReal InDynamicFriction, const FSolverReal InVelocityFriction)
 
FORCEINLINE_DEBUGGABLE void SetStiffness (const FSolverReal InStiffness)
 
FORCEINLINE_DEBUGGABLE void SetSolverBodies (FSolverBody &SolverBody0, FSolverBody &SolverBody1)
 
FORCEINLINE_DEBUGGABLE int32 NumManifoldPoints () const
 
FORCEINLINE_DEBUGGABLE FSolverVec3 GetNetPushOut (const int32 ManifoldPointIndex) const
 
FORCEINLINE_DEBUGGABLE FSolverVec3 GetNetImpulse (const int32 ManifoldPointIndex) const
 
FORCEINLINE_DEBUGGABLE FSolverReal GetStaticFrictionRatio (const int32 ManifoldPointIndex) const
 
FORCEINLINE_DEBUGGABLE void SetManifoldPoint (const int32 ManifoldPointIndex, const FSolverVec3 &InRelativeContactPosition0, const FSolverVec3 &InRelativeContactPosition1, const FSolverVec3 &InWorldContactNormal, const FSolverVec3 &InWorldContactTangentU, const FSolverVec3 &InWorldContactTangentV, const FSolverReal InWorldContactDeltaNormal, const FSolverReal InWorldContactDeltaTangentU, const FSolverReal InWorldContactDeltaTangentV, const FSolverReal InWorldContactVelocityTargetNormal)
 
FORCEINLINE_DEBUGGABLE void InitManifoldPoint (const int32 ManifoldPointIndex, const FSolverVec3 &InRelativeContactPosition0, const FSolverVec3 &InRelativeContactPosition1, const FSolverVec3 &InWorldContactNormal, const FSolverVec3 &InWorldContactTangentU, const FSolverVec3 &InWorldContactTangentV, const FSolverReal InWorldContactDeltaNormal, const FSolverReal InWorldContactDeltaTangentU, const FSolverReal InWorldContactDeltaTangentV, const FSolverReal InWorldContactVelocityTargetNormal)
 
FORCEINLINE_DEBUGGABLE void FinalizeManifoldPoint (const int32 ManifoldPointIndex)
 
FORCEINLINE_DEBUGGABLE FConstraintSolverBodySolverBody0 ()
 Get the first (decorated) solver body The decorator add a possible mass scale.
 
FORCEINLINE_DEBUGGABLE const FConstraintSolverBodySolverBody0 () const
 
FORCEINLINE_DEBUGGABLE FConstraintSolverBodySolverBody1 ()
 Get the second (decorated) solver body The decorator add a possible mass scale.
 
FORCEINLINE_DEBUGGABLE const FConstraintSolverBodySolverBody1 () const
 
void EnablePositionShockPropagation ()
 Set up the mass scaling for shock propagation, using the position-phase mass scale.
 
void EnableVelocityShockPropagation ()
 Set up the mass scaling for shock propagation, using the velocity-phase mass scale.
 
void DisableShockPropagation ()
 Disable mass scaling.
 
FORCEINLINE_DEBUGGABLE bool SolvePositionNoFriction (const FSolverReal Dt, const FSolverReal MaxPushOut)
 Calculate and apply the position correction for this iteration.
 
FORCEINLINE_DEBUGGABLE bool SolvePositionWithFriction (const FSolverReal Dt, const FSolverReal MaxPushOut)
 
FORCEINLINE_DEBUGGABLE bool SolveVelocity (const FSolverReal Dt, const bool bApplyDynamicFriction)
 Calculate and apply the velocity correction for this iteration.
 

Static Public Member Functions

static FPBDCollisionSolverJacobi MakeInitialized ()
 
static FPBDCollisionSolverJacobi MakeUninitialized ()
 

Static Public Attributes

static const int32 MaxConstrainedBodies = 2
 
static const int32 MaxPointsPerConstraint = 4
 

Detailed Description

A Jocobi solver for the contact manifold between two shapes. This solves each manifold point independently and sums and dampens the net impulses before applying to the bodies.

Pros (vs Gauss Seidel):

  • If the contacts are symmetric, the impusles will be too. This fixed spurious rotations when a box with high restitution bounces exactly flat on the ground.
  • We can run the points in the manifold in parallel
  • Stacking is much more stable (but see below) Cons
  • We overestimate the impulse and must apply a damping factor to prevent energy gain. It is not clear how we select the value of this damping - it is empirically tuned.
  • The damping factor leads to spongey stacks/piles

Constructor & Destructor Documentation

◆ FPBDCollisionSolverJacobi()

Chaos::Private::FPBDCollisionSolverJacobi::FPBDCollisionSolverJacobi ( )
inline

Member Function Documentation

◆ AddManifoldPoint()

FORCEINLINE_DEBUGGABLE int32 Chaos::Private::FPBDCollisionSolverJacobi::AddManifoldPoint ( )
inline

◆ DisableShockPropagation()

void Chaos::Private::FPBDCollisionSolverJacobi::DisableShockPropagation ( )

Disable mass scaling.

◆ DynamicFriction()

FORCEINLINE_DEBUGGABLE FSolverReal Chaos::Private::FPBDCollisionSolverJacobi::DynamicFriction ( ) const
inline

◆ EnablePositionShockPropagation()

void Chaos::Private::FPBDCollisionSolverJacobi::EnablePositionShockPropagation ( )

Set up the mass scaling for shock propagation, using the position-phase mass scale.

◆ EnableVelocityShockPropagation()

void Chaos::Private::FPBDCollisionSolverJacobi::EnableVelocityShockPropagation ( )

Set up the mass scaling for shock propagation, using the velocity-phase mass scale.

◆ FinalizeManifoldPoint()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::FinalizeManifoldPoint ( const int32  ManifoldPointIndex)
inline

Finish manifold point setup. NOTE: Can only be called after the InitManifoldPoint has been called

◆ GetNetImpulse()

FORCEINLINE_DEBUGGABLE FSolverVec3 Chaos::Private::FPBDCollisionSolverJacobi::GetNetImpulse ( const int32  ManifoldPointIndex) const
inline

◆ GetNetPushOut()

FORCEINLINE_DEBUGGABLE FSolverVec3 Chaos::Private::FPBDCollisionSolverJacobi::GetNetPushOut ( const int32  ManifoldPointIndex) const
inline

◆ GetStaticFrictionRatio()

FORCEINLINE_DEBUGGABLE FSolverReal Chaos::Private::FPBDCollisionSolverJacobi::GetStaticFrictionRatio ( const int32  ManifoldPointIndex) const
inline

◆ InitManifoldPoint()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::InitManifoldPoint ( const int32  ManifoldPointIndex,
const FSolverVec3 InRelativeContactPosition0,
const FSolverVec3 InRelativeContactPosition1,
const FSolverVec3 InWorldContactNormal,
const FSolverVec3 InWorldContactTangentU,
const FSolverVec3 InWorldContactTangentV,
const FSolverReal  InWorldContactDeltaNormal,
const FSolverReal  InWorldContactDeltaTangentU,
const FSolverReal  InWorldContactDeltaTangentV,
const FSolverReal  InWorldContactVelocityTargetNormal 
)
inline

◆ MakeInitialized()

static FPBDCollisionSolverJacobi Chaos::Private::FPBDCollisionSolverJacobi::MakeInitialized ( )
inlinestatic

◆ MakeUninitialized()

static FPBDCollisionSolverJacobi Chaos::Private::FPBDCollisionSolverJacobi::MakeUninitialized ( )
inlinestatic

◆ NumManifoldPoints()

FORCEINLINE_DEBUGGABLE int32 Chaos::Private::FPBDCollisionSolverJacobi::NumManifoldPoints ( ) const
inline

◆ Reset()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::Reset ( )
inline

Reset the state of the collision solver

◆ ResetManifold()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::ResetManifold ( )
inline

◆ SetFriction()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::SetFriction ( const FSolverReal  InStaticFriction,
const FSolverReal  InDynamicFriction,
const FSolverReal  InVelocityFriction 
)
inline

◆ SetManifoldPoint()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::SetManifoldPoint ( const int32  ManifoldPointIndex,
const FSolverVec3 InRelativeContactPosition0,
const FSolverVec3 InRelativeContactPosition1,
const FSolverVec3 InWorldContactNormal,
const FSolverVec3 InWorldContactTangentU,
const FSolverVec3 InWorldContactTangentV,
const FSolverReal  InWorldContactDeltaNormal,
const FSolverReal  InWorldContactDeltaTangentU,
const FSolverReal  InWorldContactDeltaTangentV,
const FSolverReal  InWorldContactVelocityTargetNormal 
)
inline

Set up a manifold point (also calls FinalizeManifoldPoint)

◆ SetSolverBodies()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::SetSolverBodies ( FSolverBody SolverBody0,
FSolverBody SolverBody1 
)
inline

◆ SetStiffness()

FORCEINLINE_DEBUGGABLE void Chaos::Private::FPBDCollisionSolverJacobi::SetStiffness ( const FSolverReal  InStiffness)
inline

◆ SolvePositionNoFriction()

FORCEINLINE_DEBUGGABLE bool Chaos::Private::FPBDCollisionSolverJacobi::SolvePositionNoFriction ( const FSolverReal  Dt,
const FSolverReal  MaxPushOut 
)
inline

Calculate and apply the position correction for this iteration.

Returns
true if we need to run more iterations, false if we did not apply any correction

◆ SolvePositionWithFriction()

FORCEINLINE_DEBUGGABLE bool Chaos::Private::FPBDCollisionSolverJacobi::SolvePositionWithFriction ( const FSolverReal  Dt,
const FSolverReal  MaxPushOut 
)
inline

◆ SolverBody0() [1/2]

FORCEINLINE_DEBUGGABLE FConstraintSolverBody & Chaos::Private::FPBDCollisionSolverJacobi::SolverBody0 ( )
inline

Get the first (decorated) solver body The decorator add a possible mass scale.

◆ SolverBody0() [2/2]

FORCEINLINE_DEBUGGABLE const FConstraintSolverBody & Chaos::Private::FPBDCollisionSolverJacobi::SolverBody0 ( ) const
inline

◆ SolverBody1() [1/2]

FORCEINLINE_DEBUGGABLE FConstraintSolverBody & Chaos::Private::FPBDCollisionSolverJacobi::SolverBody1 ( )
inline

Get the second (decorated) solver body The decorator add a possible mass scale.

◆ SolverBody1() [2/2]

FORCEINLINE_DEBUGGABLE const FConstraintSolverBody & Chaos::Private::FPBDCollisionSolverJacobi::SolverBody1 ( ) const
inline

◆ SolveVelocity()

FORCEINLINE_DEBUGGABLE bool Chaos::Private::FPBDCollisionSolverJacobi::SolveVelocity ( const FSolverReal  Dt,
const bool  bApplyDynamicFriction 
)
inline

Calculate and apply the velocity correction for this iteration.

Returns
true if we need to run more iterations, false if we did not apply any correction

◆ StaticFriction()

FORCEINLINE_DEBUGGABLE FSolverReal Chaos::Private::FPBDCollisionSolverJacobi::StaticFriction ( ) const
inline

◆ VelocityFriction()

FORCEINLINE_DEBUGGABLE FSolverReal Chaos::Private::FPBDCollisionSolverJacobi::VelocityFriction ( ) const
inline

Member Data Documentation

◆ MaxConstrainedBodies

const int32 Chaos::Private::FPBDCollisionSolverJacobi::MaxConstrainedBodies = 2
static

◆ MaxPointsPerConstraint

const int32 Chaos::Private::FPBDCollisionSolverJacobi::MaxPointsPerConstraint = 4
static

The documentation for this class was generated from the following files: