Navigation
API > API/Runtime > API/Runtime/Engine
Container for a physics representation of an object
| Name | FBodyInstance |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Classes/PhysicsEngine/BodyInstance.h |
| Include Path | #include "PhysicsEngine/BodyInstance.h" |
Syntax
USTRUCT (BlueprintType )
struct FBodyInstance : public FBodyInstanceCore
Inheritance Hierarchy
- FBodyInstanceCore → FBodyInstance
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FBodyInstance() |
Constructor | PhysicsEngine/BodyInstance.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FBodyInstance() |
PhysicsEngine/BodyInstance.h |
Structs
| Name | Remarks |
|---|---|
| FAsyncTermBodyPayload | Contains the payload necessary for FBodyInstance::AsyncTermBody to release the body's resources asynchronously (outside of game thread). |
| FBodyInstanceDelegates | Struct of body instance delegates that are rarely bound so that we can only allocate memory if one is actually being used. |
| FBodyInstanceDelegatesPtr | Specialization of TUniquePtr for storing body instance delegates as there is a need to copy the contents of the delegate structure. |
| FWeldInfo |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActorHandle | FPhysicsActorHandle | TODO_CHAOSAPI: Deprecate public ActorHandle Internal physics representation of our body instance | PhysicsEngine/BodyInstance.h | |
| AngularDamping | float | 'Drag' force added to reduce angular movement | PhysicsEngine/BodyInstance.h |
|
| bContactModification | uint8 | Enable contact modification. | PhysicsEngine/BodyInstance.h | |
| bHACK_DisableCollisionResponse | uint8 | @HACK: These are ONLY used when the 'p.EnableDynamicPerBodyFilterHacks' CVar is set (disabled by default). | PhysicsEngine/BodyInstance.h | |
| bHACK_DisableSkelComponentFilterOverriding | uint8 | By default, an owning skel mesh component will override the body's collision filter. | PhysicsEngine/BodyInstance.h | |
| bIgnoreAnalyticCollisions | uint8 | If true ignore analytic collisions and treat objects as a general implicit surface | PhysicsEngine/BodyInstance.h |
|
| bLockRotation | uint8 | When a Locked Axis Mode is selected, will lock rotation to the specified axis | PhysicsEngine/BodyInstance.h |
|
| bLockTranslation | uint8 | When a Locked Axis Mode is selected, will lock translation on the specified axis | PhysicsEngine/BodyInstance.h |
|
| bLockXRotation | uint8 | Lock rotation about the X-axis | PhysicsEngine/BodyInstance.h |
|
| bLockXTranslation | uint8 | Lock translation along the X-axis | PhysicsEngine/BodyInstance.h |
|
| bLockYRotation | uint8 | Lock rotation about the Y-axis | PhysicsEngine/BodyInstance.h |
|
| bLockYTranslation | uint8 | Lock translation along the Y-axis | PhysicsEngine/BodyInstance.h |
|
| bLockZRotation | uint8 | Lock rotation about the Z-axis | PhysicsEngine/BodyInstance.h |
|
| bLockZTranslation | uint8 | Lock translation along the Z-axis | PhysicsEngine/BodyInstance.h |
|
| bNotifyRigidBodyCollision | uint8 | Should 'Hit' events fire when this object collides during physics simulation. | PhysicsEngine/BodyInstance.h |
|
| BodyInstanceOwner | IPhysicsBodyInstanceOwner * | Owner containing this body (when not a UPrimitiveComponent). | PhysicsEngine/BodyInstance.h | |
| bOverrideMaxAngularVelocity | uint8 | Override the default max angular velocity | PhysicsEngine/BodyInstance.h |
|
| bOverrideSolverAsyncDeltaTime | uint8 | Set the desired delta time for the body. | PhysicsEngine/BodyInstance.h |
|
| bSmoothEdgeCollisions | uint8 | Remove unnecessary edge collisions to allow smooth sliding over surfaces composed of multiple actors/components. | PhysicsEngine/BodyInstance.h |
|
| bUseCCD | uint8 | If true Continuous Collision Detection (CCD) will be used for this component | PhysicsEngine/BodyInstance.h |
|
| COMNudge | FVector | User specified offset for this object's Center of Mass. | PhysicsEngine/BodyInstance.h |
|
| CurrentSceneState | BodyInstanceSceneState | Current state of the physics body for tracking deferred addition and removal. | PhysicsEngine/BodyInstance.h | |
| CustomDOFPlaneNormal | FVector | Locks physical movement along a custom plane for a given normal. | PhysicsEngine/BodyInstance.h |
|
| CustomSleepThresholdMultiplier | float | If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount. | PhysicsEngine/BodyInstance.h |
|
| DOFConstraint | FConstraintInstance * | Constraint used to allow for easy DOF setup per bodyinstance | PhysicsEngine/BodyInstance.h | |
| DOFMode | TEnumAsByte< EDOFMode::Type > | Locks physical movement along specified axis. | PhysicsEngine/BodyInstance.h |
|
| GravityGroupIndex | uint8 | What gravity group the BI should use, which determines rate of acceleration | PhysicsEngine/BodyInstance.h |
|
| InertiaTensorScale | FVector | Per-instance scaling of inertia (bigger number means it'll be harder to rotate) | PhysicsEngine/BodyInstance.h |
|
| InstanceBodyIndex | int32 | Index of this BodyInstance within the SkeletalMeshComponent/PhysicsAsset. | PhysicsEngine/BodyInstance.h | |
| InstanceBoneIndex | int16 | When we are a body within a SkeletalMeshComponent, we cache the index of the bone we represent, to speed up sync'ing physics to anim. | PhysicsEngine/BodyInstance.h | |
| LinearDamping | float | 'Drag' force added to reduce linear movement | PhysicsEngine/BodyInstance.h |
|
| MassScale | float | Per-instance scaling of mass | PhysicsEngine/BodyInstance.h |
|
| MaxAngularVelocity | float | The maximum angular velocity for this instance [degrees/s] | PhysicsEngine/BodyInstance.h |
|
| OwnerComponent | TWeakObjectPtr< class UPrimitiveComponent > | PrimitiveComponent containing this body, if relevant. | PhysicsEngine/BodyInstance.h | |
| PhysicsBlendWeight | float | Influence of rigid body physics (blending) on the mesh's pose (0.0 == use only animation, 1.0 == use only physics) Provide appropriate interface for doing this instead of allowing BlueprintReadWrite | PhysicsEngine/BodyInstance.h | |
| PhysicsUserData | FPhysicsUserData | #PHYS2 Rename, not just for physx now. | PhysicsEngine/BodyInstance.h | |
| PositionSolverIterationCount | uint8 | Override the project-settings position iteration count for this body (if bOverrideIterationCounts is set). | PhysicsEngine/BodyInstance.h |
|
| ProjectionSolverIterationCount | uint8 | Override the project-settings projection iteration count for this body (if bOverrideIterationCounts is set). | PhysicsEngine/BodyInstance.h |
|
| Scale3D | FVector | Current scale of physics - used to know when and how physics must be rescaled to match current transform of OwnerComponent. | PhysicsEngine/BodyInstance.h | |
| SleepFamily | ESleepFamily | The set of values used in considering when put this body to sleep. | PhysicsEngine/BodyInstance.h |
|
| SolverAsyncDeltaTime | float | Override value for physics solver async delta time. | PhysicsEngine/BodyInstance.h |
|
| SourceObject | TWeakObjectPtr< UObject > | Source object for this body. | PhysicsEngine/BodyInstance.h | |
| StabilizationThresholdMultiplier | float | Stabilization factor for this body if Physics stabilization is enabled. | PhysicsEngine/BodyInstance.h |
|
| VelocitySolverIterationCount | uint8 | Override the project-settings velocity iteration count for this body (if bOverrideIterationCounts is set). | PhysicsEngine/BodyInstance.h |
|
| WeldParent | FBodyInstance * | The parent body that we are welded to | PhysicsEngine/BodyInstance.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAllowPartialIslandSleep | uint8 | [EXPERIMENTAL] If true Partial Island Sleeping is permitted for the entire island this body is in | PhysicsEngine/BodyInstance.h |
|
| BodyInstanceDelegates | FBodyInstanceDelegatesPtr | Pointer to lazily created container for the body instance delegates. | PhysicsEngine/BodyInstance.h | |
| bShapeCollisionEnabledIsSet | uint8 | PhysicsEngine/BodyInstance.h | ||
| bShapeCollisionResponsesIsSet | uint8 | PhysicsEngine/BodyInstance.h | ||
| bUseMACD | uint8 | [EXPERIMENTAL] If true Motion-Aware Collision Detection (MACD) will be used for this component | PhysicsEngine/BodyInstance.h |
|
| CollisionEnabled | TEnumAsByte< ECollisionEnabled::Type > | Type of collision enabled. | PhysicsEngine/BodyInstance.h |
|
| CollisionProfileName | FName | Collision Profile Name | PhysicsEngine/BodyInstance.h |
|
| CollisionResponses | FCollisionResponse | Custom Channels for Responses | PhysicsEngine/BodyInstance.h |
|
| MaskFilter | FMaskFilter | Extra mask for filtering. Look at declaration for logic | PhysicsEngine/BodyInstance.h | |
| ObjectType | TEnumAsByte< enum ECollisionChannel > | Enum indicating what type of object this should be considered as when it moves | PhysicsEngine/BodyInstance.h |
|
| ShapeCollisionEnabled | TArray< TEnumAsByte< ECollisionEnabled::Type > > | When per-shape collision is changed at runtime, state is stored in an optional array of per-shape collision state. | PhysicsEngine/BodyInstance.h | |
| ShapeCollisionResponses | TArray< TPair< int32, FCollisionResponse > > | When per-shape collision responses are changed at runtime, state is stored in an optional array of per-shape collision response settings. | PhysicsEngine/BodyInstance.h | |
| ShapeToBodiesMap | TSharedPtr< TMap< FPhysicsShapeHandle, FWeldInfo > > | Used to map between shapes and welded bodies. | PhysicsEngine/BodyInstance.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddAngularImpulseInRadians
(
const FVector& Impulse, |
Add a rotational impulse to this body | PhysicsEngine/BodyInstance.h | |
void AddCustomPhysics
(
FCalculateCustomPhysics& CalculateCustomPhysics |
Add custom forces and torques on the body. | PhysicsEngine/BodyInstance.h | |
void AddForce
(
const FVector& Force, |
Add a force to this body | PhysicsEngine/BodyInstance.h | |
void AddForceAtPosition
(
const FVector& Force, |
Add a force at a particular position (world space when bIsLocalForce = false, body space otherwise) | PhysicsEngine/BodyInstance.h | |
void AddImpulse
(
const FVector& Impulse, |
Add an impulse to this body | PhysicsEngine/BodyInstance.h | |
void AddImpulseAtPosition
(
const FVector& Impulse, |
Add an impulse to this body and a particular world position | PhysicsEngine/BodyInstance.h | |
void AddRadialForceToBody
(
const FVector& Origin, |
Add a force to this bodyinstance, originating from the supplied world-space location. | PhysicsEngine/BodyInstance.h | |
void AddRadialImpulseToBody
(
const FVector& Origin, |
Add an impulse to this bodyinstance, radiating out from the specified position. | PhysicsEngine/BodyInstance.h | |
void AddTorqueInRadians
(
const FVector& Torque, |
Add a torque to this body | PhysicsEngine/BodyInstance.h | |
void AddVelocityChangeImpulseAtLocation
(
const FVector& Impulse, |
Add a velocity change impulse to this body and a particular world position | PhysicsEngine/BodyInstance.h | |
void ApplyAsyncPhysicsCommand
(
FAsyncPhysicsTimestamp TimeStamp, |
Apply async physics command onto the body instance | PhysicsEngine/BodyInstance.h | |
void ApplyDeferredCollisionProfileName() |
Applies a deferred collision profile | PhysicsEngine/BodyInstance.h | |
void ApplyMaterialToInstanceShapes_AssumesLocked
(
UPhysicalMaterial* SimplePhysMat, |
Note: This function is not thread safe. | PhysicsEngine/BodyInstance.h | |
void ApplySerializedState
(
Chaos::FSerializedDataBufferPtr&& InSerializedState, |
Deserializes the provided array of bytes representing a saved physics thread state and applies it to this body | PhysicsEngine/BodyInstance.h | |
void ApplyWeldOnChildren() |
Finds all children that are technically welded to us (for example kinematics are welded but not as far as physx is concerned) and apply the actual physics engine weld on them | PhysicsEngine/BodyInstance.h | |
void BuildBodyFilterData
(
FBodyCollisionFilterData& OutFilterData, |
Build the sim and query filter data (for simple and complex shapes) based on the settings of this BodyInstance (and its associated BodySetup) | PhysicsEngine/BodyInstance.h | |
void ClearExternalCollisionProfile() |
PhysicsEngine/BodyInstance.h | ||
void ClearForces
(
bool bAllowSubstepping |
Clear accumulated forces on this body | PhysicsEngine/BodyInstance.h | |
void ClearTorques
(
bool bAllowSubstepping |
Clear accumulated torques on this body | PhysicsEngine/BodyInstance.h | |
void CopyBodyInstancePropertiesFrom
(
const FBodyInstance* FromInst |
Utility for copying properties from one BodyInstance to another. | PhysicsEngine/BodyInstance.h | |
void CopyRuntimeBodyInstancePropertiesFrom
(
const FBodyInstance* FromInst |
Utility for copying only the runtime instanced properties from one BodyInstance to another. | PhysicsEngine/BodyInstance.h | |
void CreateDOFLock() |
PhysicsEngine/BodyInstance.h | ||
bool DoesUseCollisionProfile() |
Return true if it uses Collision Profile System. False otherwise | PhysicsEngine/BodyInstance.h | |
void DrawCOMPosition
(
FPrimitiveDrawInterface* PDI, |
Draws the center of mass as a wire star | PhysicsEngine/BodyInstance.h | |
void ExecuteOnCalculateCustomProjection
(
FTransform& WorldTM |
Executes the OnCalculateCustomProjection delegate if bound. | PhysicsEngine/BodyInstance.h | |
void FixupData
(
UObject* Loader |
UObject notification by OwningComponent | PhysicsEngine/BodyInstance.h | |
const FPhysicsActorHandle & GetActorReferenceWithWelding() |
PhysicsEngine/BodyInstance.h | ||
bool GetAllowPartialIslandSleep() |
[EXPERIMENTAL] Whether Partial Island Sleep is permitted for the island this body is in | PhysicsEngine/BodyInstance.h | |
int32 GetAllShapes_AssumesLocked
(
TArray< FPhysicsShapeHandle >& OutShapes |
Utility to get all the shapes from a FBodyInstance NOTE: This function is not thread safe. | PhysicsEngine/BodyInstance.h | |
FBox GetBodyBounds() |
Return bounds of physics representation in world space | PhysicsEngine/BodyInstance.h | |
FBox GetBodyBoundsLocal() |
Return bounds of physics representation in world space | PhysicsEngine/BodyInstance.h | |
FString GetBodyDebugName() |
Get the name for this body, for use in debugging | PhysicsEngine/BodyInstance.h | |
FVector GetBodyInertiaTensor() |
Return the body's inertia tensor. This is returned in local mass space | PhysicsEngine/BodyInstance.h | |
FBodyInstanceAsyncPhysicsTickHandle GetBodyInstanceAsyncPhysicsTickHandle() |
PhysicsEngine/BodyInstance.h | ||
void GetBodyInstanceResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
Returns memory used by resources allocated for this body instance ( ex. physics resources ) | PhysicsEngine/BodyInstance.h | |
float GetBodyMass() |
Returns the body's mass | PhysicsEngine/BodyInstance.h | |
UBodySetup * GetBodySetup() |
PhysicsEngine/BodyInstance.h | ||
ECollisionEnabled::Type GetCollisionEnabled
(
bool bCheckOwner |
Get the current type of collision enabled | PhysicsEngine/BodyInstance.h | |
FName GetCollisionProfileName() |
Returns the collision profile name that will be used. | PhysicsEngine/BodyInstance.h | |
const FCollisionResponse & GetCollisionResponse() |
PhysicsEngine/BodyInstance.h | ||
void GetComplexPhysicalMaterials
(
TArray< UPhysicalMaterial* >& OutPhysMaterials |
Get the complex PhysicalMaterials for this body | PhysicsEngine/BodyInstance.h | |
void GetComplexPhysicalMaterials
(
TArray< UPhysicalMaterial* >& OutPhysMaterials, |
Get the complex PhysicalMaterials and PhysicalMaterialMasks for this body | PhysicsEngine/BodyInstance.h | |
TArray< UPhysicalMaterial * > GetComplexPhysicalMaterials
(
TArray< FPhysicalMaterialMaskParams >& OutPhysMaterialMasks |
Get the complex PhysicalMaterials and PhysicalMaterialMasks array for this body | PhysicsEngine/BodyInstance.h | |
| Get the complex PhysicalMaterials array for this body | PhysicsEngine/BodyInstance.h | ||
FVector GetCOMPosition() |
Returns the center of mass of this body (in world space) | PhysicsEngine/BodyInstance.h | |
| PhysicsEngine/BodyInstance.h | |||
float GetDistanceToBody
(
const FVector& Point, |
Get the square of the distance to the body surface if available It is only valid if BodyShape is convex If point is inside or shape is not convex, it will return 0.f | PhysicsEngine/BodyInstance.h | |
FTransform GetKinematicTarget () |
Get the kinematic target transform in world space from physics body. | PhysicsEngine/BodyInstance.h | |
FTransform GetKinematicTarget_AssumesLocked () |
Get the kinematic target transform in world space from physics body. | PhysicsEngine/BodyInstance.h | |
FVector GetLockedAxis() |
PhysicsEngine/BodyInstance.h | ||
FMaskFilter GetMaskFilter() |
Return the ignore mask filter. | PhysicsEngine/BodyInstance.h | |
float GetMassOverride() |
Returns the mass override. See MassInKgOverride for documentation | PhysicsEngine/BodyInstance.h | |
FTransform GetMassSpaceLocal() |
Returns the mass coordinate system to local space transform (position is local center of mass, rotation should be identity) | PhysicsEngine/BodyInstance.h | |
FTransform GetMassSpaceToWorldSpace() |
Returns the mass coordinate system to world space transform (position is world center of mass, rotation is world inertia orientation) | PhysicsEngine/BodyInstance.h | |
float GetMaxAngularVelocityInRadians() |
Get the maximum angular velocity of this body | PhysicsEngine/BodyInstance.h | |
float GetMaxDepenetrationVelocity () |
The maximum velocity at which initally-overlapping bodies will separate. | PhysicsEngine/BodyInstance.h | |
ECollisionChannel GetObjectType() |
Get the movement channel of this body | PhysicsEngine/BodyInstance.h | |
const FBodyInstance * GetOriginalBodyInstance
(
const FPhysicsShapeHandle& InShape |
Returns the original owning body instance. This is needed for welding | PhysicsEngine/BodyInstance.h | |
bool GetOverrideMaxDepenetrationVelocity() |
Are we overriding the MaxDepenetrationVelocity. See SetMaxDepenetrationVelocity | PhysicsEngine/BodyInstance.h | |
bool GetOverrideWalkableSlopeOnInstance() |
Gets bOverrideWalkableSlopeOnInstance | PhysicsEngine/BodyInstance.h | |
FPhysicsActorHandle GetPhysicsActor() |
PhysicsEngine/BodyInstance.h | ||
FPhysicsActorHandle & GetPhysicsActorHandle () |
TODO_CHAOSAPI: Deprecate ActorHandle Ref API. | PhysicsEngine/BodyInstance.h | |
const FPhysicsActorHandle & GetPhysicsActorHandle () |
PhysicsEngine/BodyInstance.h | ||
FPhysicsActorHandle GetPhysicsActorWeldRoot() |
PhysicsEngine/BodyInstance.h | ||
| Get the EPhysicsReplicationMode from the owning actor. | PhysicsEngine/BodyInstance.h | ||
const FPhysScene * GetPhysicsScene () |
PhysicsEngine/BodyInstance.h | ||
FPhysScene * GetPhysicsScene () |
Get the scene that owns this body. | PhysicsEngine/BodyInstance.h | |
UPhysicalMaterial * GetPhysMaterialOverride() |
Get physical material override for this body | PhysicsEngine/BodyInstance.h | |
int32 GetPositionSolverIterationCount() |
Get the per-body position iterations (or -1 if bOverrideIterationCounts is false) | PhysicsEngine/BodyInstance.h | |
int32 GetProjectionSolverIterationCount() |
Get the per-body projection iterations (or -1 if bOverrideIterationCounts is false) | PhysicsEngine/BodyInstance.h | |
const FTransform & GetRelativeBodyTransform
(
const FPhysicsShapeHandle& InShape |
Returns the relative transform between root body and welded instance owned by the shape. | PhysicsEngine/BodyInstance.h | |
ECollisionResponse GetResponseToChannel
(
ECollisionChannel Channel |
Get the collision response of this body to a particular channel | PhysicsEngine/BodyInstance.h | |
const FCollisionResponseContainer & GetResponseToChannels() |
Get Collision ResponseToChannels container for this component | PhysicsEngine/BodyInstance.h | |
bool GetRigidBodyState
(
FRigidBodyState& OutState |
PhysicsEngine/BodyInstance.h | ||
ECollisionEnabled::Type GetShapeCollisionEnabled
(
const int32 ShapeIndex |
Get the current type of collision enabled for a particular shape | PhysicsEngine/BodyInstance.h | |
const FCollisionResponseContainer & GetShapeResponseToChannels
(
const int32 ShapeIndex |
Get Collision ResponseToChannels container for a specific shape in this component | PhysicsEngine/BodyInstance.h | |
const FCollisionResponseContainer & GetShapeResponseToChannels
(
const int32 ShapeIndex, |
PhysicsEngine/BodyInstance.h | ||
| Find the correct PhysicalMaterial for simple geometry on this body | PhysicsEngine/BodyInstance.h | ||
float GetSleepThresholdMultiplier() |
Gets the multiplier to the threshold where the body will go to sleep automatically. | PhysicsEngine/BodyInstance.h | |
float GetSolverAsyncDeltaTime() |
PhysicsEngine/BodyInstance.h | ||
bool GetSquaredDistanceToBody
(
const FVector& Point, |
Get distance to the body surface if available It is only valid if BodyShape is convex If point is inside distance it will be 0 Returns false if geometry is not supported | PhysicsEngine/BodyInstance.h | |
FVector GetUnrealWorldAngularVelocityInRadians () |
Get current angular velocity in world space from physics body. | PhysicsEngine/BodyInstance.h | |
| Get current angular velocity in world space from physics body. | PhysicsEngine/BodyInstance.h | ||
FTransform GetUnrealWorldTransform
(
bool bWithProjection, |
Get current transform in world space from physics body. | PhysicsEngine/BodyInstance.h | |
FTransform GetUnrealWorldTransform_AssumesLocked
(
bool bWithProjection, |
Get current transform in world space from physics body. | PhysicsEngine/BodyInstance.h | |
FVector GetUnrealWorldVelocity() |
Get current velocity in world space from physics body. | PhysicsEngine/BodyInstance.h | |
FVector GetUnrealWorldVelocity_AssumesLocked() |
Get current velocity in world space from physics body. | PhysicsEngine/BodyInstance.h | |
FVector GetUnrealWorldVelocityAtPoint
(
const FVector& Point |
Get current velocity of a point on this physics body, in world space. | PhysicsEngine/BodyInstance.h | |
FVector GetUnrealWorldVelocityAtPoint_AssumesLocked
(
const FVector& Point |
Get current velocity of a point on this physics body, in world space. | PhysicsEngine/BodyInstance.h | |
bool GetUseMACD() |
[EXPERIMENTAL] Whether Motion-Aware Collision Detection is enabled | PhysicsEngine/BodyInstance.h | |
int32 GetVelocitySolverIterationCount() |
Get the per-body velocity iterations (or -1 if bOverrideIterationCounts is false) | PhysicsEngine/BodyInstance.h | |
const FWalkableSlopeOverride & GetWalkableSlopeOverride () |
Returns the slope override struct for this instance. | PhysicsEngine/BodyInstance.h | |
void InitBody
(
UBodySetup* Setup, |
Initialise a single rigid body (this FBodyInstance) for the given body setup | PhysicsEngine/BodyInstance.h | |
void InitBody
(
UBodySetup* Setup, |
Initialise a single rigid body (this FBodyInstance) for the given body setup | PhysicsEngine/BodyInstance.h | |
void InitBody
(
UBodySetup* Setup, |
PhysicsEngine/BodyInstance.h | ||
| Initialise dynamic properties for this instance when using physics - this must be done after scene addition. | PhysicsEngine/BodyInstance.h | ||
bool IsDynamic() |
Returns true if the body is not static | PhysicsEngine/BodyInstance.h | |
bool IsInertiaConditioningEnabled () |
Whether inertia conditioning is enabled. | PhysicsEngine/BodyInstance.h | |
bool IsInstanceAwake() |
Returns whether this body is awake | PhysicsEngine/BodyInstance.h | |
bool IsInstanceSimulatingPhysics() |
Returns true if this body is simulating, false if it is fixed (kinematic) | PhysicsEngine/BodyInstance.h | |
bool IsNonKinematic() |
Returns true if the body is non kinematic | PhysicsEngine/BodyInstance.h | |
bool IsPartialIslandSleepAllowed() |
PhysicsEngine/BodyInstance.h | ||
bool IsPhysicsDisabled() |
PhysicsEngine/BodyInstance.h | ||
bool IsShapeBoundToBody
(
const FPhysicsShapeHandle& Shape |
Check if the shape is owned by this body instance | PhysicsEngine/BodyInstance.h | |
bool IsSolverAsyncDeltaTimeSet() |
PhysicsEngine/BodyInstance.h | ||
bool IsUsingMACD() |
PhysicsEngine/BodyInstance.h | ||
bool IsValidBodyInstance() |
See if this body is valid. | PhysicsEngine/BodyInstance.h | |
bool LineTrace
(
FHitResult& OutHit, |
Trace a ray against just this bodyinstance | PhysicsEngine/BodyInstance.h | |
void LoadProfileData
(
bool bVerifyProfile |
Update profile data if required | PhysicsEngine/BodyInstance.h | |
FCalculateCustomProjection & OnCalculateCustomProjection () |
Returns reference to the OnCalculateCustomProjection delegate. | PhysicsEngine/BodyInstance.h | |
FRecalculatedMassProperties & OnRecalculatedMassProperties () |
Returns reference to the OnRecalculatedMassProperties delegate. | PhysicsEngine/BodyInstance.h | |
bool OverlapMulti
(
TArray< struct FOverlapResult >& InOutOverlaps, |
PhysicsEngine/BodyInstance.h | ||
bool OverlapMulti
(
TArray< struct FOverlapResult >& InOutOverlaps, |
Determines the set of components that this body instance would overlap with at the supplied location/rotation | PhysicsEngine/BodyInstance.h | |
bool OverlapTest
(
const FVector& Position, |
Test if the bodyinstance overlaps with the specified shape at the specified position/rotation | PhysicsEngine/BodyInstance.h | |
bool OverlapTest_AssumesLocked
(
const FVector& Position, |
Test if the bodyinstance overlaps with the specified shape at the specified position/rotation Note: This function is not thread safe. | PhysicsEngine/BodyInstance.h | |
bool OverlapTestForBodies
(
const FVector& Position, |
Test if the bodyinstance overlaps with the specified body instances | PhysicsEngine/BodyInstance.h | |
bool OverlapTestForBody
(
const FVector& Position, |
PhysicsEngine/BodyInstance.h | ||
void PostShapeChange() |
After adding/removing shapes call this function to update mass distribution etc... | PhysicsEngine/BodyInstance.h | |
void PutInstanceToSleep() |
Force this body to sleep | PhysicsEngine/BodyInstance.h | |
void ReleasePhysicsActor() |
PhysicsEngine/BodyInstance.h | ||
bool ReplaceResponseToChannels
(
ECollisionResponse OldResponse, |
Replace the channels on this body matching the old response with the new response | PhysicsEngine/BodyInstance.h | |
void SerializeState
(
Chaos::FSerializedDataBuffer& OutSerializedState, |
Serialized out the physics thread state of this body as an array of bytes | PhysicsEngine/BodyInstance.h | |
void SetAllowPartialIslandSleep
(
bool bInAllowPartialIslandSleep |
[EXPERIMENTAL] Enable/disable Partial Island Sleeping for the entire island this body is in. | PhysicsEngine/BodyInstance.h | |
void SetAngularVelocityInRadians
(
const FVector& NewAngVel, |
Set the angular velocity of this body | PhysicsEngine/BodyInstance.h | |
void SetBodyTransform
(
const FTransform& NewTransform, |
Move the physics body to a new pose. | PhysicsEngine/BodyInstance.h | |
void SetCollisionEnabled
(
ECollisionEnabled::Type NewType, |
Controls what kind of collision is enabled for this body and allows optional disable physics rebuild | PhysicsEngine/BodyInstance.h | |
void SetCollisionProfileName
(
FName InCollisionProfileName |
Set Collision Profile Name This function should be called outside of constructors to set profile name. | PhysicsEngine/BodyInstance.h | |
void SetCollisionProfileNameDeferred
(
FName InCollisionProfileName |
Set Collision Profile Name (deferred) This function is called by constructors when they set ProfileName This will change current CollisionProfileName, but collision data will not be set up until the physics state is created or the collision profile is accessed. | PhysicsEngine/BodyInstance.h | |
void SetContactModification
(
bool bNewContactModification |
Enables/disables contact modification | PhysicsEngine/BodyInstance.h | |
void SetContactReportForceThreshold
(
float Threshold |
Set a new contact report force threhold. Threshold < 0 disables this feature. | PhysicsEngine/BodyInstance.h | |
void SetDOFLock
(
EDOFMode::Type NewDOFMode |
Locks physical movement along axis. | PhysicsEngine/BodyInstance.h | |
void SetEnableGravity
(
bool bGravityEnabled |
Enables/disables whether this body is affected by gravity. | PhysicsEngine/BodyInstance.h | |
void SetGravityGroupIndex
(
int32 NewGravityGroupIndex |
Sets the gravity group index, which determines acceleration when gravity is enabled. | PhysicsEngine/BodyInstance.h | |
void SetGyroscopicTorqueEnabled
(
bool bInGyroscopicTorqueEnabled |
Enabled/disables whether this body is affected by gyroscopic torque, mainly useful for long/thin objects that spin | PhysicsEngine/BodyInstance.h | |
void SetInertiaConditioningEnabled
(
bool bEnabled |
Enable or disable inertia conditionin. | PhysicsEngine/BodyInstance.h | |
void SetInstanceNotifyRBCollision
(
bool bNewNotifyCollision |
Set whether we should get a notification about physics collisions | PhysicsEngine/BodyInstance.h | |
void SetInstanceSimulatePhysics
(
bool bSimulate, |
Set this body to either simulate or to be fixed/kinematic. | PhysicsEngine/BodyInstance.h | |
void SetLinearVelocity
(
const FVector& NewVel, |
Set the linear velocity of this body | PhysicsEngine/BodyInstance.h | |
void SetMaskFilter
(
FMaskFilter InMaskFilter |
Updates the mask filter. | PhysicsEngine/BodyInstance.h | |
void SetMassOverride
(
float MassInKG, |
Sets the mass override | PhysicsEngine/BodyInstance.h | |
void SetMassScale
(
float InMassScale |
Modify the mass scale of this body | PhysicsEngine/BodyInstance.h | |
void SetMassSpaceLocal
(
const FTransform& NewMassSpaceLocalTM |
TODO: this only works at runtime when the physics state has been created. | PhysicsEngine/BodyInstance.h | |
void SetMaxAngularVelocityInRadians
(
float NewMaxAngVel, |
Set the maximum angular velocity of this body | PhysicsEngine/BodyInstance.h | |
void SetMaxDepenetrationVelocity
(
float MaxVelocity |
Set the maximum velocity used to depenetrate this object from others when spawned with initial overlaps or teleports (does not affect overlaps as a result of normal movement). | PhysicsEngine/BodyInstance.h | |
void SetObjectType
(
ECollisionChannel Channel |
Set the movement channel of this body to the one supplied | PhysicsEngine/BodyInstance.h | |
void SetOneWayInteraction
(
bool InOneWayInteraction |
If set to true, this body will treat bodies that do not have the flag set as having infinite mass | PhysicsEngine/BodyInstance.h | |
void SetOverrideIterationCounts
(
bool bOverride |
PhysicsEngine/BodyInstance.h | ||
void SetOverrideMaxDepenetrationVelocity
(
bool bInEnabled |
Enable/Disable override of MaxDepenetrationVelocity | PhysicsEngine/BodyInstance.h | |
void SetPhysicsActor
(
FPhysicsActorHandle InHandle |
PhysicsEngine/BodyInstance.h | ||
void SetPhysicsActorHandle
(
FPhysicsActorHandle InHandle |
PhysicsEngine/BodyInstance.h | ||
void SetPhysicsDisabled
(
bool bSetDisabled |
Disable/Re-Enable this body in the solver, when disable, the body won't be part of the simulation ( regardless if it's dynamic or kinematic ) and no collision will occur this can be used for performance control situation for example | PhysicsEngine/BodyInstance.h | |
void SetPhysMaterialOverride
(
UPhysicalMaterial* NewPhysMaterial |
Set physical material override for this body | PhysicsEngine/BodyInstance.h | |
void SetPositionSolverIterationCount
(
uint8 PositionSolverIterationCountIn |
Set the per-body position iterations (only used if bOverrideIterationCounts is true) | PhysicsEngine/BodyInstance.h | |
void SetProjectionSolverIterationCount
(
uint8 ProjectionSolverIterationCountIn |
Set the per-body projection iterations (only used if bOverrideIterationCounts is true) | PhysicsEngine/BodyInstance.h | |
bool SetResponseToAllChannels
(
ECollisionResponse NewResponse |
Set the response of this body to all channels | PhysicsEngine/BodyInstance.h | |
bool SetResponseToChannel
(
ECollisionChannel Channel, |
Set the collision response of this body to a particular channel | PhysicsEngine/BodyInstance.h | |
bool SetResponseToChannels
(
const FCollisionResponseContainer& NewResponses |
Set the response of this body to the supplied settings | PhysicsEngine/BodyInstance.h | |
void SetShapeCollisionEnabled
(
const int32 ShapeIndex, |
Controls what kind of collision is enabled for a particular shape | PhysicsEngine/BodyInstance.h | |
bool SetShapeResponseToChannels
(
const int32 ShapeIndex, |
Set the response of a specific shape on this body to the supplied settings | PhysicsEngine/BodyInstance.h | |
void SetSmoothEdgeCollisionsEnabled
(
bool bNewSmoothEdgeCollisions |
Enables/disabled smoothed edge collisions | PhysicsEngine/BodyInstance.h | |
void SetSolverAsyncDeltaTime
(
const float NewSolverAsyncDeltaTime |
PhysicsEngine/BodyInstance.h | ||
void SetUpdateKinematicFromSimulation
(
bool bUpdateKinematicFromSimulation |
Enables/disables whether this body, when kinematic, is updated from the simulation rather than when setting the kinematic target. | PhysicsEngine/BodyInstance.h | |
void SetUseCCD
(
bool bInUseCCD |
Enable/disable Continuous Collision Detection feature | PhysicsEngine/BodyInstance.h | |
void SetUseMACD
(
bool bInUseMACD |
[EXPERIMENTAL] Enable/disable Motion-Aware Collision Detection feature. | PhysicsEngine/BodyInstance.h | |
void SetVelocitySolverIterationCount
(
uint8 VelocitySolverIterationCountIn |
Set the per-body velocity iterations (only used if bOverrideIterationCounts is true) | PhysicsEngine/BodyInstance.h | |
void SetWalkableSlopeOverride
(
const FWalkableSlopeOverride& NewOverride, |
Sets a custom slope override struct for this instance. | PhysicsEngine/BodyInstance.h | |
bool ShouldInterpolateWhenSubStepping () |
Whether we should interpolate when substepping. | PhysicsEngine/BodyInstance.h | |
FAsyncTermBodyPayload StartAsyncTermBody_GameThread() |
Prepares the body to release its resources outside of the game thread. | PhysicsEngine/BodyInstance.h | |
bool Sweep
(
FHitResult& OutHit, |
Trace a shape against just this bodyinstance | PhysicsEngine/BodyInstance.h | |
void TermBody
(
bool bNeverDeferRelease |
Terminates the body, releasing resources Clean up the physics engine info for this instance. | PhysicsEngine/BodyInstance.h | |
void UnWeld
(
FBodyInstance* Body |
Takes a welded body and unwelds it. | PhysicsEngine/BodyInstance.h | |
bool UpdateBodyScale
(
const FVector& InScale3D, |
Update Body Scale | PhysicsEngine/BodyInstance.h | |
void UpdateDampingProperties() |
Update instance's linear and angular damping | PhysicsEngine/BodyInstance.h | |
void UpdateInstanceSimulatePhysics() |
Makes sure the current kinematic state matches the simulate flag | PhysicsEngine/BodyInstance.h | |
void UpdateMassProperties() |
Update instance's mass properties (mass, inertia and center-of-mass offset) based on MassScale, InstanceMassScale and COMNudge. | PhysicsEngine/BodyInstance.h | |
void UpdatePhysicalMaterials() |
Update the instance's material properties (friction, restitution) | PhysicsEngine/BodyInstance.h | |
void UpdatePhysicsFilterData () |
Update the instances collision filtering data | PhysicsEngine/BodyInstance.h | |
void UpdateTriMeshVertices
(
const TArray< FVector >& NewPositions |
Dynamically update the vertices of per-poly collision for this body. | PhysicsEngine/BodyInstance.h | |
void UseExternalCollisionProfile
(
UBodySetup* InExternalCollisionProfileBodySetup |
Use the collision profile found in the given BodySetup's default BodyInstance | PhysicsEngine/BodyInstance.h | |
void WakeInstance() |
Wake this body | PhysicsEngine/BodyInstance.h | |
bool Weld
(
FBodyInstance* Body, |
Takes two body instances and welds them together to create a single simulated rigid body. | PhysicsEngine/BodyInstance.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void UpdateInterpolateWhenSubStepping() |
Update the substepping interpolation flag | PhysicsEngine/BodyInstance.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ApplyMaterialToShape_AssumesLocked
(
const FPhysicsShapeHandle& InShape, |
Apply a material directly to the passed in shape. | PhysicsEngine/BodyInstance.h | |
static void AsyncTermBody
(
FAsyncTermBodyPayload& Payload |
Releases body resources provided by Payload which was returned by StartAsyncTermBody_GameThread (can be called outside of game thread). | PhysicsEngine/BodyInstance.h | |
static void BuildBodyCollisionFlags
(
FBodyCollisionFlags& OutFlags, |
Build the flags to control which types of collision (sim and query) shapes owned by this BodyInstance should have. | PhysicsEngine/BodyInstance.h | |
static void GetComplexPhysicalMaterials
(
const FBodyInstance* BodyInstance, |
Find the correct PhysicalMaterial and PhysicalMaterialMasks for complex geometry on a given body and owner. | PhysicsEngine/BodyInstance.h | |
static UPhysicalMaterial * GetSimplePhysicalMaterial
(
const FBodyInstance* BodyInstance, |
Find the correct PhysicalMaterial for simple geometry on a given body and owner. | PhysicsEngine/BodyInstance.h | |
static void InitStaticBodies
(
TArray< FBodyInstance* >&& Bodies, |
Standalone path to batch initialize large amounts of static bodies. | PhysicsEngine/BodyInstance.h | |
static void InitStaticBodies
(
const TArray< FBodyInstance* >& Bodies, |
Standalone path to batch initialize large amounts of static bodies, which will be deferred till the next scene update for fast scene addition. | PhysicsEngine/BodyInstance.h | |
static bool IsValidCollisionProfileName
(
FName InCollisionProfileName |
Return true if the collision profile name is valid | PhysicsEngine/BodyInstance.h | |
static EDOFMode::Type ResolveDOFMode
(
EDOFMode::Type DOFMode |
PhysicsEngine/BodyInstance.h | ||
static bool ValidateTransform
(
const FTransform& Transform, |
Validate a body transform, outputting debug info | PhysicsEngine/BodyInstance.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ResponseToChannels_DEPRECATED | FCollisionResponseContainer | Types of objects that this physics objects will collide with. | PhysicsEngine/BodyInstance.h |