Navigation
API > API/Runtime > API/Runtime/Engine
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.
| Name | UPhysicsAsset |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/PhysicsEngine/PhysicsAsset.h |
| Include Path | #include "PhysicsEngine/PhysicsAsset.h" |
Syntax
UCLASS (HideCategories=Object, BlueprintType, MinimalAPI, Config=Game, PerObjectConfig,
AutoCollapseCategories=(OldSolverSettings))
class UPhysicsAsset :
public UObject ,
public IInterface_PreviewMeshProvider ,
public IInterface_AssetUserData
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UPhysicsAsset
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPhysicsAsset
(
const FObjectInitializer& ObjectInitializer |
PhysicsEngine/PhysicsAsset.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FRefreshPhysicsAssetChangeDelegate | TMulticastDelegate_OneParam< void, const UPhysicsAsset * > | Delegate fired when physics asset changes | PhysicsEngine/PhysicsAsset.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| OnRefreshPhysicsAssetChange | FRefreshPhysicsAssetChangeDelegate | PhysicsEngine/PhysicsAsset.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bNotForDedicatedServer | uint8 | If true, we skip instancing bodies for this PhysicsAsset on dedicated servers | PhysicsEngine/PhysicsAsset.h |
|
| BodySetupIndexMap | TMap< FName, int32 > | This caches the BodySetup Index by BodyName to speed up FindBodyIndex | PhysicsEngine/PhysicsAsset.h | |
| BoundsBodies | TArray< int32 > | Index of bodies that are marked bConsiderForBounds | PhysicsEngine/PhysicsAsset.h | |
| CollisionDisableTable | TMap< FRigidBodyIndexPair, bool > | Table indicating which pairs of bodies have collision disabled between them. | PhysicsEngine/PhysicsAsset.h | |
| ConstraintProfiles | TArray< FName > | PhysicsEngine/PhysicsAsset.h |
|
|
| ConstraintSetup | TArray< TObjectPtr< class UPhysicsConstraintTemplate > > | Array of RB_ConstraintSetup objects. | PhysicsEngine/PhysicsAsset.h |
|
| CurrentConstraintProfileName | FName | PhysicsEngine/PhysicsAsset.h |
|
|
| CurrentPhysicalAnimationProfileName | FName | PhysicsEngine/PhysicsAsset.h |
|
|
| EditorBodyFlags | TArray< int32 > | A set of flags for each physics body. Used to store persistent per body editor data. | PhysicsEngine/PhysicsAsset.h | |
| PhysicalAnimationProfiles | TArray< FName > | PhysicsEngine/PhysicsAsset.h |
|
|
| PreviewSkeletalMesh | TSoftObjectPtr< class USkeletalMesh > | PhysicsEngine/PhysicsAsset.h |
|
|
| SkeletalBodySetups | TArray< TObjectPtr< USkeletalBodySetup > > | Array of SkeletalBodySetup objects. | PhysicsEngine/PhysicsAsset.h |
|
| SolverIterations | FSolverIterations | Old solver settings shown for reference. | PhysicsEngine/PhysicsAsset.h |
|
| SolverSettings | FPhysicsAssetSolverSettings | Solver settings when the asset is used with a RigidBody Anim Node (RBAN). | PhysicsEngine/PhysicsAsset.h |
|
| SolverType | EPhysicsAssetSolverType | Solver type used in physics asset editor. | PhysicsEngine/PhysicsAsset.h |
|
| ThumbnailInfo | TObjectPtr< class UThumbnailInfo > | Information for thumbnail rendering | PhysicsEngine/PhysicsAsset.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AssetUserData | TArray< TObjectPtr< UAssetUserData > > | PhysicsEngine/PhysicsAsset.h |
|
|
| PreConstraintProfiles | TArray< FName > | PhysicsEngine/PhysicsAsset.h | ||
| PrePhysicalAnimationProfiles | TArray< FName > | Editor only arrays that are used for rename operations in pre/post edit change | PhysicsEngine/PhysicsAsset.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BodyFindConstraints
(
int32 BodyIndex, |
Find all the constraints that are connected to a particular body. | PhysicsEngine/PhysicsAsset.h | |
FBox CalcAABB
(
const USkinnedMeshComponent* MeshComponent, |
PhysicsEngine/PhysicsAsset.h | ||
bool CanCalculateValidAABB
(
const USkinnedMeshComponent* MeshComponent, |
Check if the Bounds can be calculate for the specified MeshComponent. | PhysicsEngine/PhysicsAsset.h | |
void ClearAllPhysicsMeshes() |
Clears physics meshes from all bodies | PhysicsEngine/PhysicsAsset.h | |
void DisableCollision
(
int32 BodyIndexA, |
Disable collsion between the bodies specified by index. | PhysicsEngine/PhysicsAsset.h | |
void DrawConstraints
(
int32 ViewIndex, |
PhysicsEngine/PhysicsAsset.h | ||
void EnableCollision
(
int32 BodyIndexA, |
Enable collsion between the bodies specified by index. | PhysicsEngine/PhysicsAsset.h | |
int32 FindBodyIndex
(
FName BodyName |
PhysicsEngine/PhysicsAsset.h | ||
FName FindConstraintBoneName
(
int32 ConstraintIndex |
PhysicsEngine/PhysicsAsset.h | ||
int32 FindConstraintIndex
(
FName Bone1Name, |
PhysicsEngine/PhysicsAsset.h | ||
int32 FindConstraintIndex
(
FName ConstraintName |
PhysicsEngine/PhysicsAsset.h | ||
int32 FindControllingBodyIndex
(
const USkeletalMesh* skelMesh, |
Find the index of the physics bone that is controlling this graphics bone. | PhysicsEngine/PhysicsAsset.h | |
int32 FindMirroredBone
(
const USkeletalMesh* skelMesh, |
PhysicsEngine/PhysicsAsset.h | ||
int32 FindParentBodyIndex
(
const FReferenceSkeleton& RefSkeleton, |
PhysicsEngine/PhysicsAsset.h | ||
int32 FindParentBodyIndex
(
const USkeletalMesh* skelMesh, |
PhysicsEngine/PhysicsAsset.h | ||
void GetBodyIndicesBelow
(
TArray< int32 >& OutBodyIndices, |
Utility for getting indices of all bodies below (and including) the one with the supplied name. | PhysicsEngine/PhysicsAsset.h | |
void GetBodyIndicesBelow
(
TArray< int32 >& OutBodyIndices, |
PhysicsEngine/PhysicsAsset.h | ||
void GetCollisionMesh
(
int32 ViewIndex, |
PhysicsEngine/PhysicsAsset.h | ||
FConstraintInstanceAccessor GetConstraintByBoneNames
(
FName Bone1Name, |
Gets a constraint by its joint name | PhysicsEngine/PhysicsAsset.h |
|
FConstraintInstanceAccessor GetConstraintByName
(
FName ConstraintName |
Gets a constraint by its joint name | PhysicsEngine/PhysicsAsset.h |
|
FConstraintInstanceAccessor GetConstraintInstanceAccessorByIndex
(
int32 Index |
PhysicsEngine/PhysicsAsset.h | ||
FConstraintInstance * GetConstraintInstanceByIndex
(
uint32 Index |
PhysicsEngine/PhysicsAsset.h | ||
| PhysicsEngine/PhysicsAsset.h | |||
void GetConstraints
(
bool bIncludesTerminated, |
Gets all constraints | PhysicsEngine/PhysicsAsset.h |
|
void GetNearestBodyIndicesBelow
(
TArray< int32 >& OutBodyIndices, |
PhysicsEngine/PhysicsAsset.h | ||
| PhysicsEngine/PhysicsAsset.h | |||
ECollisionEnabled::Type GetPrimitiveCollision
(
int32 BodyIndex, |
Get the per-primitive collision filtering mode for a body. | PhysicsEngine/PhysicsAsset.h | |
bool GetPrimitiveContributeToMass
(
int32 BodyIndex, |
Get whether or not a primitive volume contributes to the mass of the object. | PhysicsEngine/PhysicsAsset.h | |
void GetUsedMaterials
(
TArray< UMaterialInterface* >& Materials |
PhysicsEngine/PhysicsAsset.h | ||
void InvalidateAllPhysicsMeshes() |
Invalidates physics meshes from all bodies. Data will be rebuilt completely. | PhysicsEngine/PhysicsAsset.h | |
bool IsCollisionEnabled
(
int32 BodyIndexA, |
Check whether the two bodies specified are enabled for collision. | PhysicsEngine/PhysicsAsset.h | |
void RefreshPhysicsAssetChange() |
Update skeletal meshes when physics asset changes | PhysicsEngine/PhysicsAsset.h | |
void SetPrimitiveCollision
(
int32 BodyIndex, |
Get the per-primitive collision filtering mode for a body. | PhysicsEngine/PhysicsAsset.h | |
void SetPrimitiveContributeToMass
(
int32 BodyIndex, |
Set whether or not a primitive volume contributes to the mass of the object. | PhysicsEngine/PhysicsAsset.h | |
void UpdateBodySetupIndexMap() |
Update the BodySetup Array Index Map. | PhysicsEngine/PhysicsAsset.h | |
void UpdateBoundsBodiesArray() |
Update the BoundsBodies array and cache the indices of bodies marked with bConsiderForBounds to BoundsBodies array. | PhysicsEngine/PhysicsAsset.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
PhysicsEngine/PhysicsAsset.h | ||
virtual void GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
PhysicsEngine/PhysicsAsset.h | ||
virtual FString GetDesc() |
Returns a one line description of an object for viewing in the thumbnail view of the generic browser | PhysicsEngine/PhysicsAsset.h | |
virtual void GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
PhysicsEngine/PhysicsAsset.h | ||
virtual EDataValidationResult IsDataValid
(
FDataValidationContext& Context |
PhysicsEngine/PhysicsAsset.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
PhysicsEngine/PhysicsAsset.h | ||
virtual void PostEditUndo() |
PhysicsEngine/PhysicsAsset.h | ||
virtual void PostLoad() |
PhysicsEngine/PhysicsAsset.h | ||
virtual void PreEditChange
(
FProperty* PropertyThatWillChange |
PhysicsEngine/PhysicsAsset.h | ||
virtual void Serialize
(
FArchive& Ar |
PhysicsEngine/PhysicsAsset.h |
Overridden from IInterface_PreviewMeshProvider
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual USkeletalMesh * GetPreviewMesh() |
Get the preview mesh for this asset | PhysicsEngine/PhysicsAsset.h | |
virtual void SetPreviewMesh
(
USkeletalMesh* PreviewMesh, |
IPreviewMeshProviderInterface interface | PhysicsEngine/PhysicsAsset.h |
Overridden from IInterface_AssetUserData
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddAssetUserData
(
UAssetUserData* InUserData |
Asset User Data. | PhysicsEngine/PhysicsAsset.h | |
virtual const TArray< UAssetUserData * > * GetAssetUserDataArray() |
PhysicsEngine/PhysicsAsset.h | ||
virtual UAssetUserData * GetAssetUserDataOfClass
(
TSubclassOf< UAssetUserData > InUserDataClass |
Returns an instance of the provided AssetUserData class if it's contained in the target asset. | PhysicsEngine/PhysicsAsset.h | |
virtual void RemoveUserDataOfClass
(
TSubclassOf< UAssetUserData > InUserDataClass |
PhysicsEngine/PhysicsAsset.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
PhysicsEngine/PhysicsAsset.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DefaultSkelMesh_DEPRECATED | TObjectPtr< class USkeletalMesh > | Default skeletal mesh to use when previewing this PhysicsAsset etc. | PhysicsEngine/PhysicsAsset.h |