Navigation
API > API/Runtime > API/Runtime/Chaos
Global manager for physical materials. Materials are created, updated and destroyed only on the game thread and an immutable copy of the materials are stored on each solver. The solvers module binds to the updated event in this manager and enqueues updates to all active solvers when a material is updated.
The material manager provides handles for the objects which should be stored instead of the material pointer. When accessing the internal material always use the handle rather than storing the result of Get()
| Name | FPhysicalMaterialManager |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/PhysicalMaterials.h |
| Include Path | #include "Chaos/PhysicalMaterials.h" |
Syntax
class FPhysicalMaterialManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPhysicalMaterialManager() |
Material manager is a singleton - access with Get() | Chaos/PhysicalMaterials.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InitialCapacity | int32 | Initial size for the handle-managed array | Chaos/PhysicalMaterials.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnMaterialCreated | FOnMaterialCreated | Chaos/PhysicalMaterials.h | ||
| OnMaterialDestroyed | FOnMaterialDestroyed | Chaos/PhysicalMaterials.h | ||
| OnMaterialMaskCreated | FOnMaterialMaskCreated | Chaos/PhysicalMaterials.h | ||
| OnMaterialMaskDestroyed | FOnMaterialMaskDestroyed | Chaos/PhysicalMaterials.h | ||
| OnMaterialMaskUpdated | FOnMaterialMaskUpdated | Chaos/PhysicalMaterials.h | ||
| OnMaterialUpdated | FOnMaterialUpdated | Events | Chaos/PhysicalMaterials.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| MaterialMasks | THandleArray< FChaosPhysicsMaterialMask > | Handle-managed array of global material masks. | Chaos/PhysicalMaterials.h | |
| MaterialMasksLock | FRWLock | Chaos/PhysicalMaterials.h | ||
| Materials | THandleArray< FChaosPhysicsMaterial > | Handle-managed array of global materials. This is pushed to all solvers who all maintain a copy | Chaos/PhysicalMaterials.h | |
| MaterialsLock | FRWLock | Chaos/PhysicalMaterials.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMaterialHandle Create() |
Create a new material, returning a stable handle to it - this should be stored and not the actual material pointer | Chaos/PhysicalMaterials.h | |
FMaterialMaskHandle CreateMask() |
Chaos/PhysicalMaterials.h | ||
void Destroy
(
FMaterialHandle InHandle |
Destroy the material referenced by the provided handle | Chaos/PhysicalMaterials.h | |
void Destroy
(
FMaterialMaskHandle InHandle |
Chaos/PhysicalMaterials.h | ||
const THandleArray< FChaosPhysicsMaterialMask > & GetMasterMaterialMasks_External() |
Chaos/PhysicalMaterials.h | ||
const THandleArray< FChaosPhysicsMaterial > & GetMasterMaterials_External() |
Gets the internal list of primary materials representing the current user state of the material data | Chaos/PhysicalMaterials.h | |
const THandleArray< FChaosPhysicsMaterialMask > & GetPrimaryMaterialMasks_External() |
Chaos/PhysicalMaterials.h | ||
const THandleArray< FChaosPhysicsMaterial > & GetPrimaryMaterials_External() |
Chaos/PhysicalMaterials.h | ||
FChaosPhysicsMaterial * Resolve
(
FChaosMaterialHandle InHandle |
Get the actual material from a handle | Chaos/PhysicalMaterials.h | |
const FChaosPhysicsMaterial * Resolve
(
FChaosConstMaterialHandle InHandle |
Chaos/PhysicalMaterials.h | ||
FChaosPhysicsMaterialMask * Resolve
(
FChaosMaterialMaskHandle InHandle |
Chaos/PhysicalMaterials.h | ||
const FChaosPhysicsMaterialMask * Resolve
(
FChaosConstMaterialMaskHandle InHandle |
Chaos/PhysicalMaterials.h | ||
void UpdateMaterial
(
FMaterialHandle InHandle |
Signals stakeholders that the stored material for the provided handle has changed | Chaos/PhysicalMaterials.h | |
void UpdateMaterialMask
(
FMaterialMaskHandle InHandle |
Chaos/PhysicalMaterials.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FPhysicalMaterialManager & Get() |
Chaos/PhysicalMaterials.h |