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

Functions

FReal GetSolverPhysicsResultsTime (const FPhysicsSolverBase *Solver)
 
FVec3 GetAngularVelocityAdjustedForGyroscopicTorques (const FRotation3 &Q, const FVec3 &I, const FVec3 &W, const FReal Dt)
 
template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(autoCastHelper (const FImplicitObject &Geom, const Lambda &Func)
 
template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(autoCastHelper (const FImplicitObject &Geom, const FRigidTransform3 &TM, const Lambda &Func)
 
template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(autoCastHelperNoUnwrap (const FImplicitObject &Geom, const FRigidTransform3 &TM, const Lambda &Func)
 
template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(autoCastHelperNoUnwrap (const FImplicitObject &Geom, const FRigidTransform3 &TM0, const FRigidTransform3 &TM1, const Lambda &Func)
 
const FImplicitObjectImplicitChildHelper (const FImplicitObject *ImplicitObject)
 
template<typename T , typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(autoCastWrapped (const FImplicitObject &A, const Lambda &Func)
 Given an ImplicitObject known to be of type T or a wrapper around T, call the Lambda with the concrete type which will be const T*, const TImplicitObjectInstanced<T>*, or const TImplicitObjectScaled<T>*.
 
template<typename Lambda , bool bRootObject>
FORCEINLINE_DEBUGGABLE void VisitConcreteObjectsImpl (const FImplicitObject &Geom, const Lambda &Func, int32 RootObjectIndex)
 
template<typename Lambda >
FORCEINLINE_DEBUGGABLE void VisitConcreteObjects (const FImplicitObject &Geom, const Lambda &Func)
 Similar to FImplicitObject::VisitLeafObjects, but provides only the root object index (ie, the index into a particle's ShapeInstance array) and the concrete type of the leaf object. This is useful to avoid requiring users to write lambdas inside lambdas or do manual type checking if all the caller wants to do is perform some operation on each of the underlying geometries.
 
void GetTetFaces (const FIntVector4 &Tet, FIntVector3 &Face1, FIntVector3 &Face2, FIntVector3 &Face3, FIntVector3 &Face4, const bool invert)
 
int32 GetMin (const FIntVector3 &V)
 
int32 GetMid (const FIntVector3 &V)
 
int32 GetMax (const FIntVector3 &V)
 
FIntVector3 GetOrdered (const FIntVector3 &V)
 
FIntVector4 GetOrdered (const FIntVector4 &V)
 
void GetSurfaceElements (const TArray< FIntVector4 > &Tets, TArray< FIntVector3 > &SurfaceElements, const bool KeepInteriorFaces=false, const bool InvertFaces=false)
 
void FindClosestTriangle (const TArray< TVector< FRealSingle, 3 > > &Positions, const TArray< FIntVector3 > &SurfaceElements, const TArray< TVector< FRealSingle, 3 > > &TrianglePositions, TArray< int32 > &SurfaceTriangleIndices, TArray< TVector< FRealSingle, 3 > > &BarycentricWeights, const FRealSingle BoxSize=FRealSingle(10.))
 
template<typename TRealType >
TRealType SignedSquare (TRealType A)
 
template<class TINT = uint64>
TINT Factorial (TINT Num)
 Take the factorial of Num, which should be of integral type.
 
template<class TINT = uint64>
TINT NChooseR (const TINT N, const TINT R)
 Number of ways to choose of R elements from a set of size N, with no repetitions.
 
template<class TINT = uint64>
TINT NPermuteR (const TINT N, const TINT R)
 Number of ways to choose of R elements from a set of size N, with repetitions.
 
template<class T , class TARRAY = TArray<T>>
void GetMinAvgMax (const TARRAY &Values, T &MinV, double &AvgV, T &MaxV)
 Compute the minimum, average, and maximum values of Values.
 
template<class T , class TARRAY = TArray<T>>
GetAverage (const TARRAY &Values)
 Compute the average value.
 
template<class T , class TARRAY = TArray<T>>
GetVariance (const TARRAY &Values, const T Avg)
 Compute the variance of Values, given the average value of Avg.
 
template<class T , class TARRAY = TArray<T>>
GetVariance (const TARRAY &Values)
 Compute the variance of Values (computes their average on the fly).
 
template<class T , class TARRAY = TArray<T>>
GetStandardDeviation (const TARRAY &Values, const T Avg)
 Compute the standard deviation of Values, given the average value of Avg.
 
template<class T , class TARRAY = TArray<T>>
GetStandardDeviation (const TARRAY &Values)
 Compute the standard deviation of Values (computes their average on the fly).
 
template<class T >
GetStandardDeviation (const T Variance)
 Compute the standard deviation from Variance.
 
FMatrix33 Multiply (const FMatrix33 &L, const FMatrix33 &R)
 
FMatrix44 Multiply (const FMatrix44 &L, const FMatrix44 &R)
 
FMatrix33 MultiplyAB (const FMatrix33 &LIn, const FMatrix33 &RIn)
 
FMatrix33 MultiplyABt (const FMatrix33 &L, const FMatrix33 &R)
 
FMatrix33 MultiplyAtB (const FMatrix33 &L, const FMatrix33 &R)
 
FVec3 Multiply (const FMatrix33 &L, const FVec3 &R)
 
TVec3< FRealSingleMultiply (const TMatrix33< FRealSingle > &L, const TVec3< FRealSingle > &R)
 
FVec4 Multiply (const FMatrix44 &L, const FVec4 &R)
 
bool Solve (FVec3 &X, const FMatrix33 &A, const FVec3 &B)
 
FRigidTransform3 Multiply (const FRigidTransform3 L, const FRigidTransform3 &R)
 
FMatrix33 ComputeWorldSpaceInertia (const FRotation3 &CoMRotation, const FMatrix33 &I)
 
FMatrix33 ComputeWorldSpaceInertia (const FRotation3 &CoMRotation, const FVec3 &I)
 
template<class T >
PMatrix< T, 3, 3 > ComputeJointFactorMatrix (const TVec3< T > &V, const PMatrix< T, 3, 3 > &M, const T &Im)
 
template<class T >
TVec3< T > ComputeDiagonalJointFactorMatrix (const TVec3< T > &V, const PMatrix< T, 3, 3 > &M, const T &Im)
 
template<typename T >
bool IntersectLineSegments2D (const TVec2< T > &InStartA, const TVec2< T > &InEndA, const TVec2< T > &InStartB, const TVec2< T > &InEndB, T &OutTA, T &OutTB)
 
bool ClipLineSegmentToPlane (FVec3 &V0, FVec3 &V1, const FVec3 &PlaneNormal, const FVec3 &PlanePos)
 
bool ClipLineSegmentToAxisAlignedPlane (FVec3 &V0, FVec3 &V1, const int32 AxisIndex, const FReal PlaneDir, const FReal PlanePos)
 
void ProjectPointOntoAxisAlignedPlane (FVec3 &V, const FVec3 &Dir, int32 AxisIndex, FReal PlaneDir, FReal PlanePos)
 
bool ProjectPointOntoAxisAlignedPlaneSafe (FVec3 &V, const FVec3 &Dir, int32 AxisIndex, FReal PlaneDir, FReal PlanePos, FReal Epsilon)
 
bool NormalizeSafe (FVec3 &V, FReal EpsilonSq=UE_SMALL_NUMBER)
 
template<class T >
DotProduct (const TArray< T > &X, const TArray< T > &Y)
 
template<typename T >
TVec3< T > ScaleInertia (const TVec3< T > &Inertia, const TVec3< T > &Scale, const bool bScaleMass)
 
FMatrix33 ScaleInertia (const FMatrix33 &Inertia, const FVec3 &Scale, const bool bScaleMass)
 
bool BoxFromInertia (const FVec3 &InInertia, const FReal Mass, FVec3 &OutCenter, FVec3 &OutSize)
 
int32 WrapIndex (int32 V, int32 Begin, int32 End)
 
void NearestPointsOnLineSegments (const FVec3 &P1, const FVec3 &Q1, const FVec3 &P2, const FVec3 &Q2, FReal &S, FReal &T, FVec3 &C1, FVec3 &C2, const FReal Epsilon=1.e-4f)
 
void NearestPointsOnLineSegmentToLine (const FVec3 &SegmentBegin, const FVec3 &SegmentEnd, const FVec3 &LinePos, const FVec3 &LineVector, FReal &S, FReal &T, FVec3 &C1, FVec3 &C2, const FReal Epsilon=1.e-4f)
 
template<typename T >
ClosestTimeOnLineSegment (const TVec3< T > &Point, const TVec3< T > &StartPoint, const TVec3< T > &EndPoint)
 
template<typename T >
RaySphereIntersectionDistance (const TVec3< T > &RayStart, const TVec3< T > &RayDir, const TVec3< T > &SpherePos, const T SphereRadius)
 The distance from Start to the sphere along the vector Dir. Returns numeric max if no intersection.
 
template<typename T >
AsinEst1 (const T X)
 
template<typename T >
AsinEst3 (const T X)
 
template<typename T >
AsinEst5 (const T X)
 
template<typename T >
AsinEst7 (const T X)
 
template<typename T , int Order = 5>
AsinEst (const T X)
 
template<typename T , int Order = 5>
AsinEstCrossover (const T X, const T Crossover=T(0.7))
 
template<class T , class TV , class TV_INT4 >
void TetMeshFromGrid (const TUniformGrid< T, 3 > &Grid, TArray< TV_INT4 > &Mesh, TArray< TV > &X)
 Generate a tetrahedral mesh from a Freudenthal lattice defined on a 3 dimensional grid.
 
template<int d>
TArray< TArray< int > > ComputeIncidentElements (const TArray< TVector< int32, d > > &Mesh, TArray< TArray< int32 > > *LocalIndex=nullptr)
 
void DFS_iterative (const TArray< TArray< int32 > > &L, int32 v, TArray< bool > &visited, TArray< int32 > &component)
 
void ConnectedComponentsDFSIterative (const TArray< TArray< int32 > > &L, TArray< TArray< int32 > > &C)
 
void FindConnectedRegions (const TArray< FIntVector4 > &Elements, TArray< TArray< int32 > > &ConnectedComponents)
 
void FindConnectedRegions (const TArray< FIntVector3 > &Elements, TArray< TArray< int32 > > &ConnectedComponents)
 
TArray< int32ComputeBoundaryNodes (const TArray< TVec3< int32 > > &TriangleMesh)
 
TArray< TArray< int32 > > ComputeIncidentElements (const TArray< TArray< int32 > > &Constraints, TArray< TArray< int32 > > *LocalIndex=nullptr)
 
void MergeIncidentElements (const TArray< TArray< int32 > > &ExtraIncidentElements, const TArray< TArray< int32 > > &ExtraIncidentElementsLocal, TArray< TArray< int32 > > &IncidentElements, TArray< TArray< int32 > > &IncidentElementsLocal)
 
FIntVector3 SortFIntVector3 (FIntVector3 &V)
 
FIntVector3 TetFace (int32 f)
 
template<typename Func1 , typename Func2 >
TArray< FIntVector2ComputeMeshFacePairs (const TArray< FIntVector4 > &Mesh, Func1 GreaterThan, Func2 Equal)
 
TArray< FIntVector2ComputeTetMeshFacePairs (const TArray< FIntVector4 > &TetMesh)
 
TArray< TArray< FVector3f > > RandomPointsInTet (const TArray< FVector3f > &x, const TArray< FIntVector4 > &TetMesh, const TArray< int32 > &SampleElements, int32 NumRandomPointsPerElement=1)
 

Function Documentation

◆ AsinEst()

template<typename T , int Order = 5>
T Chaos::Utilities::AsinEst ( const T  X)
inline

Approximate Asin using expansion to the specified Order (must be 1, 3, 5, or 7). Defaults to 5th order.

◆ AsinEst1()

template<typename T >
T Chaos::Utilities::AsinEst1 ( const T  X)
inline

Approximate Asin(X) to 1st order ~= X + ... Returns an approximation for all valid input range [-1, 1] with an error that increases as the input magnitude approaches 1.

◆ AsinEst3()

template<typename T >
T Chaos::Utilities::AsinEst3 ( const T  X)
inline

Approximate Asin(X) to 3rd order ~= X + (1/6)X^3 + ... Returns an approximation for all valid input range [-1, 1] with an error that increases as the input magnitude approaches 1.

◆ AsinEst5()

template<typename T >
T Chaos::Utilities::AsinEst5 ( const T  X)
inline

Approximate Asin(X) to 5th order ~= X + (1/6)X^3 + (3/40)X^5 + ... Returns an approximation for all valid input range [-1, 1] with an error that increases as the input magnitude approaches 1.

◆ AsinEst7()

template<typename T >
T Chaos::Utilities::AsinEst7 ( const T  X)
inline

Approximate Asin(X) to 7th order ~= X + (1/6)X^3 + (3/40)X^5 + (15/336)X^7 + ... Returns an approximation for all valid input range [-1, 1] with an error that increases as the input magnitude approaches 1.

◆ AsinEstCrossover()

template<typename T , int Order = 5>
T Chaos::Utilities::AsinEstCrossover ( const T  X,
const T  Crossover = T(0.7) 
)
inline

Approximate Asin(X). Like AsinApprox but with a crossover to FMath::Asin for larger input magnitudes.

◆ BoxFromInertia()

bool Chaos::Utilities::BoxFromInertia ( const FVec3 InInertia,
const FReal  Mass,
FVec3 OutCenter,
FVec3 OutSize 
)
inline

◆ CastHelper() [1/2]

template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(auto) Chaos::Utilities::CastHelper ( const FImplicitObject Geom,
const FRigidTransform3 TM,
const Lambda &  Func 
)

◆ CastHelper() [2/2]

template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(auto) Chaos::Utilities::CastHelper ( const FImplicitObject Geom,
const Lambda &  Func 
)

◆ CastHelperNoUnwrap() [1/2]

template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(auto) Chaos::Utilities::CastHelperNoUnwrap ( const FImplicitObject Geom,
const FRigidTransform3 TM,
const Lambda &  Func 
)

◆ CastHelperNoUnwrap() [2/2]

template<typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(auto) Chaos::Utilities::CastHelperNoUnwrap ( const FImplicitObject Geom,
const FRigidTransform3 TM0,
const FRigidTransform3 TM1,
const Lambda &  Func 
)

◆ CastWrapped()

template<typename T , typename Lambda >
FORCEINLINE_DEBUGGABLE decltype(auto) Chaos::Utilities::CastWrapped ( const FImplicitObject A,
const Lambda &  Func 
)

Given an ImplicitObject known to be of type T or a wrapper around T, call the Lambda with the concrete type which will be const T*, const TImplicitObjectInstanced<T>*, or const TImplicitObjectScaled<T>*.

◆ ClipLineSegmentToAxisAlignedPlane()

bool Chaos::Utilities::ClipLineSegmentToAxisAlignedPlane ( FVec3 V0,
FVec3 V1,
const int32  AxisIndex,
const FReal  PlaneDir,
const FReal  PlanePos 
)
inline

Clip a line segment to the inside of an axis aligned plane (normal pointing outwards).

◆ ClipLineSegmentToPlane()

bool Chaos::Utilities::ClipLineSegmentToPlane ( FVec3 V0,
FVec3 V1,
const FVec3 PlaneNormal,
const FVec3 PlanePos 
)
inline

Clip a line segment to inside a plane (plane normal pointing outwards).

Returns
false if the line is completely outside the plane, true otherwise.

◆ ClosestTimeOnLineSegment()

template<typename T >
T Chaos::Utilities::ClosestTimeOnLineSegment ( const TVec3< T > &  Point,
const TVec3< T > &  StartPoint,
const TVec3< T > &  EndPoint 
)
inline

◆ ComputeBoundaryNodes()

TArray< int32 > Chaos::Utilities::ComputeBoundaryNodes ( const TArray< TVec3< int32 > > &  TriangleMesh)
inline

◆ ComputeDiagonalJointFactorMatrix()

template<class T >
TVec3< T > Chaos::Utilities::ComputeDiagonalJointFactorMatrix ( const TVec3< T > &  V,
const PMatrix< T, 3, 3 > &  M,
const T &  Im 
)

Calculate the matrix diagonal that maps a constraint position error to constraint position and rotation corrections.

◆ ComputeIncidentElements() [1/2]

TArray< TArray< int32 > > Chaos::Utilities::ComputeIncidentElements ( const TArray< TArray< int32 > > &  Constraints,
TArray< TArray< int32 > > *  LocalIndex = nullptr 
)
inline

◆ ComputeIncidentElements() [2/2]

template<int d>
TArray< TArray< int > > Chaos::Utilities::ComputeIncidentElements ( const TArray< TVector< int32, d > > &  Mesh,
TArray< TArray< int32 > > *  LocalIndex = nullptr 
)

◆ ComputeJointFactorMatrix()

template<class T >
PMatrix< T, 3, 3 > Chaos::Utilities::ComputeJointFactorMatrix ( const TVec3< T > &  V,
const PMatrix< T, 3, 3 > &  M,
const T &  Im 
)

Calculate the matrix that maps a constraint position error to constraint position and rotation corrections.

◆ ComputeMeshFacePairs()

template<typename Func1 , typename Func2 >
TArray< FIntVector2 > Chaos::Utilities::ComputeMeshFacePairs ( const TArray< FIntVector4 > &  Mesh,
Func1  GreaterThan,
Func2  Equal 
)

◆ ComputeTetMeshFacePairs()

TArray< FIntVector2 > Chaos::Utilities::ComputeTetMeshFacePairs ( const TArray< FIntVector4 > &  TetMesh)
inline

◆ ComputeWorldSpaceInertia() [1/2]

FMatrix33 Chaos::Utilities::ComputeWorldSpaceInertia ( const FRotation3 CoMRotation,
const FMatrix33 I 
)
inline

Calculate the world-space inertia (or inverse inertia) for a body with center-of-mass rotation "CoMRotation" and local-space inertia/inverse-inertia "I".

◆ ComputeWorldSpaceInertia() [2/2]

FMatrix33 Chaos::Utilities::ComputeWorldSpaceInertia ( const FRotation3 CoMRotation,
const FVec3 I 
)
inline

◆ ConnectedComponentsDFSIterative()

void Chaos::Utilities::ConnectedComponentsDFSIterative ( const TArray< TArray< int32 > > &  L,
TArray< TArray< int32 > > &  C 
)
inline

◆ DFS_iterative()

void Chaos::Utilities::DFS_iterative ( const TArray< TArray< int32 > > &  L,
int32  v,
TArray< bool > &  visited,
TArray< int32 > &  component 
)
inline

◆ DotProduct()

template<class T >
T Chaos::Utilities::DotProduct ( const TArray< T > &  X,
const TArray< T > &  Y 
)
inline

◆ Factorial()

template<class TINT = uint64>
TINT Chaos::Utilities::Factorial ( TINT  Num)

Take the factorial of Num, which should be of integral type.

◆ FindClosestTriangle()

void Chaos::Utilities::FindClosestTriangle ( const TArray< TVector< FRealSingle, 3 > > &  Positions,
const TArray< FIntVector3 > &  SurfaceElements,
const TArray< TVector< FRealSingle, 3 > > &  TrianglePositions,
TArray< int32 > &  SurfaceTriangleIndices,
TArray< TVector< FRealSingle, 3 > > &  BarycentricWeights,
const FRealSingle  BoxSize = FRealSingle(10.) 
)
inline

◆ FindConnectedRegions() [1/2]

void Chaos::Utilities::FindConnectedRegions ( const TArray< FIntVector3 > &  Elements,
TArray< TArray< int32 > > &  ConnectedComponents 
)
inline

◆ FindConnectedRegions() [2/2]

void Chaos::Utilities::FindConnectedRegions ( const TArray< FIntVector4 > &  Elements,
TArray< TArray< int32 > > &  ConnectedComponents 
)
inline

◆ GetAngularVelocityAdjustedForGyroscopicTorques()

FVec3 Chaos::Utilities::GetAngularVelocityAdjustedForGyroscopicTorques ( const FRotation3 Q,
const FVec3 I,
const FVec3 W,
const FReal  Dt 
)

◆ GetAverage()

template<class T , class TARRAY = TArray<T>>
T Chaos::Utilities::GetAverage ( const TARRAY Values)

Compute the average value.

◆ GetMax()

int32 Chaos::Utilities::GetMax ( const FIntVector3 V)
inline

◆ GetMid()

int32 Chaos::Utilities::GetMid ( const FIntVector3 V)
inline

◆ GetMin()

int32 Chaos::Utilities::GetMin ( const FIntVector3 V)
inline

◆ GetMinAvgMax()

template<class T , class TARRAY = TArray<T>>
void Chaos::Utilities::GetMinAvgMax ( const TARRAY Values,
T &  MinV,
double AvgV,
T &  MaxV 
)

Compute the minimum, average, and maximum values of Values.

◆ GetOrdered() [1/2]

FIntVector3 Chaos::Utilities::GetOrdered ( const FIntVector3 V)
inline

◆ GetOrdered() [2/2]

FIntVector4 Chaos::Utilities::GetOrdered ( const FIntVector4 V)
inline

◆ GetSolverPhysicsResultsTime()

CHAOS_API FReal Chaos::Utilities::GetSolverPhysicsResultsTime ( const FPhysicsSolverBase Solver)

◆ GetStandardDeviation() [1/3]

template<class T >
T Chaos::Utilities::GetStandardDeviation ( const T  Variance)

Compute the standard deviation from Variance.

◆ GetStandardDeviation() [2/3]

template<class T , class TARRAY = TArray<T>>
T Chaos::Utilities::GetStandardDeviation ( const TARRAY Values)

Compute the standard deviation of Values (computes their average on the fly).

◆ GetStandardDeviation() [3/3]

template<class T , class TARRAY = TArray<T>>
T Chaos::Utilities::GetStandardDeviation ( const TARRAY Values,
const T  Avg 
)

Compute the standard deviation of Values, given the average value of Avg.

◆ GetSurfaceElements()

void Chaos::Utilities::GetSurfaceElements ( const TArray< FIntVector4 > &  Tets,
TArray< FIntVector3 > &  SurfaceElements,
const bool  KeepInteriorFaces = false,
const bool  InvertFaces = false 
)
inline

◆ GetTetFaces()

void Chaos::Utilities::GetTetFaces ( const FIntVector4 Tet,
FIntVector3 Face1,
FIntVector3 Face2,
FIntVector3 Face3,
FIntVector3 Face4,
const bool  invert 
)
inline

◆ GetVariance() [1/2]

template<class T , class TARRAY = TArray<T>>
T Chaos::Utilities::GetVariance ( const TARRAY Values)

Compute the variance of Values (computes their average on the fly).

◆ GetVariance() [2/2]

template<class T , class TARRAY = TArray<T>>
T Chaos::Utilities::GetVariance ( const TARRAY Values,
const T  Avg 
)

Compute the variance of Values, given the average value of Avg.

◆ ImplicitChildHelper()

const FImplicitObject * Chaos::Utilities::ImplicitChildHelper ( const FImplicitObject ImplicitObject)
inline

◆ IntersectLineSegments2D()

template<typename T >
bool Chaos::Utilities::IntersectLineSegments2D ( const TVec2< T > &  InStartA,
const TVec2< T > &  InEndA,
const TVec2< T > &  InStartB,
const TVec2< T > &  InEndB,
T &  OutTA,
T &  OutTB 
)

Detects intersections between 2D line segments, returns intersection results as times along each line segment - these times can be used to calculate exact intersection locations

◆ MergeIncidentElements()

void Chaos::Utilities::MergeIncidentElements ( const TArray< TArray< int32 > > &  ExtraIncidentElements,
const TArray< TArray< int32 > > &  ExtraIncidentElementsLocal,
TArray< TArray< int32 > > &  IncidentElements,
TArray< TArray< int32 > > &  IncidentElementsLocal 
)
inline

◆ Multiply() [1/6]

FMatrix33 Chaos::Utilities::Multiply ( const FMatrix33 L,
const FMatrix33 R 
)
inline

Multiple two matrices: C = L.R

Note
This is the mathematically expected operator. FMatrix operator* calculates C = R.Transpose(L), so this is not equivalent to that.

◆ Multiply() [2/6]

FVec3 Chaos::Utilities::Multiply ( const FMatrix33 L,
const FVec3 R 
)
inline

Multiple a vector by a matrix: C = L.R If L is a rotation matrix, then this will return R rotated by that rotation.

◆ Multiply() [3/6]

FMatrix44 Chaos::Utilities::Multiply ( const FMatrix44 L,
const FMatrix44 R 
)
inline

◆ Multiply() [4/6]

FVec4 Chaos::Utilities::Multiply ( const FMatrix44 L,
const FVec4 R 
)
inline

◆ Multiply() [5/6]

FRigidTransform3 Chaos::Utilities::Multiply ( const FRigidTransform3  L,
const FRigidTransform3 R 
)
inline

Concatenate two transforms. This returns a transform that logically applies R then L.

◆ Multiply() [6/6]

TVec3< FRealSingle > Chaos::Utilities::Multiply ( const TMatrix33< FRealSingle > &  L,
const TVec3< FRealSingle > &  R 
)
inline

◆ MultiplyAB()

FMatrix33 Chaos::Utilities::MultiplyAB ( const FMatrix33 LIn,
const FMatrix33 RIn 
)
inline

◆ MultiplyABt()

FMatrix33 Chaos::Utilities::MultiplyABt ( const FMatrix33 L,
const FMatrix33 R 
)
inline

◆ MultiplyAtB()

FMatrix33 Chaos::Utilities::MultiplyAtB ( const FMatrix33 L,
const FMatrix33 R 
)
inline

◆ NChooseR()

template<class TINT = uint64>
TINT Chaos::Utilities::NChooseR ( const TINT  N,
const TINT  R 
)

Number of ways to choose of R elements from a set of size N, with no repetitions.

◆ NearestPointsOnLineSegments()

void Chaos::Utilities::NearestPointsOnLineSegments ( const FVec3 P1,
const FVec3 Q1,
const FVec3 P2,
const FVec3 Q2,
FReal S,
FReal T,
FVec3 C1,
FVec3 C2,
const FReal  Epsilon = 1.e-4f 
)
inline

◆ NearestPointsOnLineSegmentToLine()

void Chaos::Utilities::NearestPointsOnLineSegmentToLine ( const FVec3 SegmentBegin,
const FVec3 SegmentEnd,
const FVec3 LinePos,
const FVec3 LineVector,
FReal S,
FReal T,
FVec3 C1,
FVec3 C2,
const FReal  Epsilon = 1.e-4f 
)
inline

◆ NormalizeSafe()

bool Chaos::Utilities::NormalizeSafe ( FVec3 V,
FReal  EpsilonSq = UE_SMALL_NUMBER 
)
inline

◆ NPermuteR()

template<class TINT = uint64>
TINT Chaos::Utilities::NPermuteR ( const TINT  N,
const TINT  R 
)

Number of ways to choose of R elements from a set of size N, with repetitions.

◆ ProjectPointOntoAxisAlignedPlane()

void Chaos::Utilities::ProjectPointOntoAxisAlignedPlane ( FVec3 V,
const FVec3 Dir,
int32  AxisIndex,
FReal  PlaneDir,
FReal  PlanePos 
)
inline

Project a point V along direction Dir onto an axis aligned plane. /note Does not check for division by zero (Dir parallel to plane).

◆ ProjectPointOntoAxisAlignedPlaneSafe()

bool Chaos::Utilities::ProjectPointOntoAxisAlignedPlaneSafe ( FVec3 V,
const FVec3 Dir,
int32  AxisIndex,
FReal  PlaneDir,
FReal  PlanePos,
FReal  Epsilon 
)
inline

Project a point V along direction Dir onto an axis aligned plane. /return true if the point was successfully projected onto the plane; false if the direction is parallel to the plane.

◆ RandomPointsInTet()

TArray< TArray< FVector3f > > Chaos::Utilities::RandomPointsInTet ( const TArray< FVector3f > &  x,
const TArray< FIntVector4 > &  TetMesh,
const TArray< int32 > &  SampleElements,
int32  NumRandomPointsPerElement = 1 
)
inline

◆ RaySphereIntersectionDistance()

template<typename T >
T Chaos::Utilities::RaySphereIntersectionDistance ( const TVec3< T > &  RayStart,
const TVec3< T > &  RayDir,
const TVec3< T > &  SpherePos,
const T  SphereRadius 
)
inline

The distance from Start to the sphere along the vector Dir. Returns numeric max if no intersection.

◆ ScaleInertia() [1/2]

FMatrix33 Chaos::Utilities::ScaleInertia ( const FMatrix33 Inertia,
const FVec3 Scale,
const bool  bScaleMass 
)
inline

Given the local-space inertia for an unscaled object, return an inertia as if generated from a non-uniformly scaled shape with the specified scale. If bScaleMass is true, it also takes into account the fact that the mass would have changed by the increase in volume.

◆ ScaleInertia() [2/2]

template<typename T >
TVec3< T > Chaos::Utilities::ScaleInertia ( const TVec3< T > &  Inertia,
const TVec3< T > &  Scale,
const bool  bScaleMass 
)
inline

Given the local-space diagonal inertia for an unscaled object, return an inertia as if generated from a non-uniformly scaled shape with the specified scale. If bScaleMass is true, it also takes into account the fact that the mass would have changed by the increase in volume.

◆ SignedSquare()

template<typename TRealType >
TRealType Chaos::Utilities::SignedSquare ( TRealType  A)
inline

◆ Solve()

bool Chaos::Utilities::Solve ( FVec3 X,
const FMatrix33 A,
const FVec3 B 
)
inline

◆ SortFIntVector3()

FIntVector3 Chaos::Utilities::SortFIntVector3 ( FIntVector3 V)
inline

◆ TetFace()

FIntVector3 Chaos::Utilities::TetFace ( int32  f)
inline

◆ TetMeshFromGrid()

template<class T , class TV , class TV_INT4 >
void Chaos::Utilities::TetMeshFromGrid ( const TUniformGrid< T, 3 > &  Grid,
TArray< TV_INT4 > &  Mesh,
TArray< TV > &  X 
)

Generate a tetrahedral mesh from a Freudenthal lattice defined on a 3 dimensional grid.

◆ VisitConcreteObjects()

template<typename Lambda >
FORCEINLINE_DEBUGGABLE void Chaos::Utilities::VisitConcreteObjects ( const FImplicitObject Geom,
const Lambda &  Func 
)

Similar to FImplicitObject::VisitLeafObjects, but provides only the root object index (ie, the index into a particle's ShapeInstance array) and the concrete type of the leaf object. This is useful to avoid requiring users to write lambdas inside lambdas or do manual type checking if all the caller wants to do is perform some operation on each of the underlying geometries.

◆ VisitConcreteObjectsImpl()

template<typename Lambda , bool bRootObject>
FORCEINLINE_DEBUGGABLE void Chaos::Utilities::VisitConcreteObjectsImpl ( const FImplicitObject Geom,
const Lambda &  Func,
int32  RootObjectIndex 
)

◆ WrapIndex()

int32 Chaos::Utilities::WrapIndex ( int32  V,
int32  Begin,
int32  End 
)
inline