engine
 
载入中...
搜索中...
未找到
静态 Public 成员函数 | 所有成员列表
FAnimPhys类 参考

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 更多...

#include <AnimPhysicsSolver.h>

静态 Public 成员函数

static void ApplyImpulse (FAnimPhysRigidBody *InOutRigidBody, const FVector &InWorldOrientedImpactPoint, const FVector &InImpulse)
 Apply an impulse to a body 更多...
 
static FVector CalculateCenterOfMass (const TArray< FAnimPhysShape > &InShapes)
 Calculates the centre of mass of a collection of shapes 更多...
 
static FVector CalculateCenterOfMass (const TArray< FVector > &InVertices, const TArray< FIntVector > &InTriangles)
 Calculates the center of mass of a shape 更多...
 
static FMatrix CalculateInertia (const TArray< FAnimPhysShape > &InShapes, const FVector &InCenterOfMass)
 Calculate the inertia tensor of a collection of shapes 更多...
 
static FMatrix CalculateInertia (const TArray< FVector > &InVertices, const TArray< FIntVector > &InTriangles, const FVector &InCenterOfMass)
 Calculate the inertia tensor of a shape 更多...
 
static float CalculateVolume (const TArray< FAnimPhysShape > &InShapes)
 Calculates the volume of a collection of shapes 更多...
 
static float CalculateVolume (const TArray< FVector > &InVertices, const TArray< FIntVector > &InTriangles)
 Calculates the volume of a shape 更多...
 
static void ConstrainAlongDirection (float DeltaTime, TArray< FAnimPhysLinearLimit > &LimitContainer, FAnimPhysRigidBody *FirstBody, const FVector &FirstPosition, FAnimPhysRigidBody *SecondBody, const FVector &SecondPosition, const FVector &AxisToConstrain, const FVector2D Limits, float MinimumForce=-MAX_flt, float MaximumForce=MAX_flt)
 Constrain bodies along a provided axis 更多...
 
static void ConstrainAngularRange (float DeltaTime, TArray< FAnimPhysAngularLimit > &LimitContainer, FAnimPhysRigidBody *FirstBody, FAnimPhysRigidBody *SecondBody, const FQuat &JointFrame, AnimPhysTwistAxis TwistAxis, const FVector &JointLimitMin, const FVector &JointLimitMax, float InJointBias)
 Constraint two bodies together with angular limits, limiting the relative rotation between them. 更多...
 
static void ConstrainConeAngle (float DeltaTime, TArray< FAnimPhysAngularLimit > &LimitContainer, FAnimPhysRigidBody *FirstBody, const FVector &Normal0, FAnimPhysRigidBody *SecondBody, const FVector &Normal1, float LimitAngle, float InJointBias)
 Constraints the rotation between two bodies into a cone 更多...
 
static void ConstrainPlanar (float DeltaTime, TArray< FAnimPhysLinearLimit > &LimitContainer, FAnimPhysRigidBody *Body, const FTransform &PlaneTransform)
 Constrains the position of a body to one side of a plane placed at PlaneTransform (plane normal is Z axis) 更多...
 
static void ConstrainPositionNailed (float DeltaTime, TArray< FAnimPhysLinearLimit > &LimitContainer, FAnimPhysRigidBody *FirstBody, const FVector &FirstPosition, FAnimPhysRigidBody *SecondBody, const FVector &SecondPosition)
 Constrain bodies together as if fixed or nailed (linear only, bodies can still rotate) 更多...
 
static void ConstrainPositionPrismatic (float DeltaTime, TArray< FAnimPhysLinearLimit > &LimitContainer, FAnimPhysRigidBody *FirstBody, const FVector &FirstPosition, FAnimPhysRigidBody *SecondBody, const FVector &SecondPosition, const FQuat &PrismRotation, const FVector &LimitsMin, const FVector &LimitsMax)
 Constrain bodies together with linear limits forming a box or prism around the constraint 更多...
 
static void ConstrainSphericalInner (float DeltaTime, TArray< FAnimPhysLinearLimit > &LimitContainer, FAnimPhysRigidBody *Body, const FTransform &SphereTransform, float SphereRadius)
 Constrains the position of a body within the requested sphere
 
static void ConstrainSphericalOuter (float DeltaTime, TArray< FAnimPhysLinearLimit > &LimitContainer, FAnimPhysRigidBody *Body, const FTransform &SphereTransform, float SphereRadius)
 Constrains the position of a body outside of the requested sphere
 
static void PhysicsUpdate (float DeltaTime, TArray< FAnimPhysRigidBody * > &Bodies, TArray< FAnimPhysLinearLimit > &LinearLimits, TArray< FAnimPhysAngularLimit > &AngularLimits, TArray< FAnimPhysSpring > &Springs, const FVector &GravityDirection, const FVector &ExternalForce, const FVector &ExternalLinearAcc, int32 NumPreIterations=8, int32 NumPostIterations=2)
 Performs a physics update on the provided state objects 更多...
 
static void ScaleRigidBodyMass (FAnimPhysRigidBody *InOutRigidBody, float Scale)
 Scale the mass and inertia properties of a rigid body 更多...
 

详细描述

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

成员函数说明

◆ ApplyImpulse()

static void FAnimPhys::ApplyImpulse ( FAnimPhysRigidBody *  InOutRigidBody,
const FVector &  InWorldOrientedImpactPoint,
const FVector &  InImpulse 
)
static

Apply an impulse to a body

参数
InOutRigidBodyBody to apply the impulse to
InWorldOrientedImpactPointLocation of the impulse
InImpulseImpulse to apply

◆ CalculateCenterOfMass() [1/2]

static FVector FAnimPhys::CalculateCenterOfMass ( const TArray< FAnimPhysShape > &  InShapes)
static

Calculates the centre of mass of a collection of shapes

参数
InShapesCollection of shapes to use

◆ CalculateCenterOfMass() [2/2]

static FVector FAnimPhys::CalculateCenterOfMass ( const TArray< FVector > &  InVertices,
const TArray< FIntVector > &  InTriangles 
)
static

Calculates the center of mass of a shape

参数
InVerticesVerts in the shape
InTrianglesTriangles represented in InVertices

◆ CalculateInertia() [1/2]

static FMatrix FAnimPhys::CalculateInertia ( const TArray< FAnimPhysShape > &  InShapes,
const FVector &  InCenterOfMass 
)
static

Calculate the inertia tensor of a collection of shapes

参数
InShapesShapes to use
InCenterOfMassCenter of mass of the collection

◆ CalculateInertia() [2/2]

static FMatrix FAnimPhys::CalculateInertia ( const TArray< FVector > &  InVertices,
const TArray< FIntVector > &  InTriangles,
const FVector &  InCenterOfMass 
)
static

Calculate the inertia tensor of a shape

参数
InVerticesVerts in the shape
InTrianglesTriangles represented in InVertices
InCenterOfMassCenter of mass of the shape

◆ CalculateVolume() [1/2]

static float FAnimPhys::CalculateVolume ( const TArray< FAnimPhysShape > &  InShapes)
static

Calculates the volume of a collection of shapes

参数
InShapesCollection of shapes to use

◆ CalculateVolume() [2/2]

static float FAnimPhys::CalculateVolume ( const TArray< FVector > &  InVertices,
const TArray< FIntVector > &  InTriangles 
)
static

Calculates the volume of a shape

参数
InVerticesVerts in the shape
InTrianglesTriangles represented in InVertices

◆ ConstrainAlongDirection()

static void FAnimPhys::ConstrainAlongDirection ( float  DeltaTime,
TArray< FAnimPhysLinearLimit > &  LimitContainer,
FAnimPhysRigidBody *  FirstBody,
const FVector &  FirstPosition,
FAnimPhysRigidBody *  SecondBody,
const FVector &  SecondPosition,
const FVector &  AxisToConstrain,
const FVector2D  Limits,
float  MinimumForce = -MAX_flt,
float  MaximumForce = MAX_flt 
)
static

Constrain bodies along a provided axis

参数
LimitContainerContainer to add limits to
FirstBodyFirst body in constraint (or nullptr for world)
FirstPositionLocal position on first body to apply constraint
SecondBodySecond body in constraint
SecondPositionLocal position on second body to apply constraint
AxisToConstrainAxis to constrain between bodies
LimitsLimit on the provided axis so that Limits.X(min) < Final Position < Limits.Y(max)
MinimumForceMinimum force that can be applied to satisfy the maximum limit (default -MAX_flt)
MaximumForceMaximum force that can be applied to satisfy the minimum limit (default MAX_flt)

◆ ConstrainAngularRange()

static void FAnimPhys::ConstrainAngularRange ( float  DeltaTime,
TArray< FAnimPhysAngularLimit > &  LimitContainer,
FAnimPhysRigidBody *  FirstBody,
FAnimPhysRigidBody *  SecondBody,
const FQuat &  JointFrame,
AnimPhysTwistAxis  TwistAxis,
const FVector &  JointLimitMin,
const FVector &  JointLimitMax,
float  InJointBias 
)
static

Constraint two bodies together with angular limits, limiting the relative rotation between them.

Note that this allows TWO axes to rotate, the twist axis will always be locked

参数
LimitContainerContainer to add limits to
FirstBodyFirst body in the constraint (or nullptr for world)
SecondBodySecond body in constraint
JointFrameFrame/Rotation of the joint
TwistAxisThe axis to regard as the twist axis
JointLimitMinMinimum limits along each axis (twist axis ignored)
JointLimitMaxMaximum limits along each axis (twist axis ignored)
InJointBiasBias towards second body's forces (1.0f = 100%)

◆ ConstrainConeAngle()

static void FAnimPhys::ConstrainConeAngle ( float  DeltaTime,
TArray< FAnimPhysAngularLimit > &  LimitContainer,
FAnimPhysRigidBody *  FirstBody,
const FVector &  Normal0,
FAnimPhysRigidBody *  SecondBody,
const FVector &  Normal1,
float  LimitAngle,
float  InJointBias 
)
static

Constraints the rotation between two bodies into a cone

参数
LimitContainerContainer to add limits to
FirstBodyFirst body in the constraint (or nullptr for world)
Normal0Normal for the first side of the constraint
SecondBodySecond body in the constraint
Normal1Normal for the second side of the constraint
LimitAngleAngle to limit the cone to
InJointBiasBias towards second body's forces (1.0f = 100%)

◆ ConstrainPlanar()

static void FAnimPhys::ConstrainPlanar ( float  DeltaTime,
TArray< FAnimPhysLinearLimit > &  LimitContainer,
FAnimPhysRigidBody *  Body,
const FTransform &  PlaneTransform 
)
static

Constrains the position of a body to one side of a plane placed at PlaneTransform (plane normal is Z axis)

参数
LimitContainerContainer to add limits to
BodyThe body to constrain to the plane
PlaneTransformTransform of the plane, with the normal facing along the Z axis of the orientation

◆ ConstrainPositionNailed()

static void FAnimPhys::ConstrainPositionNailed ( float  DeltaTime,
TArray< FAnimPhysLinearLimit > &  LimitContainer,
FAnimPhysRigidBody *  FirstBody,
const FVector &  FirstPosition,
FAnimPhysRigidBody *  SecondBody,
const FVector &  SecondPosition 
)
static

Constrain bodies together as if fixed or nailed (linear only, bodies can still rotate)

参数
LimitContainerContainer to add limits to
FirstBodyFirst body in constraint (or nullptr for world)
FirstPositionLocal position on first body to apply constraint
SecondBodySecond body in constraint
SecondPositionLocal position on second body to apply constraint

◆ ConstrainPositionPrismatic()

static void FAnimPhys::ConstrainPositionPrismatic ( float  DeltaTime,
TArray< FAnimPhysLinearLimit > &  LimitContainer,
FAnimPhysRigidBody *  FirstBody,
const FVector &  FirstPosition,
FAnimPhysRigidBody *  SecondBody,
const FVector &  SecondPosition,
const FQuat &  PrismRotation,
const FVector &  LimitsMin,
const FVector &  LimitsMax 
)
static

Constrain bodies together with linear limits forming a box or prism around the constraint

参数
LimitContainerContainer to add limits to
FirstBodyFirst body in the constraint (or nullptr for world)
FirstPositionLocal position on first body to apply constraint
SecondBodySecond body in the constraint
SecondPositionLocal position on the second body to apply constraint
PrismRotationRotation to apply to the prism axes, only necessary when constraining to world, otherwise the rotation of the first body is used
LimitsMinMinimum limits along axes
LimitsMaxMaximum limits along axes

◆ PhysicsUpdate()

static void FAnimPhys::PhysicsUpdate ( float  DeltaTime,
TArray< FAnimPhysRigidBody * > &  Bodies,
TArray< FAnimPhysLinearLimit > &  LinearLimits,
TArray< FAnimPhysAngularLimit > &  AngularLimits,
TArray< FAnimPhysSpring > &  Springs,
const FVector &  GravityDirection,
const FVector &  ExternalForce,
const FVector &  ExternalLinearAcc,
int32  NumPreIterations = 8,
int32  NumPostIterations = 2 
)
static

Performs a physics update on the provided state objects

参数
DeltaTimeTime for the frame / update
BodiesBodies to integrate
LinearLimitsLinear limits to apply to the bodies
AngularLimitsAngular limits to apply to the bodies
SpringsLinear/Angular springs to apply to the bodies prior to solving
NumPreIterationsNumber of times to iterate the limits before performing the integration
NumPostIterationsNumber of times to iterae the limits after performing the integration

◆ ScaleRigidBodyMass()

static void FAnimPhys::ScaleRigidBodyMass ( FAnimPhysRigidBody *  InOutRigidBody,
float  Scale 
)
static

Scale the mass and inertia properties of a rigid body

参数
InOutRigidBodyBody to modify
ScaleScale to use

该类的文档由以下文件生成: