UPhysicsAsset

PhysicsAsset contains a set of rigid bodies and constraints that make up a single ragdoll.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/PhysicsAsset.h

Include

#include "PhysicsEngine/PhysicsAsset.h"

Syntax

class UPhysicsAsset :
    public UObject,
    public IInterface_PreviewMeshProvider

Remarks

PhysicsAsset contains a set of rigid bodies and constraints that make up a single ragdoll. The asset is not limited to human ragdolls, and can be used for any physical simulation using bodies and constraints. A SkeletalMesh has a single PhysicsAsset, which allows for easily turning ragdoll physics on or off for many SkeletalMeshComponents The asset can be configured inside the Physics Asset Editor.

Variables

Name Description

Public variable

uint8: 1

 

bNotForDedicatedServer

If true, we skip instancing bodies for this PhysicsAsset on dedicated servers

Public variable

TMap< FName, in...

 

BodySetupIndexMap

This caches the BodySetup Index by BodyName to speed up FindBodyIndex

Public variable

TArray< int32 >

 

BoundsBodies

Index of bodies that are marked bConsiderForBounds

Public variable

TMap< FRigidBod...

 

CollisionDisableTable

Table indicating which pairs of bodies have collision disabled between them.

Public variable

TArray< FName >

 

ConstraintProfiles

Public variable

TArray< class U...

 

ConstraintSetup

Array of RB_ConstraintSetup objects.

Public variable

FName

 

CurrentConstraintProfileName

Public variable

FName

 

CurrentPhysicalAnimationProfileName

Public variable

TArray< FName >

 

PhysicalAnimationProfiles

Public variable

TSoftObjectPtr<...

 

PreviewSkeletalMesh

Public variable

TArray< USkelet...

 

SkeletalBodySetups

Array of SkeletalBodySetup objects.

Public variable

UThumbnailInfo ...

 

ThumbnailInfo

Information for thumbnail rendering

Constructors

Name Description

Public function

UPhysicsAsset

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

BodyFindConstraints

(
    int32 BodyIndex,
    TArray< int32 >& Constraints
)

Find all the constraints that are connected to a particular body.

Public function Const

FBox

 

CalcAABB

(
    const USkinnedMeshComponent* M...,
    const FTransform& LocalToWorld
)

Public function Const

bool

 

CanCalculateValidAABB

(
    const USkinnedMeshComponent* M...,
    const FTransform& LocalToWorld
)

Check if the Bounds can be calculate for the specified MeshComponent.

Public function

void

 

ClearAllPhysicsMeshes()

Clears physics meshes from all bodies

Public function

void

 

DisableCollision

(
    int32 BodyIndexA,
    int32 BodyIndexB
)

Disable collsion between the bodies specified by index.

Public function

void

 

DrawConstraints

(
    int32 ViewIndex,
    FMeshElementCollector& Collector,
    const USkeletalMesh* SkelMesh,
    const TArray< FTransform >& SpaceB...,
    const FTransform& LocalToWorld,
    float Scale
)

Public function

void

 

EnableCollision

(
    int32 BodyIndexA,
    int32 BodyIndexB
)

Enable collsion between the bodies specified by index.

Public function Const

int32

 

FindBodyIndex

(
    FName BodyName
)

Public function

FName

 

FindConstraintBoneName

(
    int32 ConstraintIndex
)

Public function

int32

 

FindConstraintIndex

(
    FName ConstraintName
)

Public function

int32

 

FindControllingBodyIndex

(
    USkeletalMesh* skelMesh,
    int32 BoneIndex
)

Find the index of the physics bone that is controlling this graphics bone.

Public function

int32

 

FindMirroredBone

(
    USkeletalMesh* skelMesh,
    int32 BoneIndex
)

Public function Const

int32

 

FindParentBodyIndex

(
    USkeletalMesh* skelMesh,
    int32 StartBoneIndex
)

Public function

void

 

GetBodyIndicesBelow

(
    TArray< int32 >& OutBodyIndices,
    FName InBoneName,
    USkeletalMesh* InSkelMesh,
    bool bIncludeParent
)

Utility for getting indices of all bodies below (and including) the one with the supplied name.

Public function

void

 

GetCollisionMesh

(
    int32 ViewIndex,
    FMeshElementCollector& Collector,
    const USkeletalMesh* SkelMesh,
    const TArray< FTransform >& SpaceB...,
    const FTransform& LocalToWorld,
    const FVector& Scale3D
)

Public function Const

const TArray...

 

GetConstraintProfileNames()

Public function

void

 

GetNearestBodyIndicesBelow

(
    TArray< int32 >& OutBodyIndices,
    FName InBoneName,
    USkeletalMesh* InSkelMesh
)

Public function Const

const TArray...

 

GetPhysicalAnimationProfileNames()

Public function

void

 

GetUsedMaterials

(
    TArray< UMaterialInterface* > ...
)

Public function

void

 

InvalidateAllPhysicsMeshes()

Invalidates physics meshes from all bodies. Data will be rebuilt completely.

Public function Const

bool

 

IsCollisionEnabled

(
    int32 BodyIndexA,
    int32 BodyIndexB
)

Check whether the two bodies specified are enabled for collision.

Public function Const

void

 

RefreshPhysicsAssetChange()

Update skeletal meshes when physics asset changes

Public function

void

 

UpdateBodySetupIndexMap()

Update the BodySetup Array Index Map.

Public function

void

 

UpdateBoundsBodiesArray()

Update the BoundsBodies array and cache the indices of bodies marked with bConsiderForBounds to BoundsBodies array.

Overridden from UObject

Name Description

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects

Public function Virtual

FString

 

GetDesc()

Returns a one line description of an object for viewing in the thumbnail view of the generic browser

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific).

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

PreEditChange

(
    UProperty* PropertyAboutToChan...
)

This is called when a property is about to be modified externally

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from IInterface_PreviewMeshProvider

Name Description

Public function Virtual Const

USkeletalMes...

 

GetPreviewMesh()

Get the preview mesh for this asset

Public function Virtual

void

 

SetPreviewMesh

(
    USkeletalMesh* PreviewMesh,
    bool bMarkAsDirty
)

IPreviewMeshProviderInterface interface

Typedefs

Name

Description

FRefreshPhysicsAssetChangeDelegate

Delegate fired when physics asset changes

Constants

Name

Description

OnRefreshPhysicsAssetChange

Deprecated Variables

Name Description

Public variable

USkeletalMesh &...

 

DefaultSkelMesh_DEPRECATED

Default skeletal mesh to use when previewing this PhysicsAsset etc.

See Also

Select Skin
Light
Dark

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