Language:
Discover
By Skill Level
By Category

FPhysScene

Choose your OS:

Syntax

class FPhysScene

Remarks

Container object for a physics engine 'scene'.

Variables

Name Description

Public variable

float[PST_MAX]

 

AveragedFrameTime

Frame time, weighted with current frame time.

Public variable

bool

 

bAsyncSceneEnabled

Indicates whether the async scene is enabled or not.

Public variable

bool[PST_MAX]

 

bPhysXSceneExecuting

Whether or not the given scene is between its execute and sync point.

Public variable

bool

 

bSubstepping

Indicates whether the scene is using substepping

Public variable

bool

 

bSubsteppingAsync

Indicates whether the scene is using substepping

Public variable

float[PST_MAX]

 

FrameTimeSmoothingFactor

Weight for averaged frame time.

Public variable

uint32

 

NumPhysScenes

Stores the number of valid scenes we are working with.

Public variable

FOnPhysScenePos ...

 

OnPhysScenePostTick

Public variable

FOnPhysScenePre ...

 

OnPhysScenePreTick

Public variable

FOnPhysSceneSte ...

 

OnPhysSceneStep

Public variable

int16 [PST_MAX]

 

PhysXSceneIndex

These indices are used to get the actual PxScene or ApexScene from the GPhysXSceneMap.

Constructors

Name Description

Public function

FPhysScene

(
    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()

Exposes destruction of physics-engine scene outside Engine.

Functions

Name Description

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

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

AddDebugLines

(
    uint32 SceneType,
    ULineBatchComponent * LineBatch...
)

WITH_PHYSX.

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...,
    int32 SceneType
)

Pending constraint break events

Public function

void

 

AddPendingSleepingEvent

(
    PxActor* Actor,
    SleepEvent::Type SleepEventType,
    int32 SceneType
)

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

 

ClearPreSimKinematicUpdate

(
    USkeletalMeshComponent * InSkel...
)

Remove this SkeletalMeshComponent from set needing kinematic update before simulating physics

Public function

void

 

DeferAddActor

(
    FBodyInstance * OwningInstance,
    PxActor* Actor,
    EPhysicsSceneType SceneType
)

Defer the addition of an actor to a scene, this will actually be performed before the next Physics tick

Public function

void

 

DeferAddActors

(
    const TArray < FBodyInstance * >...,
    const TArray < PxActor* >& Act...,
    EPhysicsSceneType SceneType
)

Defer the addition of a group of actors to a scene, this will actually be performed before the next Physics tick.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

DeferredAddCollisionDisableTable

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

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

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

DeferredRemoveCollisionDisableTable

(
    uint32 SkelMeshCompID
)

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

Public function

void

 

DeferRemoveActor

(
    FBodyInstance * OwningInstance,
    PxActor* Actor,
    EPhysicsSceneType SceneType
)

Defer the removal of an actor to a scene, this will actually be performed before the next Physics tick

Public function

void

 

DeferRemoveActors

(
    const TArray < FBodyInstance * >...,
    const TArray < PxActor* >& Act...,
    EPhysicsSceneType SceneType
)

Defer the removal of actors from a scene, this will actually be performed before the next Physics tick

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

DispatchPhysNotifications_AssumesLocked()

Call after WaitPhysScene on the synchronous scene to make deferred OnRigidBodyCollision calls.

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

EndFrame

(
    ULineBatchComponent * InLineBat...
)

Ends a frame

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

EnsureCollisionTreeIsBuilt

(
    UWorld * World
)

Ensures that the collision tree is built.

Public function

void

 

FlushDeferredActors

(
    EPhysicsSceneType SceneType
)

Flushes deferred actors to ensure they are in the physics scene.

Public function

const TMap < ...

 

GetCollisionDisableTableLookup()

Gets the collision disable table

Public function

FGraphEventR ...

 

GetCompletionEvent()

Returns the completion event for a frame

Public function

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

UWorld *

 

GetOwningWorld()

Public function

const UWorld ...

 

GetOwningWorld()

Public function

TArray < FCol ...

 

GetPendingCollisionNotifies

(
    int32 SceneType
)

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

Public function

FPhysicsRepl ...

 

GetPhysicsReplication()

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) p...

 

GetPhysXScene

(
    uint32 SceneType
)

Utility for looking up the PxScene of the given EPhysicsSceneType associated with this FPhysScene .

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3) b...

 

HasAsyncScene()

Returns whether an async scene is setup and can be used.

Public function

bool

 

IsFlushNeededForDeferredActors_AssumesLocked

(
    EPhysicsSceneType SceneType
)

Public function

bool

 

IsSubstepping

(
    uint32 SceneType
)

Whether physics scene is using substepping

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

KillVisualDebugger()

Kill the visual debugger

Public function

void

 

MarkForPreSimKinematicUpdate

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

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

Public function

void

 

ProcessPhysScene

(
    uint32 SceneType
)

Fetches results, fires events, and adds debug lines

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

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

SetUpForFrame

(
    const FVector * NewGrav,
    float InDeltaSeconds,
    float InMaxPhysicsDeltaTime
)

Set the gravity and timing of all physics scenes

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

StartAsync()

Starts cloth Simulation

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

StartFrame()

Starts a frame

Public function Static

bool

 

SupportsOriginShifting()

Whether physics scene supports scene origin shifting

Public function

void

 

SyncComponentsToBodies_AssumesLocked

(
    uint32 SceneType
)

Sync components in the scene to physics bodies that changed

Public function

void

 

TermBody_AssumesLocked

(
    FBodyInstance * BodyInstance
)

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

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

TickPhysScene

(
    uint32 SceneType,
    FGraphEventRef & InOutCompletionEve...
)

Start simulation on the physics scene of the given type

Public function

[ENGINE_API](API\Runtime\Engine\GameFramework\ENGINE_API_3)vo...

 

WaitPhysScenes()

Waits for all physics scenes to complete

Typedefs

Constants

Name

Description

ContactModifyCallbackFactory

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

PhysicsReplicationFactory

WITH_PHYSX.

SimEventCallbackFactory

WITH_PHYSX.

SimScratchBufferBoundary

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

References

Module

Engine

Header

Runtime/Engine/Public/PhysicsPublic.h