Choose your operating system:
Windows
macOS
Linux
| FBodyInstanceCore
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/BodyInstance.h |
Include |
#include "PhysicsEngine/BodyInstance.h" |
struct FBodyInstance : public FBodyInstanceCore
Container for a physics representation of an object
Name | Description | ||
---|---|---|---|
|
FPhysicsActorHa... |
ActorHandle |
Internal physics representation of our body instance. |
|
float |
AngularDamping |
'Drag' force added to reduce angular movement |
|
uint8: 1 |
bContactModification |
Enable contact modification. |
|
uint8: 1 |
bHACK_DisableCollisionResponse |
: These are ONLY used when the 'p.EnableDynamicPerBodyFilterHacks' CVar is set (disabled by default). |
|
uint8: 1 |
bHACK_DisableSkelComponentFilterOverriding |
By default, an owning skel mesh component will override the body's collision filter. |
|
uint8: 1 |
bIgnoreAnalyticCollisions |
If true ignore analytic collisions and treat objects as a general implicit surface |
|
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. |
|
uint8: 1 |
bLockRotation |
[Physx Only] When a Locked Axis Mode is selected, will lock rotation to the specified axis |
|
uint8: 1 |
bLockTranslation |
[Physx Only] When a Locked Axis Mode is selected, will lock translation on the specified axis |
|
uint8: 1 |
bLockXRotation |
[Physx Only] Lock rotation about the X-axis |
|
uint8: 1 |
bLockXTranslation |
[Physx Only] Lock translation along the X-axis |
|
uint8: 1 |
bLockYRotation |
[Physx Only] Lock rotation about the Y-axis |
|
uint8: 1 |
bLockYTranslation |
[Physx Only] Lock translation along the Y-axis |
|
uint8: 1 |
bLockZRotation |
[Physx Only] Lock rotation about the Z-axis |
|
uint8: 1 |
bLockZTranslation |
[Physx Only] Lock translation along the Z-axis |
|
uint8: 1 |
bNotifyRigidBodyCollision |
Should 'Hit' events fire when this object collides during physics simulation. |
|
uint8: 1 |
bOverrideMaxAngularVelocity |
Override the default max angular velocity |
|
uint8: 1 |
bOverrideMaxDepenetrationVelocity |
[PhysX Only] Whether this body instance has its own custom MaxDepenetrationVelocity |
|
uint8: 1 |
bOverrideWalkableSlopeOnInstance |
Whether this instance of the object has its own custom walkable slope override setting. |
|
uint8: 1 |
bPendingCollisionProfileSetup |
Whether we are pending a collision profile setup |
|
uint8: 1 |
bUseCCD |
If true Continuous Collision Detection (CCD) will be used for this component |
|
COMNudge |
User specified offset for the center of mass of this object, from the calculated location |
|
|
CurrentSceneState |
Current state of the physics body for tracking deferred addition and removal. |
|
|
CustomDOFPlaneNormal |
Locks physical movement along a custom plane for a given normal. |
|
|
float |
CustomSleepThresholdMultiplier |
If the SleepFamily is set to custom, multiply the natural sleep threshold by this amount. |
|
DOFConstraint |
[Physx Only] Constraint used to allow for easy DOF setup per bodyinstance |
|
|
TEnumAsByte< ED... |
DOFMode |
[Physx Only] Locks physical movement along specified axis. |
|
TWeakObjectPtr<... |
ExternalCollisionProfileBodySetup |
The body setup holding the default body instance and its collision profile. |
|
InertiaTensorScale |
Per-instance scaling of inertia (bigger number means it'll be harder to rotate) |
|
|
InstanceBodyIndex |
Index of this BodyInstance within the SkeletalMeshComponent/PhysicsAsset. |
|
|
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. |
|
|
float |
LinearDamping |
'Drag' force added to reduce linear movement |
|
float |
MassInKgOverride |
Mass of the body in KG. |
|
float |
MassScale |
Per-instance scaling of mass |
|
float |
MaxAngularVelocity |
The maximum angular velocity for this instance [degrees/s] |
|
float |
MaxDepenetrationVelocity |
[PhysX Only] The maximum velocity used to depenetrate this object |
|
TWeakObjectPtr<... |
OwnerComponent |
PrimitiveComponent containing this body. |
|
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 |
|
FPhysicsUserDat... |
PhysicsUserData |
#PHYS2 Rename, not just for physx now. |
|
TObjectPtr< cla... |
PhysMaterialOverride |
Allows you to override the PhysicalMaterial to use for simple collision on this body. |
|
PositionSolverIterationCount |
[PhysX Only] This physics body's solver iteration count for position. |
|
|
Scale3D |
Current scale of physics - used to know when and how physics must be rescaled to match current transform of OwnerComponent. |
|
|
SleepFamily |
The set of values used in considering when put this body to sleep. |
|
|
float |
StabilizationThresholdMultiplier |
Stabilization factor for this body if Physics stabilization is enabled. |
|
VelocitySolverIterationCount |
[PhysX Only] This physics body's solver iteration count for velocity. |
|
|
WalkableSlopeOverride |
Custom walkable slope override setting for this instance. |
|
|
FBodyInstance &... |
WeldParent |
The parent body that we are welded to |
Name | Description | |
---|---|---|
|
FBodyInstance() |
Constructor |
Name | Description | ||
---|---|---|---|
|
AddAngularImpulseInRadians |
Add a rotational impulse to this body |
|
|
AddCustomPhysics ( |
Add custom forces and torques on the body. |
|
|
AddForce |
Add a force to this body |
|
|
AddForceAtPosition |
Add a force at a particular position (world space when bIsLocalForce = false, body space otherwise) |
|
|
AddImpulse |
Add an impulse to this body |
|
|
AddImpulseAtPosition |
Add an impulse to this body and a particular world position |
|
|
AddRadialForceToBody |
Add a force to this bodyinstance, originating from the supplied world-space location. |
|
|
AddRadialImpulseToBody |
Add an impulse to this bodyinstance, radiating out from the specified position. |
|
|
AddTorqueInRadians |
Add a torque to this body |
|
|
AddVelocityChangeImpulseAtLocation |
Add a velocity change impulse to this body and a particular world position |
|
|
ApplyDeferredCollisionProfileName() |
Applies a deferred collision profile |
|
|
ApplyMaterialToInstanceShapes_AssumesLocked ( |
This function is not thread safe. |
|
|
ApplyMaterialToShape_AssumesLocked ( |
Apply a material directly to the passed in shape. |
|
|
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 |
|
|
BuildBodyCollisionFlags ( |
Build the flags to control which types of collision (sim and query) shapes owned by this BodyInstance should have. |
|
|
BuildBodyFilterData ( |
Build the sim and query filter data (for simple and complex shapes) based on the settings of this BodyInstance (and its associated BodySetup) |
|
|
ClearExternalCollisionProfile() |
||
|
ClearForces ( |
Clear accumulated forces on this body |
|
|
ClearTorques ( |
Clear accumulated torques on this body |
|
|
CopyBodyInstancePropertiesFrom ( |
Utility for copying properties from one BodyInstance to another. |
|
|
CopyRuntimeBodyInstancePropertiesFrom ( |
Utility for copying only the runtime instanced properties from one BodyInstance to another. |
|
|
CreateDOFLock() |
||
|
DoesUseCollisionProfile() |
Return true if it uses Collision Profile System. False otherwise |
|
|
DrawCOMPosition ( |
Draws the center of mass as a wire star |
|
|
ExecuteOnCalculateCustomProjection ( |
Executes the OnCalculateCustomProjection delegate if bound. |
|
|
FixupData ( |
UObject notification by OwningComponent |
|
|
const FPhysi... |
GetActorReferenceWithWelding() |
|
|
GetAllShapes_AssumesLocked ( |
Utility to get all the shapes from a FBodyInstance |
|
|
GetBodyBounds() |
Return bounds of physics representation |
|
|
GetBodyDebugName() |
Get the name for this body, for use in debugging |
|
|
GetBodyInertiaTensor() |
Return the body's inertia tensor. This is returned in local mass space |
|
|
GetBodyInstanceResourceSizeEx ( |
Returns memory used by resources allocated for this body instance ( ex. physics resources ) |
|
|
float |
GetBodyMass() |
Returns the body's mass |
|
UBodySetup &... |
GetBodySetup() |
|
|
ECollisionEn... |
GetCollisionEnabled ( |
Get the current type of collision enabled |
|
GetCollisionProfileName() |
Returns the collision profile name that will be used. |
|
|
const FColli... |
GetCollisionResponse() |
|
|
GetComplexPhysicalMaterials ( |
Get the complex PhysicalMaterials for this body |
|
|
GetComplexPhysicalMaterials ( |
Get the complex PhysicalMaterials and PhysicalMaterialMasks for this body |
|
|
GetComplexPhysicalMaterials ( |
Find the correct PhysicalMaterial and PhysicalMaterialMasks for complex geometry on a given body and owner. |
|
|
GetComplexPhysicalMaterials |
Get the complex PhysicalMaterials and PhysicalMaterialMasks array for this body |
|
|
GetComplexPhysicalMaterials() |
Get the complex PhysicalMaterials array for this body |
|
|
GetCOMPosition() |
Returns the center of mass of this body (in world space) |
|
|
const TMap< ... |
GetCurrentWeldInfo() |
|
|
float |
GetDistanceToBody |
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 |
|
GetLockedAxis() |
[Physx Only] |
|
|
GetMaskFilter() |
Return the ignore mask filter. |
|
|
float |
GetMassOverride() |
Returns the mass override. See MassInKgOverride for documentation |
|
GetMassSpaceLocal() |
Returns the mass coordinate system to local space transform (position is local center of mass, rotation should be identity) |
|
|
GetMassSpaceToWorldSpace() |
Returns the mass coordinate system to world space transform (position is world center of mass, rotation is world inertia orientation) |
|
|
float |
GetMaxAngularVelocityInRadians() |
Get the maximum angular velocity of this body |
|
ECollisionCh... |
GetObjectType() |
Get the movement channel of this body |
|
const FBodyI... |
GetOriginalBodyInstance ( |
Returns the original owning body instance. This is needed for welding |
|
GetOverrideWalkableSlopeOnInstance() |
Gets bOverrideWalkableSlopeOnInstance |
|
|
const FPhysi... |
GetPhysicsActorHandle() |
|
|
FPhysicsActo... |
GetPhysicsActorHandle() |
|
|
const FPhysS... |
GetPhysicsScene() |
Get the scene that owns this body. |
|
FPhysScene &... |
GetPhysicsScene() |
Get the scene that owns this body. |
|
const FTrans... |
GetRelativeBodyTransform ( |
Returns the relative transform between root body and welded instance owned by the shape. |
|
ECollisionRe... |
GetResponseToChannel ( |
Get the collision response of this body to a particular channel |
|
const FColli... |
GetResponseToChannels() |
Get Collision ResponseToChannels container for this component |
|
GetRigidBodyState ( |
||
|
ECollisionEn... |
GetShapeCollisionEnabled ( |
Get the current type of collision enabled for a particular shape |
|
const FColli... |
GetShapeResponseToChannels ( |
Get Collision ResponseToChannels container for a specific shape in this component |
|
const FColli... |
GetShapeResponseToChannels ( |
Get Collision ResponseToChannels container for a specific shape in this component |
|
UPhysicalMat... |
GetSimplePhysicalMaterial() |
Find the correct PhysicalMaterial for simple geometry on this body |
|
UPhysicalMat... |
GetSimplePhysicalMaterial ( |
Find the correct PhysicalMaterial for simple geometry on a given body and owner. |
|
float |
GetSleepThresholdMultiplier() |
Gets the multiplier to the threshold where the body will go to sleep automatically. |
|
GetSquaredDistanceToBody |
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 |
|
|
GetUnrealWorldAngularVelocityInRadians() |
Get current angular velocity in world space from physics body. |
|
|
GetUnrealWorldAngularVelocityInRadians_AssumesLocked() |
Get current angular velocity in world space from physics body. |
|
|
GetUnrealWorldTransform |
Get current transform in world space from physics body. |
|
|
GetUnrealWorldTransform_AssumesLocked |
Get current transform in world space from physics body. |
|
|
GetUnrealWorldVelocity() |
Get current velocity in world space from physics body. |
|
|
GetUnrealWorldVelocity_AssumesLocked() |
Get current velocity in world space from physics body. |
|
|
GetUnrealWorldVelocityAtPoint ( |
Get current velocity of a point on this physics body, in world space. |
|
|
GetUnrealWorldVelocityAtPoint_AssumesLocked ( |
Get current velocity of a point on this physics body, in world space. |
|
|
const FWalka... |
GetWalkableSlopeOverride() |
Returns the slope override struct for this instance. |
|
InitBody ( |
Initialise a single rigid body (this FBodyInstance) for the given body setup |
|
|
InitBody ( |
||
|
InitDynamicProperties_AssumesLocked() |
Initialise dynamic properties for this instance when using physics - this must be done after scene addition. |
|
|
InitStaticBodies ( |
Standalone path to batch initialize large amounts of static bodies, which will be deferred till the next scene update for fast scene addition. |
|
|
IsDynamic() |
Returns true if the body is not static |
|
|
IsInstanceAwake() |
Returns whether this body is awake |
|
|
IsInstanceSimulatingPhysics() |
Returns true if this body is simulating, false if it is fixed (kinematic) |
|
|
IsNonKinematic() |
Returns true if the body is non kinematic |
|
|
IsPhysicsDisabled() |
||
|
IsShapeBoundToBody ( |
Check if the shape is owned by this body instance |
|
|
IsValidBodyInstance() |
See if this body is valid. |
|
|
LineTrace ( |
Trace a ray against just this bodyinstance |
|
|
LoadProfileData ( |
Update profile data if required |
|
|
FCalculateCu... |
OnCalculateCustomProjection() |
Returns reference to the OnCalculateCustomProjection delegate. |
|
FRecalculate... |
OnRecalculatedMassProperties() |
Returns reference to the OnRecalculatedMassProperties delegate. |
|
OverlapMulti ( |
Determines the set of components that this body instance would overlap with at the supplied location/rotation @note The overload taking rotation as an FQuat is slightly faster than the version using FRotator (which will be converted to an FQuat).. |
|
|
OverlapMulti ( |
Determines the set of components that this body instance would overlap with at the supplied location/rotation @note The overload taking rotation as an FQuat is slightly faster than the version using FRotator (which will be converted to an FQuat).. |
|
|
OverlapTest ( |
Test if the bodyinstance overlaps with the specified shape at the specified position/rotation |
|
|
OverlapTest_AssumesLocked ( |
Test if the bodyinstance overlaps with the specified shape at the specified position/rotation |
|
|
OverlapTestForBodies ( |
Test if the bodyinstance overlaps with the specified body instances |
|
|
OverlapTestForBody ( |
||
|
PostShapeChange() |
After adding/removing shapes call this function to update mass distribution etc... |
|
|
PutInstanceToSleep() |
Force this body to sleep |
|
|
ReplaceResponseToChannels ( |
Replace the channels on this body matching the old response with the new response |
|
|
EDOFMode::Ty... |
ResolveDOFMode ( |
|
|
SetAngularVelocityInRadians |
Set the angular velocity of this body |
|
|
SetBodyTransform ( |
Move the physics body to a new pose. |
|
|
SetCollisionEnabled ( |
Controls what kind of collision is enabled for this body and allows optional disable physics rebuild |
|
|
SetCollisionProfileName ( |
Set Collision Profile Name This function should be called outside of constructors to set profile name. |
|
|
SetCollisionProfileNameDeferred ( |
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. |
|
|
SetContactModification ( |
Enables/disables contact modification |
|
|
SetContactReportForceThreshold ( |
Set a new contact report force threhold. Threshold < 0 disables this feature. |
|
|
SetDOFLock ( |
[Physx Only] Locks physical movement along axis. |
|
|
SetEnableGravity ( |
Enables/disables whether this body is affected by gravity. |
|
|
SetInstanceNotifyRBCollision ( |
Set whether we should get a notification about physics collisions |
|
|
SetInstanceSimulatePhysics |
Set this body to be fixed (kinematic) or not. |
|
|
SetLinearVelocity |
Set the linear velocity of this body |
|
|
SetMaskFilter ( |
Updates the mask filter. |
|
|
SetMassOverride ( |
Sets the mass override |
|
|
SetMassScale ( |
Modify the mass scale of this body |
|
|
SetMassSpaceLocal ( |
TODO: this only works at runtime when the physics state has been created. |
|
|
SetMaxAngularVelocityInRadians |
Set the maximum angular velocity of this body |
|
|
SetMaxDepenetrationVelocity ( |
Set the maximum depenetration velocity the physics simulation will introduce |
|
|
SetObjectType ( |
Set the movement channel of this body to the one supplied |
|
|
SetOneWayInteraction ( |
If set to true, this body will treat bodies that do not have the flag set as having infinite mass |
|
|
SetPhysicsDisabled ( |
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 |
|
|
SetPhysMaterialOverride ( |
Set physical material override for this body |
|
|
SetResponseToAllChannels ( |
Set the response of this body to all channels |
|
|
SetResponseToChannel ( |
Set the collision response of this body to a particular channel |
|
|
SetResponseToChannels ( |
Set the response of this body to the supplied settings |
|
|
SetShapeCollisionEnabled ( |
Controls what kind of collision is enabled for a particular shape |
|
|
SetShapeResponseToChannels ( |
Set the response of a specific shape on this body to the supplied settings |
|
|
SetUseCCD ( |
Enable/disable Continuous Collidion Detection feature |
|
|
SetWalkableSlopeOverride ( |
Sets a custom slope override struct for this instance. |
|
|
ShouldInterpolateWhenSubStepping() |
Whether we should interpolate when substepping. |
|
|
Sweep ( |
Trace a shape against just this bodyinstance |
|
|
TermBody ( |
Terminates the body, releasing resources Clean up the physics engine info for this instance. |
|
|
UnWeld ( |
Takes a welded body and unwelds it. |
|
|
UpdateBodyScale |
Update Body Scale |
|
|
UpdateDampingProperties() |
Update instance's linear and angular damping |
|
|
UpdateInstanceSimulatePhysics() |
Makes sure the current kinematic state matches the simulate flag |
|
|
UpdateInterpolateWhenSubStepping() |
Update the substepping interpolation flag |
|
|
UpdateMassProperties() |
Update instance's mass properties (mass, inertia and center-of-mass offset) based on MassScale, InstanceMassScale and COMNudge. |
|
|
UpdatePhysicalMaterials() |
Update the instance's material properties (friction, restitution) |
|
|
UpdatePhysicsFilterData() |
Update the instances collision filtering data |
|
|
UpdateTriMeshVertices |
Dynamically update the vertices of per-poly collision for this body. |
|
|
UseExternalCollisionProfile ( |
Use the collision profile found in the given BodySetup's default BodyInstance |
|
|
ValidateTransform ( |
Validate a body transform, outputting debug info |
|
|
WakeInstance() |
Wake this body |
|
|
Weld ( |
Takes two body instances and welds them together to create a single simulated rigid body. |
Name |
Description |
|
---|---|---|
|
FWeldInfo |
Name | Description | ||
---|---|---|---|
|
ResponseToChannels_DEPRECATED |
Types of objects that this physics objects will collide with. |