FPhysScene_PhysX

Container object for a physics engine 'scene'.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/Physics/PhysScene_PhysX.h

Include

#include "Physics/PhysScene_PhysX.h"

Syntax

class FPhysScene_PhysX

Remarks

Container object for a physics engine 'scene'.

Variables

Constructors

Name Description

Public function

FPhysScene_PhysX

(
    const AWorldSettings* Settings
)

Exposes creation of physics-engine scene outside Engine (for use with Physics Asset Editor for example).

Destructors

Name Description

Public function

~FPhysScene_PhysX()

Exposes destruction of physics-engine scene outside Engine.

Functions

Name Description

Public function

void

 

AddActorsToScene_AssumesLocked

(
    const TArray< FPhysicsActorHandle >...
)

Actor creation/registration void ReleaseActor(FPhysicsActorReference& InActor);

Public function

void

 

AddAggregateToScene

(
    const FPhysicsAggregateHandle& InA...
)

Public function

void

 

AddCustomPhysics_AssumesLocked

(
    FBodyInstance* BodyInstance,
    FCalculateCustomPhysics& Calculate...
)

Add a custom callback for next step that will be called on every substep

Public function

void

 

AddForce_AssumesLocked

(
    FBodyInstance* BodyInstance,
    const FVector& Force,
    bool bAllowSubstepping,
    bool bAccelChange
)

Adds a force to a body - We need to go through scene to support substepping

Public function

void

 

AddForceAtPosition_AssumesLocked

(
    FBodyInstance* BodyInstance,
    const FVector& Force,
    const FVector& Position,
    bool bAllowSubstepping,
    bool bIsLocalForce
)

Adds a force to a body at a specific position - We need to go through scene to support substepping

Public function

void

 

AddPendingOnConstraintBreak

(
    FConstraintInstance* Constrain...
)

Pending constraint break events

Public function

void

 

AddPendingSleepingEvent

(
    FBodyInstance* BI,
    ESleepEvent SleepEventType
)

Pending wake/sleep events

Public function

void

 

AddRadialForceToBody_AssumesLocked

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

Adds a radial force to a body - We need to go through scene to support substepping

Public function

void

 

AddTorque_AssumesLocked

(
    FBodyInstance* BodyInstance,
    const FVector& Torque,
    bool bAllowSubstepping,
    bool bAccelChange
)

Adds torque to a body - We need to go through scene to support substepping

Public function

void

 

ApplyWorldOffset

(
    FVector InOffset
)

Shifts physics scene origin by specified offset

Public function

void

 

ClearForces_AssumesLocked

(
    FBodyInstance* BodyInstance,
    bool bAllowSubstepping
)

Clears currently accumulated forces on a specified body instance

Public function

void

 

ClearPreSimKinematicUpdate

(
    USkeletalMeshComponent* InSkel...
)

Remove this SkeletalMeshComponent from set needing kinematic update before simulating physics

Public function

void

 

ClearTorques_AssumesLocked

(
    FBodyInstance* BodyInstance,
    bool bAllowSubstepping
)

Clears currently accumulated torques on a specified body instance

Public function

void

 

DeferredAddCollisionDisableTable

(
    uint32 SkelMeshCompID,
    TMap< struct FRigidBodyIndexPair, b...
)

Adds to queue of skelmesh we want to add to collision disable table

Public function

void

 

DeferredRemoveCollisionDisableTable

(
    uint32 SkelMeshCompID
)

Adds to queue of skelmesh we want to remove from collision disable table

Public function

void

 

EndFrame

(
    ULineBatchComponent* InLineBat...
)

Ends a frame

Public function

void

 

EnsureCollisionTreeIsBuilt

(
    UWorld* World
)

Ensures that the collision tree is built.

Public function

const TMap< ...

 

GetCollisionDisableTableLookup()

Gets the collision disable table

Public function

FGraphEventR...

 

GetCompletionEvent()

Returns the completion event for a frame

Public function Const

bool

 

GetKinematicTarget_AssumesLocked

(
    const FBodyInstance* BodyInsta...,
    FTransform& OutTM
)

Gets a Kinematic actor's target position - We need to do this here to support substepping Returns true if kinematic target has been set.

Public function

int32

 

GetNumAwakeBodies()

Public function

UWorld *

 

GetOwningWorld()

Public function Const

const UWorld...

 

GetOwningWorld()

Public function

TArray< FCol...

 

GetPendingCollisionNotifies()

Gets the array of collision notifications, pending execution at the end of the physics engine run.

Public function

FPhysicsRepl...

 

GetPhysicsReplication()

Public function Const

physx::PxSce...

 

GetPxScene()

Get the PxScene

Utility for looking up the PxScene associated with this FPhysScene.

Public function Const

ISQAccelerat...

 

GetSQAccelerator()

Public function Const

FSQAccelerat...

 

GetSQAcceleratorUnion()

Public function

bool

 

HandleExecCommands

(
    const TCHAR* Cmd,
    FOutputDevice* Ar
)

Handle exec commands related to scene (PXVIS and APEXVIS)

Public function

void

 

KillVisualDebugger()

Kill the visual debugger

Public function

void

 

ListAwakeRigidBodies

(
    bool bIncludeKinematic
)

Util to list to log all currently awake rigid bodies

Public function

bool

 

MarkForPreSimKinematicUpdate

(
    USkeletalMeshComponent* InSkel...,
    ETeleportType InTeleport,
    bool bNeedsSkinning
)

Add this SkeletalMeshComponent to the list needing kinematic bodies updated before simulating physics

Public function

void

 

RemoveBodyInstanceFromPendingLists_AssumesLocked

(
    FBodyInstance* BodyInstance
)

Lets the scene update anything related to this BodyInstance as it's now being terminated

Public function

void

 

SerializeForTesting

(
    FArchive& Ar
)

Public function

void

 

SetKinematicTarget_AssumesLocked

(
    FBodyInstance* BodyInstance,
    const FTransform& TargetTM,
    bool bAllowSubstepping
)

Sets a Kinematic actor's target position - We need to do this here to support substepping

Public function

void

 

SetOwningWorld

(
    UWorld* InOwningWorld
)

Owning world is made private so that any code which depends on setting an owning world can update.

Public function

void

 

SetPhysXTreeRebuildRate

(
    int32 RebuildRate
)

The number of frames it takes to rebuild the PhysX scene query AABB tree.

Public function

void

 

SetUpForFrame

(
    const FVector* NewGrav,
    float InDeltaSeconds,
    float InMaxPhysicsDeltaTime,
    float InMaxSubstepDeltaTime,
    int32 InMaxSubsteps
)

Set the gravity and timing of all physics scenes

Public function

void

 

StartFrame()

Starts a frame

Public function Static

bool

 

SupportsOriginShifting()

Public function

void

 

WaitPhysScenes()

Waits for all physics scenes to complete

Typedefs

Constants

Name

Description

CCDContactModifyCallbackFactory

ContactModifyCallbackFactory

Static factories used to override the simulation contact modify callback from other modules.

PhysicsReplicationFactory

Static factory used to override the physics replication manager from other modules.

SimEventCallbackFactory

Static factory used to override the simulation event callback from other modules.

SimScratchBufferBoundary

Boundary value for PhysX scratch buffers (currently PhysX requires the buffer length be a multiple of 16K)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss