FBodyInstance

Container for a physics representation of an object

Windows
MacOS
Linux

Syntax

struct FBodyInstance

Remarks

Container for a physics representation of an object

Variables

Name Description

Public variable

FPhysicsActorHa...

 

ActorHandle

Internal physics representation of our body instance.

Public variable

float

 

AngularDamping

'Drag' force added to reduce angular movement

Public variable

uint8: 1

 

bAutoWeld

If true and is attached to a parent, the two bodies will be joined into a single rigid body.

Public variable

uint8: 1

 

bContactModification

Enable contact modification.

Public variable

uint8: 1

 

bEnableGravity

If object should have the force of gravity applied

Public variable

uint8: 1

 

bGenerateWakeEvents

Should 'wake/sleep' events fire when this object is woken up or put to sleep by the physics simulation.

Public variable

uint8: 1

 

bHACK_DisableCollisionResponse

: These are ONLY used when the 'p.EnableDynamicPerBodyFilterHacks' CVar is set (disabled by default).

Public variable

uint8: 1

 

bHACK_DisableSkelComponentFilterOverriding

By default, an owning skel mesh component will override the body's collision filter.

Protected variable

uint8: 1

 

bInterpolateWhenSubStepping

Internal flag to allow us to quickly check whether we should interpolate when substepping e.g. kinematic bodies that are QueryOnly do not need to interpolate as we will not be querying them at a sub-position.

Public variable

uint8: 1

 

bLockRotation

When a Locked Axis Mode is selected, will lock rotation to the specified axis

Public variable

uint8: 1

 

bLockTranslation

When a Locked Axis Mode is selected, will lock translation on the specified axis

Public variable

uint8: 1

 

bLockXRotation

Lock rotation about the X-axis

Public variable

uint8: 1

 

bLockXTranslation

Lock translation along the X-axis

Public variable

uint8: 1

 

bLockYRotation

Lock rotation about the Y-axis

Public variable

uint8: 1

 

bLockYTranslation

Lock translation along the Y-axis

Public variable

uint8: 1

 

bLockZRotation

Lock rotation about the Z-axis

Public variable

uint8: 1

 

bLockZTranslation

Lock translation along the Z-axis

Public variable

uint8: 1

 

bNotifyRigidBodyCollision

Should 'Hit' events fire when this object collides during physics simulation.

Public variable

TWeakObjectPtr<...

 

BodySetup

BodySetup pointer that this instance is initialized from

Public variable

uint8: 1

 

bOverrideMass

If true, mass will not be automatically computed and you must set it directly

Public variable

uint8: 1

 

bOverrideMaxAngularVelocity

Override the default max angular velocity

Protected variable

uint8: 1

 

bOverrideMaxDepenetrationVelocity

Whether this body instance has its own custom MaxDepenetrationVelocity

Protected variable

uint8: 1

 

bOverrideWalkableSlopeOnInstance

Whether this instance of the object has its own custom walkable slope override setting.

Protected variable

uint8: 1

 

bPendingCollisionProfileSetup

Whether we are pending a collision profile setup

Public variable

uint8: 1

 

bSimulatePhysics

If true, this body will use simulation.

Public variable

uint8: 1

 

bStartAwake

If object should start awake, or if it should initially be sleeping

Public variable

uint8: 1

 

bUpdateMassWhenScaleChanges

If true, it will update mass when scale changes

Public variable

uint8: 1

 

bUseCCD

If true Continuous Collision Detection (CCD) will be used for this component

Public variable

TSharedPtr< TAr...

 

CharDebugName

Public variable

FVector

 

COMNudge

User specified offset for the center of mass of this object, from the calculated location

Public variable

BodyInstanceSce...

 

CurrentSceneState

Current state of the physics body for tracking deferred addition and removal.

Public variable

FVector

 

CustomDOFPlaneNormal

Locks physical movement along a custom plane for a given normal.

Public variable

float

 

CustomSleepThresholdMultiplier

If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount.

Public variable

FConstraintInst...

 

DOFConstraint

Constraint used to allow for easy DOF setup per bodyinstance

Public variable

TEnumAsByte< ED...

 

DOFMode

Locks physical movement along specified axis.

Protected variable

TWeakObjectPtr<...

 

ExternalCollisionProfileBodySetup

The body setup holding the default body instance and its collision profile.

Public variable

FVector

 

InertiaTensorScale

Per-instance scaling of inertia (bigger number means it'll be harder to rotate)

Public variable

int32

 

InstanceBodyIndex

Index of this BodyInstance within the SkeletalMeshComponent/PhysicsAsset.

Public variable

int16

 

InstanceBoneIndex

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.

Public variable

float

 

LinearDamping

'Drag' force added to reduce linear movement

Protected variable

float

 

MassInKgOverride

Mass of the body in KG. By default we compute this based on physical material and mass scale.

Public variable

float

 

MassScale

Per-instance scaling of mass

Public variable

float

 

MaxAngularVelocity

The maximum angular velocity for this instance

Protected variable

float

 

MaxDepenetrationVelocity

The maximum velocity used to depenetrate this object

Public variable

FCalculateCusto...

 

OnCalculateCustomProjection

Custom projection for physics (callback to update component transform based on physics data)

Public variable

FRecalculatedMa...

 

OnRecalculatedMassProperties

Called whenever mass properties have been re-calculated.

Public variable

TWeakObjectPtr<...

 

OwnerComponent

PrimitiveComponent containing this body.

Public variable

float

 

PhysicsBlendWeight

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

Protected variable

UPhysicalMateri...

 

PhysMaterialOverride

Allows you to override the PhysicalMaterial to use for simple collision on this body.

Public variable

FPhysxUserData

 

PhysxUserData

#PHYS2 Rename, not just for physx now.

Public variable

int32

 

PositionSolverIterationCount

This physics body's solver iteration count for position.

Public variable

FVector

 

Scale3D

Current scale of physics - used to know when and how physics must be rescaled to match current transform of OwnerComponent.

Public variable

ESleepFamily

 

SleepFamily

The set of values used in considering when put this body to sleep.

Public variable

float

 

StabilizationThresholdMultiplier

Stabilization factor for this body if Physics stabilization is enabled.

Public variable

int32

 

VelocitySolverIterationCount

This physics body's solver iteration count for velocity.

Protected variable

FWalkableSlopeO...

 

WalkableSlopeOverride

Custom walkable slope override setting for this instance.

Public variable

FBodyInstance &...

 

WeldParent

The parent body that we are welded to

Constructors

Name Description

Public function

FBodyInstance()

Constructor

Functions

Name Description

Public function

void

 

AddAngularImpulseInRadians

(
    const FVector& Impulse,
    bool bVelChange
)

Add a rotational impulse to this body

Public function

void

 

AddCustomPhysics

(
    FCalculateCustomPhysics& Calculate...
)

Add custom forces and torques on the body.

Public function

void

 

AddForce

(
    const FVector& Force,
    bool bAllowSubstepping,
    bool bAccelChange
)

Add a force to this body

Public function

void

 

AddForceAtPosition

(
    const FVector& Force,
    const FVector& Position,
    bool bAllowSubstepping,
    bool bIsLocalForce
)

Add a force at a particular position (world space when bIsLocalForce = false, body space otherwise)

Public function

void

 

AddImpulse

(
    const FVector& Impulse,
    bool bVelChange
)

Add an impulse to this body

Public function

void

 

AddImpulseAtPosition

(
    const FVector& Impulse,
    const FVector& Position
)

Add an impulse to this body and a particular world position

Public function

void

 

AddRadialForceToBody

(
    const FVector& Origin,
    float Radius,
    float Strength,
    uint8 Falloff,
    bool bAccelChange,
    bool bAllowSubstepping
)

Add a force to this bodyinstance, originating from the supplied world-space location.

Public function

void

 

AddRadialImpulseToBody

(
    const FVector& Origin,
    float Radius,
    float Strength,
    uint8 Falloff,
    bool bVelChange
)

Add an impulse to this bodyinstance, radiating out from the specified position.

Public function

void

 

AddTorqueInRadians

(
    const FVector& Torque,
    bool bAllowSubstepping,
    bool bAccelChange
)

Add a torque to this body

Public function

void

 

ApplyDeferredCollisionProfileName()

Applies a deferred collision profile

Public function

void

 

ApplyMaterialToInstanceShapes_AssumesLocked

(
    UPhysicalMaterial* SimplePhysM...,
    TArray< UPhysicalMaterial* >&...
)

Note: This function is not thread safe.

Public function Static

void

 

ApplyMaterialToShape_AssumesLocked

(
    const FPhysicsShapeHandle& InShape,
    UPhysicalMaterial* SimplePhysM...,
    const TArrayView< UPhysicalMaterial...
)

Apply a material directly to the passed in shape.

Public function

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

Public function Static

void

 

BuildBodyCollisionFlags

(
    FBodyCollisionFlags& OutFlags,
    ECollisionEnabled::Type UseCollisio...,
    bool bUseComplexAsSimple
)

Build the flags to control which types of collision (sim and query) shapes owned by this BodyInstance should have.

Public function Const

void

 

BuildBodyFilterData

(
    FBodyCollisionFilterData& OutFilte...
)

Build the sim and query filter data (for simple and complex shapes) based on the settings of this BodyInstance (and its associated BodySetup)

Public function

void

 

ClearExternalCollisionProfile()

Public function

void

 

ClearForces

(
    bool bAllowSubstepping
)

Clear accumulated forces on this body

Public function

void

 

ClearTorques

(
    bool bAllowSubstepping
)

Clear accumulated torques on this body

Public function

void

 

CopyBodyInstancePropertiesFrom

(
    const FBodyInstance* FromInst
)

Utility for copying properties from one BodyInstance to another.

Public function

void

 

CopyRuntimeBodyInstancePropertiesFrom

(
    const FBodyInstance* FromInst
)

Utility for copying only the runtime instanced properties from one BodyInstance to another.

Public function

void

 

CreateDOFLock()

Public function Const

bool

 

DoesUseCollisionProfile()

Return true if it uses Collision Profile System. False otherwise

Public function

void

 

DrawCOMPosition

(
    FPrimitiveDrawInterface* PDI,
    float COMRenderSize,
    const FColor& COMRenderColor
)

Draws the center of mass as a wire star

Public function

void

 

FixupData

(
    UObject* Loader
)

UObject notification by OwningComponent

Public function Const

const FPhysi...

 

GetActorReferenceWithWelding()

Public function Const

int32

 

GetAllShapes_AssumesLocked

(
    TArray< FPhysicsShapeHandle >& Out...
)

Utility to get all the shapes from a FBodyInstance NOTE: This function is not thread safe.

Public function Const

FBox

 

GetBodyBounds()

Return bounds of physics representation

Public function Const

FString

 

GetBodyDebugName()

Get the name for this body, for use in debugging

Public function Const

FVector

 

GetBodyInertiaTensor()

Return the body's inertia tensor. This is returned in local mass space

Public function Const

void

 

GetBodyInstanceResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

Returns memory used by resources allocated for this body instance ( ex. physics resources )

Public function Const

float

 

GetBodyMass()

Returns the body's mass

Public function Const

ECollisionEn...

 

GetCollisionEnabled

(
    bool bCheckOwner
)

Get the current type of collision enabled

Public function Const

FName

 

GetCollisionProfileName()

Returns the collision profile name that will be used.

Public function Const

const FColli...

 

GetCollisionResponse()

Public function Static

void

 

GetComplexPhysicalMaterials

(
    const FBodyInstance* BodyInsta...,
    TWeakObjectPtr< UPrimitiveComponent...,
    TArray< UPhysicalMaterial* >&...
)

Find the correct PhysicalMaterial for simple geometry on a given body and owner.

Public function Const

TArray< UPhy...

 

GetComplexPhysicalMaterials()

Get the complex PhysicalMaterial array for this body

Public function Const

void

 

GetComplexPhysicalMaterials

(
    TArray< UPhysicalMaterial* >&...
)

Get the complex PhysicalMaterials for this body

Public function Const

FVector

 

GetCOMPosition()

Returns the center of mass of this body (in world space)

Public function Const

const TMap< ...

 

GetCurrentWeldInfo()

Public function Const

float

 

GetDistanceToBody

(
    const FVector& Point,
    FVector& OutPointOnBody
)

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

Public function Const

FVector

 

GetLockedAxis()

Public function Const

FMaskFilter

 

GetMaskFilter()

Return the ignore mask filter.

Public function Const

float

 

GetMassOverride()

Returns the mass override. See MassInKgOverride for documentation

Public function Const

FTransform

 

GetMassSpaceLocal()

Public function Const

FTransform

 

GetMassSpaceToWorldSpace()

Returns the mass coordinate system to world space transform (position is world center of mass, rotation is world inertia orientation)

Public function Const

float

 

GetMaxAngularVelocityInRadians()

Get the maximum angular velocity of this body

Public function Const

ECollisionCh...

 

GetObjectType()

Get the movement channel of this body

Public function Const

const FBodyI...

 

GetOriginalBodyInstance

(
    const FPhysicsShapeHandle& InShape
)

Returns the original owning body instance. This is needed for welding

Public function Const

const FPhysi...

 

GetPhysicsActorHandle()

Public function

FPhysicsActo...

 

GetPhysicsActorHandle()

Public function Const

FPhysScene &...

 

GetPhysicsScene()

Get the scene that owns this body.

Public function Const

const FTrans...

 

GetRelativeBodyTransform

(
    const FPhysicsShapeHandle& InShape
)

Returns the relative transform between root body and welded instance owned by the shape.

Public function Const

ECollisionRe...

 

GetResponseToChannel

(
    ECollisionChannel Channel
)

Get the collision response of this body to a particular channel

Public function Const

const FColli...

 

GetResponseToChannels()

Get Collision ResponseToChannels container for this component

Public function

bool

 

GetRigidBodyState

(
    FRigidBodyState& OutState
)

Public function Static

UPhysicalMat...

 

GetSimplePhysicalMaterial

(
    const FBodyInstance* BodyInsta...,
    TWeakObjectPtr< UPrimitiveComponent...,
    TWeakObjectPtr< UBodySetup > BodySe...
)

Find the correct PhysicalMaterial for simple geometry on a given body and owner.

Public function Const

UPhysicalMat...

 

GetSimplePhysicalMaterial()

Find the correct PhysicalMaterial for simple geometry on this body

Public function Const

float

 

GetSleepThresholdMultiplier()

Gets the multiplier to the threshold where the body will go to sleep automatically.

Public function Const

bool

 

GetSquaredDistanceToBody

(
    const FVector& Point,
    float& OutDistanceSquared,
    FVector& OutPointOnBody
)

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

Public function Const

FVector

 

GetUnrealWorldAngularVelocityInRadians()

Get current angular velocity in world space from physics body.

Public function Const

FVector

 

GetUnrealWorldAngularVelocityInRadians_AssumesLocked()

Get current angular velocity in world space from physics body.

Public function Const

FTransform

 

GetUnrealWorldTransform

(
    bool bWithProjection,
    bool bForceGlobalPose
)

Get current transform in world space from physics body.

Public function Const

FTransform

 

GetUnrealWorldTransform_AssumesLocked

(
    bool bWithProjection,
    bool bForceGlobalPose
)

Get current transform in world space from physics body.

Public function Const

FVector

 

GetUnrealWorldVelocity()

Get current velocity in world space from physics body.

Public function Const

FVector

 

GetUnrealWorldVelocity_AssumesLocked()

Get current velocity in world space from physics body.

Public function Const

FVector

 

GetUnrealWorldVelocityAtPoint

(
    const FVector& Point
)

Get current velocity of a point on this physics body, in world space.

Public function Const

FVector

 

GetUnrealWorldVelocityAtPoint_AssumesLocked

(
    const FVector& Point
)

Get current velocity of a point on this physics body, in world space.

Public function Const

const FWalka...

 

GetWalkableSlopeOverride()

Returns the slope override struct for this instance.

Public function

void

 

InitBody

(
    UBodySetup* Setup,
    const FTransform& Transform,
    UPrimitiveComponent* PrimComp,
    FPhysScene* InRBScene,
    const FInitBodySpawnParams& SpawnP...
)

Initialise a single rigid body (this FBodyInstance) for the given body setup

Public function

void

 

InitBody

(
    UBodySetup* Setup,
    const FTransform& Transform,
    UPrimitiveComponent* PrimComp,
    FPhysScene* InRBScene
)

Public function

void

 

InitDynamicProperties_AssumesLocked()

Initialise dynamic properties for this instance when using physics - this must be done after scene addition.

Public function Static

void

 

InitStaticBodies

(
    const TArray< FBodyInstance* >...,
    const TArray< FTransform >& Transf...,
    UBodySetup* BodySetup,
    UPrimitiveComponent* Primitive...,
    FPhysScene* InRBScene
)

Standalone path to batch initialize large amounts of static bodies, which will be deferred till the next scene update for fast scene addition.

Public function Const

bool

 

IsDynamic()

Returns true if the body is not static

Public function Const

bool

 

IsInstanceAwake()

Returns whether this body is awake

Public function Const

bool

 

IsInstanceSimulatingPhysics()

Returns true if this body is simulating, false if it is fixed (kinematic)

Public function Const

bool

 

IsNonKinematic()

Returns true if the body is non kinematic

Public function Const

bool

 

IsShapeBoundToBody

(
    const FPhysicsShapeHandle& Shape
)

Check if the shape is owned by this body instance

Public function Const

bool

 

IsValidBodyInstance()

See if this body is valid.

Public function Const

bool

 

LineTrace

(
    FHitResult& OutHit,
    const FVector& Start,
    const FVector& End,
    bool bTraceComplex,
    bool bReturnPhysicalMaterial
)

Trace a ray against just this bodyinstance

Public function

void

 

LoadProfileData

(
    bool bVerifyProfile
)

Update profile data if required

Public function Const

bool

 

OverlapMulti

(
    TArray< struct FOverlapResult >& I...,
    const UWorld* World,
    const FTransform* pWorldToComp...,
    const FVector& Pos,
    const FRotator& Rot,
    ECollisionChannel TestChannel,
    const FComponentQueryParams& Param...,
    const FCollisionResponseParams& Re...,
    const FCollisionObjectQueryParams&...
)

Determines the set of components that this body instance would overlap with at the supplied location/rotation

Public function Const

bool

 

OverlapMulti

(
    TArray< struct FOverlapResult >& I...,
    const UWorld* World,
    const FTransform* pWorldToComp...,
    const FVector& Pos,
    const FQuat& Rot,
    ECollisionChannel TestChannel,
    const FComponentQueryParams& Param...,
    const FCollisionResponseParams& Re...,
    const FCollisionObjectQueryParams&...
)

Determines the set of components that this body instance would overlap with at the supplied location/rotation

Public function Const

bool

 

OverlapTest

(
    const FVector& Position,
    const FQuat& Rotation,
    const FCollisionShape& CollisionSh...,
    FMTDResult* OutMTD
)

Test if the bodyinstance overlaps with the specified shape at the specified position/rotation

Public function Const

bool

 

OverlapTestForBodies

(
    const FVector& Position,
    const FQuat& Rotation,
    const TArray< FBodyInstance* >...
)

Test if the bodyinstance overlaps with the specified body instances

Public function Const

bool

 

OverlapTestForBody

(
    const FVector& Position,
    const FQuat& Rotation,
    FBodyInstance* Body
)

Public function

void

 

PostShapeChange()

After adding/removing shapes call this function to update mass distribution etc...

Public function

void

 

PutInstanceToSleep()

Force this body to sleep

Public function

void

 

ReplaceResponseToChannels

(
    ECollisionResponse OldResponse,
    ECollisionResponse NewResponse
)

Replace the channels on this body matching the old response with the new response

Public function Static

EDOFMode::Ty...

 

ResolveDOFMode

(
    EDOFMode::Type DOFMode
)

Public function

void

 

SetAngularVelocityInRadians

(
    const FVector& NewAngVel,
    bool bAddToCurrent,
    bool bAutoWake
)

Set the angular velocity of this body

Note NewAngVel is in degrees per second

Public function

void

 

SetBodyTransform

(
    const FTransform& NewTransform,
    ETeleportType Teleport,
    bool bAutoWake
)

Move the physics body to a new pose.

Public function

void

 

SetCollisionEnabled

(
    ECollisionEnabled::Type NewType,
    bool bUpdatePhysicsFilterData
)

Controls what kind of collision is enabled for this body and allows optional disable physics rebuild

Public function

void

 

SetCollisionProfileName

(
    FName InCollisionProfileName
)

Set Collision Profile Name This function should be called outside of constructors to set profile name.

Public function

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.

Public function

void

 

SetContactModification

(
    bool bNewContactModification
)

Enables/disables contact modification

Public function

void

 

SetContactReportForceThreshold

(
    float Threshold
)

Set a new contact report force threhold. Threshold < 0 disables this feature.

Public function

void

 

SetDOFLock

(
    EDOFMode::Type NewDOFMode
)

Locks physical movement along axis.

Public function

void

 

SetEnableGravity

(
    bool bGravityEnabled
)

Enables/disables whether this body is affected by gravity.

Public function

void

 

SetInstanceNotifyRBCollision

(
    bool bNewNotifyCollision
)

Set whether we should get a notification about physics collisions

Public function

void

 

SetInstanceSimulatePhysics

(
    bool bSimulate,
    bool bMaintainPhysicsBlending
)

Set this body to be fixed (kinematic) or not.

Public function

void

 

SetLinearVelocity

(
    const FVector& NewVel,
    bool bAddToCurrent,
    bool bAutoWake
)

Set the linear velocity of this body

Public function

void

 

SetMaskFilter

(
    FMaskFilter InMaskFilter
)

Updates the mask filter.

Public function

void

 

SetMassOverride

(
    float MassInKG,
    bool bNewOverrideMass
)

Sets the mass override

Public function

void

 

SetMassScale

(
    float InMassScale
)

Modify the mass scale of this body

Public function

void

 

SetMassSpaceLocal

(
    const FTransform& NewMassSpaceLoca...
)

TODO: this only works at runtime when the physics state has been created.

Public function

void

 

SetMaxAngularVelocityInRadians

(
    float NewMaxAngVel,
    bool bAddToCurrent,
    bool bUpdateOverrideMaxAngularVeloc...
)

Set the maximum angular velocity of this body

Public function

void

 

SetMaxDepenetrationVelocity

(
    float MaxVelocity
)

Set the maximum depenetration velocity the physics simulation will introduce

Public function

void

 

SetObjectType

(
    ECollisionChannel Channel
)

Set the movement channel of this body to the one supplied

Public function

void

 

SetPhysMaterialOverride

(
    UPhysicalMaterial* NewPhysMate...
)

Set physical material override for this body

Public function

void

 

SetResponseToAllChannels

(
    ECollisionResponse NewResponse
)

Set the response of this body to all channels

Public function

void

 

SetResponseToChannel

(
    ECollisionChannel Channel,
    ECollisionResponse NewResponse
)

Set the collision response of this body to a particular channel

Public function

void

 

SetResponseToChannels

(
    const FCollisionResponseContainer&...
)

Set the response of this body to the supplied settings

Public function

void

 

SetUseCCD

(
    bool bInUseCCD
)

Enable/disable Continuous Collidion Detection feature

Public function

void

 

SetWalkableSlopeOverride

(
    const FWalkableSlopeOverride& NewO...
)

Sets a custom slope override struct for this instance.

Public function Const

bool

 

ShouldInstanceSimulatingPhysics()

Should Simulate Physics

Public function Const

bool

 

ShouldInterpolateWhenSubStepping()

Whether we should interpolate when substepping.

Public function Const

bool

 

Sweep

(
    FHitResult& OutHit,
    const FVector& Start,
    const FVector& End,
    const FQuat& ShapeWorldRotation,
    const FCollisionShape& Shape,
    bool bTraceComplex
)

Trace a shape against just this bodyinstance

Public function

void

 

TermBody

(
    bool bNeverDeferRelease
)

Terminates the body, releasing resources Clean up the physics engine info for this instance.

Public function

void

 

UnWeld

(
    FBodyInstance* Body
)

Takes a welded body and unwelds it.

Public function

bool

 

UpdateBodyScale

(
    const FVector& InScale3D,
    bool bForceUpdate
)

Update Body Scale

Public function

void

 

UpdateDampingProperties()

Update instance's linear and angular damping

Public function

void

 

UpdateInstanceSimulatePhysics()

Makes sure the current kinematic state matches the simulate flag

Protected function

void

 

UpdateInterpolateWhenSubStepping()

Update the substepping interpolation flag

Public function

void

 

UpdateMassProperties()

Update instance's mass properties (mass, inertia and center-of-mass offset) based on MassScale, InstanceMassScale and COMNudge.

Public function

void

 

UpdatePhysicalMaterials()

Update the instance's material properties (friction, restitution)

Public function

void

 

UpdatePhysicsFilterData()

Update the instances collision filtering data

Public function

void

 

UpdateTriMeshVertices

(
    const TArray< FVector >& NewPositi...
)

Dynamically update the vertices of per-poly collision for this body.

Public function

void

 

UseExternalCollisionProfile

(
    UBodySetup* InExternalCollisio...
)

Use the collision profile found in the given BodySetup's default BodyInstance

Public function Static

bool

 

ValidateTransform

(
    const FTransform& Transform,
    const FString& DebugName,
    const UBodySetup* Setup
)

Validate a body transform, outputting debug info

Public function

void

 

WakeInstance()

Wake this body

Public function

bool

 

Weld

(
    FBodyInstance* Body,
    const FTransform& RelativeTM
)

Takes two body instances and welds them together to create a single simulated rigid body.

Classes

Name

Description

Public struct

FInitBodySpawnParams

Helper struct to specify spawn behavior

Public struct

FWeldInfo

Deprecated Variables

Name Description

Public variable

FCollisionRespo...

 

ResponseToChannels_DEPRECATED

Types of objects that this physics objects will collide with.

References

Module

Engine

Header

Runtime/Engine/Classes/PhysicsEngine/BodyInstance.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback