Navigation
API > API/Runtime > API/Runtime/Engine
Lightweight rigid body motion solver (no collision) used for cosmetic secondary motion in an animation graph without invoking something heavier like using PhysX to simulate constraints which could be cost prohibitive
| Name | FAnimPhys |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Animation/AnimPhysicsSolver.h |
| Include Path | #include "Animation/AnimPhysicsSolver.h" |
Syntax
class FAnimPhys
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AngularAccelerationAlpha | float | How much of the simulation frame's angular acceleration to pass onto the sim bodies. | Animation/AnimPhysicsSolver.h |
| bEnableDetailedStats | bool | Runtime CVar toggle for detailed/verbose profiling. | Animation/AnimPhysicsSolver.h |
| CentrifugalAlpha | float | How much of the centrifugal force to apply to the sim bodies. | Animation/AnimPhysicsSolver.h |
| CoriolisAlpha | float | How much of the coriolis force to apply to the sim bodies. | Animation/AnimPhysicsSolver.h |
| EulerAlpha | float | How much of the euler force to apply to the sim bodies. | Animation/AnimPhysicsSolver.h |
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ApplyImpulse
(
FAnimPhysRigidBody* InOutRigidBody, |
Apply an impulse to a body | Animation/AnimPhysicsSolver.h | |
static FVector CalculateCenterOfMass
(
const TArray< FVector >& InVertices, |
Calculates the center of mass of a shape | Animation/AnimPhysicsSolver.h | |
static FVector CalculateCenterOfMass
(
const TArray< FAnimPhysShape >& InShapes |
Calculates the centre of mass of a collection of shapes | Animation/AnimPhysicsSolver.h | |
static FMatrix CalculateInertia
(
const TArray< FVector >& InVertices, |
Calculate the inertia tensor of a shape | Animation/AnimPhysicsSolver.h | |
static FMatrix CalculateInertia
(
const TArray< FAnimPhysShape >& InShapes, |
Calculate the inertia tensor of a collection of shapes | Animation/AnimPhysicsSolver.h | |
static void CalculateNextPose
(
float DeltaTime, |
Using calculated linear and angular momentum, integrate the position and orientation of a body | Animation/AnimPhysicsSolver.h | |
static float CalculateVolume
(
const TArray< FAnimPhysShape >& InShapes |
Calculates the volume of a collection of shapes | Animation/AnimPhysicsSolver.h | |
static float CalculateVolume
(
const TArray< FVector >& InVertices, |
Calculates the volume of a shape | Animation/AnimPhysicsSolver.h | |
static void ConstrainAlongDirection
(
float DeltaTime, |
Constrain bodies along a provided axis | Animation/AnimPhysicsSolver.h | |
static void ConstrainAngularRange
(
float DeltaTime, |
Constraint two bodies together with angular limits, limiting the relative rotation between them. | Animation/AnimPhysicsSolver.h | |
static void ConstrainAngularRangeInternal
(
float DeltaTime, |
Internal version of constrain angular. | Animation/AnimPhysicsSolver.h | |
static void ConstrainConeAngle
(
float DeltaTime, |
Constraints the rotation between two bodies into a cone | Animation/AnimPhysicsSolver.h | |
static void ConstrainPlanar
(
float DeltaTime, |
Constrains the position of a body to one side of a plane placed at PlaneTransform (plane normal is Z axis) | Animation/AnimPhysicsSolver.h | |
static void ConstrainPositionNailed
(
float DeltaTime, |
Constrain bodies together as if fixed or nailed (linear only, bodies can still rotate) | Animation/AnimPhysicsSolver.h | |
static void ConstrainPositionPrismatic
(
float DeltaTime, |
Constrain bodies together with linear limits forming a box or prism around the constraint | Animation/AnimPhysicsSolver.h | |
static void ConstrainSphericalInner
(
float DeltaTime, |
Constrains the position of a body within the requested sphere | Animation/AnimPhysicsSolver.h | |
static void ConstrainSphericalOuter
(
float DeltaTime, |
Constrains the position of a body outside of the requested sphere | Animation/AnimPhysicsSolver.h | |
static void CreateSpring
(
TArray< FAnimPhysSpring >& SpringContainer, |
Spring creation methods. | Animation/AnimPhysicsSolver.h | |
static FQuat DiffQ
(
const FQuat& InOrientation, |
Calculate differentiated orientation quaternion | Animation/AnimPhysicsSolver.h | |
static void InitializeBodyVelocity
(
float DeltaTime, |
Initialize the velocity for a given body | Animation/AnimPhysicsSolver.h | |
static void PhysicsUpdate
(
float DeltaTime, |
Performs a physics update on the provided state objects | Animation/AnimPhysicsSolver.h | |
static void ScaleRigidBodyMass
(
FAnimPhysRigidBody* InOutRigidBody, |
Scale the mass and inertia properties of a rigid body | Animation/AnimPhysicsSolver.h | |
static FQuat UpdateOrientRK
(
const FQuat& InOrient, |
Perform an RK update of the provided orientation | Animation/AnimPhysicsSolver.h | |
static void UpdatePose
(
FAnimPhysRigidBody* InBody |
Update previous and current pose state | Animation/AnimPhysicsSolver.h |