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

#include <SolverBody.h>

Public Member Functions

 FSolverBody ()
 
void Reset ()
 
void SetImplicitVelocity (FReal Dt)
 Calculate and set the velocity and angular velocity from the net transform delta.
 
FSolverReal InvM () const
 Get the inverse mass.
 
void SetInvM (FReal InInvM)
 Set the inverse mass.
 
const FSolverMatrix33InvI () const
 Get the world-space inverse inertia.
 
void SetInvI (const FMatrix33 &InInvI)
 Set the world-space inverse inertia.
 
const FSolverVec3InvILocal () const
 Get the local-space inverse inertia (diagonal elements)
 
void SetInvILocal (const FVec3 &InInvILocal)
 Set the local-space inverse inertia (diagonal elements)
 
FRigidTransform3 CoMTransform () const
 The current CoM transform.
 
const FVec3X () const
 Pre-integration world-space center of mass position.
 
void SetX (const FVec3 &InX)
 
const FRotation3R () const
 Pre-integration world-space center of mass rotation.
 
void SetR (const FRotation3 &InR)
 
const FVec3P () const
 Predicted (post-integrate) world-space center of mass position.
 
void SetP (const FVec3 &InP)
 
const FRotation3Q () const
 Predicted (post-integrate) world-space center of mass rotation.
 
void SetQ (const FRotation3 &InQ)
 
const FSolverVec3V () const
 World-space center of mass velocity.
 
void SetV (const FVec3 &InV)
 
const FSolverVec3W () const
 World-space center of mass angular velocity.
 
void SetW (const FVec3 &InW)
 
const FVec3CoM () const
 
void SetCoM (const FVec3 &InCoM)
 
const FRotation3RoM () const
 
void SetRoM (const FRotation3 &InRoM)
 
const FSolverVec3DP () const
 Net world-space position displacement applied by the constraints.
 
void SetDP (const FSolverVec3 &InDP)
 
const FSolverVec3DQ () const
 Net world-space rotation displacement applied by the constraints (axis-angle vector equivalent to angular velocity but for position)
 
void SetDQ (const FSolverVec3 &InDQ)
 
const FSolverVec3CP () const
 Net world-space position correction applied by the constraints.
 
const FSolverVec3CQ () const
 Net world-space rotation correction applied by the constraints (axis-angle vector equivalent to angular velocity but for position)
 
FVec3 CorrectedP () const
 World-space position after applying the net correction DP()
 
FRotation3 CorrectedQ () const
 World-space rotation after applying the net correction DQ()
 
void ApplyCorrections ()
 Apply the accumulated position and rotation corrections to the predicted P and Q This is only used by unit tests that reuse solver bodies between ticks.
 
FVec3 ActorP () const
 Get the world-space Actor position.
 
FRotation3 ActorQ () const
 Get the world-space Actor rotation.
 
FVec3 CorrectedActorP () const
 Get the current world-space Actor position.
 
FRotation3 CorrectedActorQ () const
 Get the current world-space Actor rotation.
 
int32 Level () const
 Contact graph level. This is used in shock propagation to determine which of two bodies should have its inverse mass scaled.
 
void SetLevel (int32 InLevel)
 
bool IsDynamic () const
 Whether the body has a finite mass.
 
void ApplyTransformDelta (const FSolverVec3 &DP, const FSolverVec3 &DR)
 Apply a world-space position and rotation delta to the body center of mass, and update inverse mass.
 
void ApplyPositionDelta (const FSolverVec3 &DP)
 Apply a world-space position delta to the solver body center of mass.
 
void ApplyRotationDelta (const FSolverVec3 &DR)
 Apply a world-space rotation delta to the solver body and update the inverse mass.
 
void ApplyPositionCorrectionDelta (const FSolverVec3 &CP)
 Apply a world-space position correction delta to the solver body center of mass This will translate the body without introducing linear velocity.
 
void ApplyRotationCorrectionDelta (const FSolverVec3 &CR)
 Apply a world-space rotation correction delta to the solver body This will rotate the body without introducing angular velocity.
 
void ApplyVelocityDelta (const FSolverVec3 &DV, const FSolverVec3 &DW)
 Apply a world-space velocity delta to the solver body.
 
void ApplyLinearVelocityDelta (const FSolverVec3 &DV)
 Apply a world-space linear velocity delta to the solver body.
 
void ApplyAngularVelocityDelta (const FSolverVec3 &DW)
 Apply an world-space angular velocity delta to the solver body.
 
void EnforceShortestRotationTo (const FRotation3 &InQ)
 Update the rotation to be in the same hemisphere as the provided quaternion. This is used by joints with angular constraint/drives.
 
void UpdateRotationDependentState ()
 Update cached state that depends on rotation (i.e., world space inertia)
 
void PrefetchPositionSolverData () const
 
void PrefetchVelocitySolverData () const
 

Static Public Member Functions

static constexpr FSolverReal ZeroMassThreshold ()
 
static FSolverBody MakeInitialized ()
 
static FSolverBody MakeUninitialized ()
 

Detailed Description

Used by the constraint solver loop to cache all state for a particle and accumulate solver results. Uses a gather/scatter mechanism to read/write data to the particle SOAs at the beginning/end of the constraint solve. Constraint solver algorithms, and collision Update functions are implemented to use FSolverBody, and do not directly read/write to the particle handles. Constraint Solvers will modify P(), Q(), V() and W() via ApplyTransformDelta() and other methods.

There is one SolverBody for each particle in an island. Most constraint solvers will actually wrap the FSolverBody in FConstraintSolverBody, which allows us to apply per-constraint modifiers to the Solver Body.

Note
the X(), P(), R(), Q() accessors on FSolverBody return the Center of Mass positions and rotations, in contrast to the Particle methods which gives Actor positions and rotations. This is because the Constraint Solvers all calculate impulses and position corrections relative to the center of mass.

Constructor & Destructor Documentation

◆ FSolverBody()

Chaos::FSolverBody::FSolverBody ( )
inline

Create an empty solver body. All properties are uninitialized.

Member Function Documentation

◆ ActorP()

FVec3 Chaos::FSolverBody::ActorP ( ) const
inline

Get the world-space Actor position.

◆ ActorQ()

FRotation3 Chaos::FSolverBody::ActorQ ( ) const
inline

Get the world-space Actor rotation.

◆ ApplyAngularVelocityDelta()

void Chaos::FSolverBody::ApplyAngularVelocityDelta ( const FSolverVec3 DW)
inline

Apply an world-space angular velocity delta to the solver body.

◆ ApplyCorrections()

void Chaos::FSolverBody::ApplyCorrections ( )
inline

Apply the accumulated position and rotation corrections to the predicted P and Q This is only used by unit tests that reuse solver bodies between ticks.

◆ ApplyLinearVelocityDelta()

void Chaos::FSolverBody::ApplyLinearVelocityDelta ( const FSolverVec3 DV)
inline

Apply a world-space linear velocity delta to the solver body.

◆ ApplyPositionCorrectionDelta()

void Chaos::FSolverBody::ApplyPositionCorrectionDelta ( const FSolverVec3 CP)
inline

Apply a world-space position correction delta to the solver body center of mass This will translate the body without introducing linear velocity.

◆ ApplyPositionDelta()

void Chaos::FSolverBody::ApplyPositionDelta ( const FSolverVec3 DP)
inline

Apply a world-space position delta to the solver body center of mass.

◆ ApplyRotationCorrectionDelta()

void Chaos::FSolverBody::ApplyRotationCorrectionDelta ( const FSolverVec3 CR)
inline

Apply a world-space rotation correction delta to the solver body This will rotate the body without introducing angular velocity.

◆ ApplyRotationDelta()

void Chaos::FSolverBody::ApplyRotationDelta ( const FSolverVec3 DR)
inline

Apply a world-space rotation delta to the solver body and update the inverse mass.

◆ ApplyTransformDelta()

void Chaos::FSolverBody::ApplyTransformDelta ( const FSolverVec3 DP,
const FSolverVec3 DR 
)
inline

Apply a world-space position and rotation delta to the body center of mass, and update inverse mass.

◆ ApplyVelocityDelta()

void Chaos::FSolverBody::ApplyVelocityDelta ( const FSolverVec3 DV,
const FSolverVec3 DW 
)
inline

Apply a world-space velocity delta to the solver body.

◆ CoM()

const FVec3 & Chaos::FSolverBody::CoM ( ) const
inline

◆ CoMTransform()

FRigidTransform3 Chaos::FSolverBody::CoMTransform ( ) const
inline

The current CoM transform.

◆ CorrectedActorP()

FVec3 Chaos::FSolverBody::CorrectedActorP ( ) const
inline

Get the current world-space Actor position.

Note
This is recalculated from the current CoM transform including the accumulated position and rotation corrections.

◆ CorrectedActorQ()

FRotation3 Chaos::FSolverBody::CorrectedActorQ ( ) const
inline

Get the current world-space Actor rotation.

Note
This is recalculated from the current CoM transform including the accumulated position and rotation corrections.

◆ CorrectedP()

FVec3 Chaos::FSolverBody::CorrectedP ( ) const
inline

World-space position after applying the net correction DP()

Note
Calculated on demand from P() and DP() (only requires vector addition)

◆ CorrectedQ()

FRotation3 Chaos::FSolverBody::CorrectedQ ( ) const
inline

World-space rotation after applying the net correction DQ()

Note
Calculated on demand from Q() and DQ() (requires quaternion multiply and normalization)

◆ CP()

const FSolverVec3 & Chaos::FSolverBody::CP ( ) const
inline

Net world-space position correction applied by the constraints.

Note
This only includes correction terms that do not introduce linear velocity. The full solver displacement is given by DP

◆ CQ()

const FSolverVec3 & Chaos::FSolverBody::CQ ( ) const
inline

Net world-space rotation correction applied by the constraints (axis-angle vector equivalent to angular velocity but for position)

Note
This only includes correction terms that do not introduce angular velocity. The full solver angular displacement is given by DQ

◆ DP()

const FSolverVec3 & Chaos::FSolverBody::DP ( ) const
inline

Net world-space position displacement applied by the constraints.

◆ DQ()

const FSolverVec3 & Chaos::FSolverBody::DQ ( ) const
inline

Net world-space rotation displacement applied by the constraints (axis-angle vector equivalent to angular velocity but for position)

◆ EnforceShortestRotationTo()

void Chaos::FSolverBody::EnforceShortestRotationTo ( const FRotation3 InQ)
inline

Update the rotation to be in the same hemisphere as the provided quaternion. This is used by joints with angular constraint/drives.

◆ InvI()

const FSolverMatrix33 & Chaos::FSolverBody::InvI ( ) const
inline

Get the world-space inverse inertia.

◆ InvILocal()

const FSolverVec3 & Chaos::FSolverBody::InvILocal ( ) const
inline

Get the local-space inverse inertia (diagonal elements)

◆ InvM()

FSolverReal Chaos::FSolverBody::InvM ( ) const
inline

Get the inverse mass.

◆ IsDynamic()

bool Chaos::FSolverBody::IsDynamic ( ) const
inline

Whether the body has a finite mass.

Note
This is based on the current inverse mass, so a "dynamic" particle with 0 inverse mass will return true here.

◆ Level()

int32 Chaos::FSolverBody::Level ( ) const
inline

Contact graph level. This is used in shock propagation to determine which of two bodies should have its inverse mass scaled.

◆ MakeInitialized()

static FSolverBody Chaos::FSolverBody::MakeInitialized ( )
inlinestatic

A factory method to create a safely initialized Solverbody. The defaultconstructor assumes you are going to set all properties manually.

◆ MakeUninitialized()

static FSolverBody Chaos::FSolverBody::MakeUninitialized ( )
inlinestatic

Create an empty solver body. All properties are uninitialized.

◆ P()

const FVec3 & Chaos::FSolverBody::P ( ) const
inline

Predicted (post-integrate) world-space center of mass position.

Note
This does not get updated as we iterate
See also
DP(), CorrectedP()

◆ PrefetchPositionSolverData()

void Chaos::FSolverBody::PrefetchPositionSolverData ( ) const
inline

◆ PrefetchVelocitySolverData()

void Chaos::FSolverBody::PrefetchVelocitySolverData ( ) const
inline

◆ Q()

const FRotation3 & Chaos::FSolverBody::Q ( ) const
inline

Predicted (post-integrate) world-space center of mass rotation.

Note
This does not get updated as we iterate
See also
DQ(), CorrectedQ()

◆ R()

const FRotation3 & Chaos::FSolverBody::R ( ) const
inline

Pre-integration world-space center of mass rotation.

◆ Reset()

void Chaos::FSolverBody::Reset ( )
inline

Reset the solver accumulators

◆ RoM()

const FRotation3 & Chaos::FSolverBody::RoM ( ) const
inline

◆ SetCoM()

void Chaos::FSolverBody::SetCoM ( const FVec3 InCoM)
inline

◆ SetDP()

void Chaos::FSolverBody::SetDP ( const FSolverVec3 InDP)
inline

◆ SetDQ()

void Chaos::FSolverBody::SetDQ ( const FSolverVec3 InDQ)
inline

◆ SetImplicitVelocity()

void Chaos::FSolverBody::SetImplicitVelocity ( FReal  Dt)
inline

Calculate and set the velocity and angular velocity from the net transform delta.

◆ SetInvI()

void Chaos::FSolverBody::SetInvI ( const FMatrix33 InInvI)
inline

Set the world-space inverse inertia.

◆ SetInvILocal()

void Chaos::FSolverBody::SetInvILocal ( const FVec3 InInvILocal)
inline

Set the local-space inverse inertia (diagonal elements)

◆ SetInvM()

void Chaos::FSolverBody::SetInvM ( FReal  InInvM)
inline

Set the inverse mass.

◆ SetLevel()

void Chaos::FSolverBody::SetLevel ( int32  InLevel)
inline

◆ SetP()

void Chaos::FSolverBody::SetP ( const FVec3 InP)
inline

◆ SetQ()

void Chaos::FSolverBody::SetQ ( const FRotation3 InQ)
inline

◆ SetR()

void Chaos::FSolverBody::SetR ( const FRotation3 InR)
inline

◆ SetRoM()

void Chaos::FSolverBody::SetRoM ( const FRotation3 InRoM)
inline

◆ SetV()

void Chaos::FSolverBody::SetV ( const FVec3 InV)
inline

◆ SetW()

void Chaos::FSolverBody::SetW ( const FVec3 InW)
inline

◆ SetX()

void Chaos::FSolverBody::SetX ( const FVec3 InX)
inline

◆ UpdateRotationDependentState()

void Chaos::FSolverBody::UpdateRotationDependentState ( )

Update cached state that depends on rotation (i.e., world space inertia)

◆ V()

const FSolverVec3 & Chaos::FSolverBody::V ( ) const
inline

World-space center of mass velocity.

◆ W()

const FSolverVec3 & Chaos::FSolverBody::W ( ) const
inline

World-space center of mass angular velocity.

◆ X()

const FVec3 & Chaos::FSolverBody::X ( ) const
inline

Pre-integration world-space center of mass position.

◆ ZeroMassThreshold()

static constexpr FSolverReal Chaos::FSolverBody::ZeroMassThreshold ( )
inlinestaticconstexpr

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