Navigation
Unreal Engine C++ API Reference > Runtime > Engine > PhysicsEngine
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UPhysicsAsset
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
Type | Name | Description | |
---|---|---|---|
![]() |
uint8: 1 | bNotForDedicatedServer | If true, we skip instancing bodies for this PhysicsAsset on dedicated servers |
![]() |
TMap< FName, int32 > | BodySetupIndexMap | This caches the BodySetup Index by BodyName to speed up FindBodyIndex |
![]() |
TArray< int32 > | BoundsBodies | Index of bodies that are marked bConsiderForBounds |
![]() |
TMap< FRigidBodyIndexPair, bool > | CollisionDisableTable | Table indicating which pairs of bodies have collision disabled between them. |
![]() |
TArray< FName > | ConstraintProfiles | |
![]() |
TArray< TObjectPtr< class UPhysicsConstraintTemplate > > | ConstraintSetup | Array of RB_ConstraintSetup objects. |
![]() |
FName | CurrentConstraintProfileName | |
![]() |
FName | CurrentPhysicalAnimationProfileName | |
![]() |
TArray< FName > | PhysicalAnimationProfiles | |
![]() |
TSoftObjectPtr< class USkeletalMesh > | PreviewSkeletalMesh | |
![]() |
TArray< TObjectPtr< USkeletalBodySetup > > | SkeletalBodySetups | Array of SkeletalBodySetup objects. |
![]() |
FSolverIterations | SolverIterations | Old solver settings shown for reference. |
![]() |
FPhysicsAssetSolverSettings | SolverSettings | Solver settings when the asset is used with a RigidBody Anim Node (RBAN). |
![]() |
EPhysicsAssetSolverType | SolverType | Solver type used in physics asset editor. |
![]() |
TObjectPtr< class UThumbnailInfo > | ThumbnailInfo | Information for thumbnail rendering |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UPhysicsAsset
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | BodyFindConstraints
(
int32 BodyIndex, |
Find all the constraints that are connected to a particular body. |
![]() ![]() |
FBox | CalcAABB
(
const USkinnedMeshComponent* MeshComponent, |
|
![]() ![]() |
bool | CanCalculateValidAABB
(
const USkinnedMeshComponent* MeshComponent, |
Check if the Bounds can be calculate for the specified MeshComponent. |
![]() |
void | Clears physics meshes from all bodies | |
![]() ![]() |
void | DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
|
![]() |
void | DisableCollision
(
int32 BodyIndexA, |
Disable collsion between the bodies specified by index. |
![]() |
void | DrawConstraints
(
int32 ViewIndex, |
|
![]() |
void | EnableCollision
(
int32 BodyIndexA, |
Enable collsion between the bodies specified by index. |
![]() ![]() |
int32 | FindBodyIndex
(
FName BodyName |
|
![]() |
FName | FindConstraintBoneName
(
int32 ConstraintIndex |
|
![]() |
int32 | FindConstraintIndex
(
FName ConstraintName |
|
![]() |
int32 | FindConstraintIndex
(
FName Bone1Name, |
|
![]() |
int32 | FindControllingBodyIndex
(
USkeletalMesh* skelMesh, |
Find the index of the physics bone that is controlling this graphics bone. |
![]() |
int32 | FindMirroredBone
(
USkeletalMesh* skelMesh, |
|
![]() ![]() |
int32 | FindParentBodyIndex
(
USkeletalMesh* skelMesh, |
|
![]() |
void | GetBodyIndicesBelow
(
TArray< int32 >& OutBodyIndices, |
Utility for getting indices of all bodies below (and including) the one with the supplied name. |
![]() |
void | GetCollisionMesh
(
int32 ViewIndex, |
|
![]() |
FConstraintInstanceAccessor | GetConstraintByBoneNames
(
FName Bone1Name, |
Gets a constraint by its joint name |
![]() |
FConstraintInstanceAccessor | GetConstraintByName
(
FName ConstraintName |
Gets a constraint by its joint name |
![]() |
FConstraintInstanceAccessor | GetConstraintInstanceAccessorByIndex
(
int32 Index |
|
![]() |
FConstraintInstance * | GetConstraintInstanceByIndex
(
uint32 Index |
|
![]() ![]() |
const TArray< FName > & | ||
![]() |
void | GetConstraints
(
bool bIncludesTerminated, |
Gets all constraints |
![]() |
void | GetNearestBodyIndicesBelow
(
TArray< int32 >& OutBodyIndices, |
|
![]() ![]() |
const TArray< FName > & | ||
![]() ![]() |
ECollisionEnabled::Type | GetPrimitiveCollision
(
int32 BodyIndex, |
Get the per-primitive collision filtering mode for a body. |
![]() ![]() |
bool | GetPrimitiveContributeToMass
(
int32 BodyIndex, |
Get whether or not a primitive volume contributes to the mass of the object. |
![]() |
void | GetUsedMaterials
(
TArray< UMaterialInterface* >& Materials |
|
![]() |
void | Invalidates physics meshes from all bodies. Data will be rebuilt completely. | |
![]() ![]() |
bool | IsCollisionEnabled
(
int32 BodyIndexA, |
Check whether the two bodies specified are enabled for collision. |
![]() ![]() |
void | Update skeletal meshes when physics asset changes | |
![]() |
void | SetPrimitiveCollision
(
int32 BodyIndex, |
Get the per-primitive collision filtering mode for a body. |
![]() |
void | SetPrimitiveContributeToMass
(
int32 BodyIndex, |
Set whether or not a primitive volume contributes to the mass of the object. |
![]() |
void | Update the BodySetup Array Index Map. | |
![]() |
void | Update the BoundsBodies array and cache the indices of bodies marked with bConsiderForBounds to BoundsBodies array. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
void | GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
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 |
![]() ![]() |
FString | GetDesc () |
Returns a one line description of an object for viewing in the thumbnail view of the generic browser |
![]() ![]() |
void | GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
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). |
![]() ![]() ![]() |
EDataValidationResult | IsDataValid
(
FDataValidationContext& Context |
Generic function to validate objects during changelist validations, etc. |
![]() ![]() |
void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally |
![]() ![]() |
void | PostEditUndo () |
Called after applying a transaction to the object. |
![]() ![]() |
void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. |
![]() ![]() |
void | PreEditChange
(
FProperty* PropertyAboutToChange |
This is called when a property is about to be modified externally |
![]() ![]() |
void | Handles reading, writing, and reference collecting using FArchive. |
Overridden from IInterface_PreviewMeshProvider
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
USkeletalMesh * | Get the preview mesh for this asset | |
![]() ![]() |
void | SetPreviewMesh
(
USkeletalMesh* PreviewMesh, |
IPreviewMeshProviderInterface interface |
Typedefs
Name | Description |
---|---|
FRefreshPhysicsAssetChangeDelegate | Delegate fired when physics asset changes |
Constants
Name | Description |
---|---|
OnRefreshPhysicsAssetChange |
Deprecated Variables
Type | Name | Description | |
---|---|---|---|
![]() |
TObjectPtr< class USkeletalMesh > | DefaultSkelMesh_DEPRECATED | Default skeletal mesh to use when previewing this PhysicsAsset etc. |
See Also
https://docs.unrealengine.com/InteractiveExperiences/Physics/PhysicsAssetEditor