UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::FConstraintContainerSolver Class Referenceabstract

#include <SolverConstraintContainer.h>

+ Inheritance diagram for Chaos::FConstraintContainerSolver:

Public Member Functions

 FConstraintContainerSolver (const int32 InPriority)
 
virtual ~FConstraintContainerSolver ()
 
void SetPriority (const int32 InPriority)
 
int32 GetPriority () const
 
virtual void Reset (const int32 MaxConstraints)=0
 
virtual int32 GetNumConstraints () const =0
 
virtual void AddConstraints ()=0
 
virtual void AddConstraints (const TArrayView< Private::FPBDIslandConstraint * > &Constraints)=0
 
virtual void AddBodies (FSolverBodyContainer &SolverBodyContainer)=0
 
virtual void GatherInput (const FReal Dt)=0
 
virtual void GatherInput (const FReal Dt, const int32 BeginIndex, const int32 EndIndex)=0
 
virtual void ScatterOutput (const FReal Dt)=0
 
virtual void ScatterOutput (const FReal Dt, const int32 BeginIndex, const int32 EndIndex)=0
 
virtual void PreApplyPositionConstraints (const FReal Dt)
 
virtual void PreApplyVelocityConstraints (const FReal Dt)
 
virtual void PreApplyProjectionConstraints (const FReal Dt)
 
virtual void ApplyPositionConstraints (const FReal Dt, const int32 It, const int32 NumIts)=0
 
virtual void ApplyVelocityConstraints (const FReal Dt, const int32 It, const int32 NumIts)=0
 
virtual void ApplyProjectionConstraints (const FReal Dt, const int32 It, const int32 NumIts)=0
 

Detailed Description

Base class for all the solver for a set of constraints of a specific type.

A SolverContainer is used to solve a set constraints in sequential order. There will be one solver container for each thread on which we solve constraints (see FPBDIslandConstraintGroupSolver). How constraints are assigned to groups depends on the constraint type and settings, but usually a group contains all constraints from one or more islands (unless we are coloring).

NOTE: there are two main use-case for FConstraintContainerSolver objects: the main physics scene and RBAN. The main scene uses the IslandManager to break the scene up into groups of constraints that can be solved in parallel (Islands). Those islands are then put into IslandGroups, and each IslandGroup is solved in a task, therefore we will have one FConstraintContainerSolver per type of constraint per IslandGroup. RBAN does not attempt to partition its scene into islands and just solves all constraints on its main thread, so it only has one FConstraintContainerSolver (per constraint type).

Constructor & Destructor Documentation

◆ FConstraintContainerSolver()

Chaos::FConstraintContainerSolver::FConstraintContainerSolver ( const int32  InPriority)
inline

◆ ~FConstraintContainerSolver()

virtual Chaos::FConstraintContainerSolver::~FConstraintContainerSolver ( )
inlinevirtual

Member Function Documentation

◆ AddBodies()

◆ AddConstraints() [1/2]

◆ AddConstraints() [2/2]

virtual void Chaos::FConstraintContainerSolver::AddConstraints ( const TArrayView< Private::FPBDIslandConstraint * > &  Constraints)
pure virtual

Island API. Add a set of constraints to the solver. This can be called multiple times: once for each island in an IslandGroup, but there will never be more constraints added than specified in Reset(). NOTE: this should not do any actual data gathering - it should just add to the list of constraints in this group. All data gathering is handled in GatherInput.

Implemented in Chaos::FPBDCollisionContainerSolver, Chaos::Private::FPBDCollisionContainerSolverJacobi, Chaos::Private::FPBDCollisionContainerSolverSimd, Chaos::Private::TABTestingConstraintContainerSolver< T1, T2 >, Chaos::TSimpleConstraintContainerSolver< ConstraintContainerType >, Chaos::Private::FCharacterGroundConstraintContainerSolver, Chaos::TIndexedConstraintContainerSolver< ConstraintContainerType >, and Chaos::Private::TPBDJointContainerSolver< JointSolverType >.

◆ ApplyPositionConstraints()

◆ ApplyProjectionConstraints()

◆ ApplyVelocityConstraints()

◆ GatherInput() [1/2]

◆ GatherInput() [2/2]

◆ GetNumConstraints()

◆ GetPriority()

int32 Chaos::FConstraintContainerSolver::GetPriority ( ) const
inline

Get the solver priority

◆ PreApplyPositionConstraints()

virtual void Chaos::FConstraintContainerSolver::PreApplyPositionConstraints ( const FReal  Dt)
inlinevirtual

◆ PreApplyProjectionConstraints()

virtual void Chaos::FConstraintContainerSolver::PreApplyProjectionConstraints ( const FReal  Dt)
inlinevirtual

◆ PreApplyVelocityConstraints()

virtual void Chaos::FConstraintContainerSolver::PreApplyVelocityConstraints ( const FReal  Dt)
inlinevirtual

◆ Reset()

virtual void Chaos::FConstraintContainerSolver::Reset ( const int32  MaxConstraints)
pure virtual

Set the maximum number of constraints the solver will have to handle. This will be called only once per tick, so containers resized here will not have to resize again this tick so that pointers to elements in the container will remain valid for the tick (but not beyond).

Implemented in Chaos::FPBDCollisionContainerSolver, Chaos::Private::FPBDCollisionContainerSolverJacobi, Chaos::Private::FPBDCollisionContainerSolverSimd, Chaos::Private::TPBDJointContainerSolver< JointSolverType >, Chaos::Private::FCharacterGroundConstraintContainerSolver, Chaos::Private::TABTestingConstraintContainerSolver< T1, T2 >, Chaos::TIndexedConstraintContainerSolver< ConstraintContainerType >, and Chaos::TSimpleConstraintContainerSolver< ConstraintContainerType >.

◆ ScatterOutput() [1/2]

◆ ScatterOutput() [2/2]

◆ SetPriority()

void Chaos::FConstraintContainerSolver::SetPriority ( const int32  InPriority)
inline

Set the solver priority. Solvers are sorted by priority. Lower values are solved first so solvers with higher priorty values with "win" over lower ones.

See also
FPBDConstraintGroupSolver

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