Navigation
API > API/Plugins > API/Plugins/MassLOD
Inheritance Hierarchy
- FMassLODBaseLogic
- TMassLODCalculator
References
| Module | MassLOD |
| Header | /Engine/Plugins/Runtime/MassGameplay/Source/MassLOD/Public/MassLODCalculator.h |
| Include | #include "MassLODCalculator.h" |
Syntax
template<typename FLODLogic>
struct TMassLODCalculator : public FMassLODBaseLogic
Remarks
Helper struct to calculate LOD for each agent and maximize count per LOD Requires TViewerInfoFragment fragment collected by the TMassLODCollector. Stores information in TLODFragment fragment.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TStaticArray< float, EMassLOD::Max > | BaseBucketSize | The size of each subdivision per LOD (LOD Size/MaxBucketsPerLOD) | |
| TStaticArray< float, EMassLOD::Max > | BaseLODDistance | LOD distances | |
| float | BufferHysteresisOnDistanceRatio | Ratio for Buffer Distance Hysteresis | |
| TStaticArray< int32, EMassLOD::Max > | LODMaxCount | MaxCount total | |
| TStaticArray< int32, EMassLOD::Max > | LODMaxCountPerViewer | MaxCount total per viewers | |
| float | MaxLODDistance | Maximum LOD Distance | |
| FMassLODRuntimeData | RuntimeData | Runtime data for LOD calculation | |
| TArray< FMassLODRuntimeData > | RuntimeDataPerViewer | Runtime data for each viewer specific LOD calculation, used only when bMaximizeCountPerViewer is true | |
| TStaticArray< float, EMassLOD::Max > | VisibleBucketSize | ||
| float | VisibleDistanceToFrustum | How far away from frustum does this entities are considered visible | |
| float | VisibleDistanceToFrustumWithHysteresis | Once visible how much further than distance to frustum does the entities need to be before being consider not visible | |
| TStaticArray< float, EMassLOD::Max > | VisibleLODDistance |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| float | AccumulateCountInRuntimeData
(
const EMassLOD::Type LOD, |
||
| bool | Adjust LOD distances by clamping them to respect the maximum LOD count @Return true if any LOD distances clamping was done | ||
| bool | AdjustDistancesFromCountForRuntimeData
(
const TStaticArray< int32, EMassLOD::Max >& MaxCount, |
||
| void | AdjustLODFromCount
(
FMassExecutionContext& Context, |
Adjust LOD from newly adjusted distances, only needed to be called when AdjustDistancesFromCount return true, called for each entity chunks Use next method when FLODLogic::bStoreInfoPerViewer is enabled @Param Context of the chunk execution @Param ViewersInfoList is the source information fragment for LOD calculation @Param LODList is the fragment where calculation are stored | |
| void | AdjustLODFromCount
(
FMassExecutionContext& Context, |
Adjust LOD from newly adjusted distances, only needed to be called when AdjustDistancesFromCount return true, called for each entity chunks Use this version when FLODLogic::bStoreInfoPerViewer is enabled It calculates a LOD per viewer and needs information per viewer via PerViewerInfoList fragments @Param Context of the chunk execution @Param ViewersInfoList is the source information fragment for LOD calculation @Param LODList is the fragment where calculation are stored @Param PerViewerInfoList is the Per viewer source information | |
| void | CalculateLOD
(
FMassExecutionContext& Context, |
Calculate LOD, called for each entity chunks Use next method when FLODLogic::bStoreInfoPerViewer is enabled @Param Context of the chunk execution @Param ViewersInfoList is the source information fragment for LOD calculation @Param LODList is the fragment where calculation are stored | |
| void | CalculateLOD
(
FMassExecutionContext& Context, |
Calculate LOD, called for each entity chunks Use this version when FLODLogic::bStoreInfoPerViewer is enabled It calculates a LOD per viewer and needs information per viewer via PerViewerInfoList fragments @Param Context of the chunk execution @Param ViewersInfoList is the source information fragment for LOD calculation @Param LODList is the fragment where calculation are stored @Param PerViewerInfoList is the Per viewer source information | |
| bool | CalculateVisibility
(
const bool bWasVisible, |
||
| EMassLOD::Type | ComputeLODFromSettings
(
const EMassLOD::Type PrevLOD, |
||
| void | ForceOffLOD
(
FMassExecutionContext& Context, |
Turn Off all LOD, called for each entity chunks @Param Context of the chunk execution @Param LODList is the fragment where calculation are stored | |
| float | Return the maximum distance at which the LOD will be turn off | ||
| void | Initialize
(
const float InBaseLODDistance, |
Initializes the LOD calculator, needed to be called once at initialization time @Param InBaseLODDistance distances used to calculate LOD @Param InBufferHysteresisOnFOVRatio distance hysteresis used to calculate LOD @Param InLODMaxCount the maximum count for each LOD - Supports nullptr being passed in now and will put INT_MAX everywhere by default @Param InLODMaxCountPerViewer the maximum count for each LOD per viewer (Only when FLODLogic::bMaximizeCountPerViewer is enabled) @Param InVisibleDistanceToFrustum is the distance from the frustum to start considering this entity is visible (Only when FLODLogic::bDoVisibilityLogic is enabled) @Param InVisibleDistanceToFrustumHysteresis once visible, what extra distance the entity need to be before considered not visible anymore (Only when FLODLogic::bDoVisibilityLogic is enabled) @Param InVisibleLODDistance the maximum count for each LOD per viewer (Only when FLODLogic::bDoVisibilityLogic is enabled) | |
| void | PrepareExecution
(
TConstArrayView< FViewerInfo > Viewers |
Prepares execution for the current frame, needed to be called before every execution @Param Viewers is the array of all the known viewers |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FMassLODRuntimeData |