6#include "Containers/Map.h"
11#include "ISMPoolComponent.generated.h"
337UCLASS(meta = (BlueprintSpawnableComponent), MinimalAPI)
367 UE_DEPRECATED(5.3,
"BatchUpdateInstancesTransforms Array parameter version is deprecated, use the TArrayView version instead")
386 uint32 NextMeshGroupId = 0;
EUpdateTransformFlags
Definition ActorComponent.h:95
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ELevelTick
Definition EngineBaseTypes.h:70
ETeleportType
Definition EngineTypes.h:2401
uint32 GetTypeHash(const FISMPoolComponentDescription &Desc)
Definition ISMPoolComponent.h:144
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
constexpr uint32 HashCombineFast(uint32 A, uint32 B)
Definition TypeHash.h:74
uint32 GetArrayHash(const T *Ptr, uint64 Size, uint32 PreviousHash=0)
Definition TypeHash.h:200
Definition NameTypes.h:617
Definition ArrayView.h:139
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_FORCEINLINE_HINT void RemoveAtSwap(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2185
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition UnrealString.h.inl:34
Definition ISMPoolComponent.h:339
int32 FMeshGroupId
Definition ISMPoolComponent.h:343
int32 FMeshId
Definition ISMPoolComponent.h:344
Definition ISMPoolDebugDrawComponent.h:16
Definition InstancedStaticMeshComponent.h:158
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition EngineBaseTypes.h:571
Definition ISMPoolComponent.h:102
EFlags
Definition ISMPoolComponent.h:104
@ AffectDynamicIndirectLighting
Definition ISMPoolComponent.h:113
@ WorldPositionOffsetWritesVelocity
Definition ISMPoolComponent.h:109
@ DistanceCullPrimitive
Definition ISMPoolComponent.h:115
@ GpuLodSelection
Definition ISMPoolComponent.h:106
@ StaticMobility
Definition ISMPoolComponent.h:108
@ EvaluateWorldPositionOffset
Definition ISMPoolComponent.h:110
@ ReverseCulling
Definition ISMPoolComponent.h:107
@ UseHISM
Definition ISMPoolComponent.h:105
@ AffectFarShadow
Definition ISMPoolComponent.h:114
@ AffectShadow
Definition ISMPoolComponent.h:111
@ AffectDistanceFieldLighting
Definition ISMPoolComponent.h:112
int32 MinLod
Definition ISMPoolComponent.h:123
int32 StartCullDistance
Definition ISMPoolComponent.h:121
uint32 Flags
Definition ISMPoolComponent.h:118
FName StatsCategory
Definition ISMPoolComponent.h:127
int32 NumCustomDataFloats
Definition ISMPoolComponent.h:119
int32 EndCullDistance
Definition ISMPoolComponent.h:122
TArray< FName > Tags
Definition ISMPoolComponent.h:126
uint32 GroupHash
Definition ISMPoolComponent.h:124
FVector Position
Definition ISMPoolComponent.h:120
float LodScale
Definition ISMPoolComponent.h:125
bool operator==(const FISMPoolComponentDescription &Other) const
Definition ISMPoolComponent.h:129
Definition ISMPoolComponent.h:260
FISMPoolInstanceGroups::FInstanceGroupId AddInstanceGroup(int32 InstanceCount, TArrayView< const float > CustomDataFloats)
Definition ISMPoolComponent.cpp:236
FISMPoolStaticMeshInstance MeshInstance
Definition ISMPoolComponent.h:269
TObjectPtr< UInstancedStaticMeshComponent > ISMComponent
Definition ISMPoolComponent.h:271
void InitISM(const FISMPoolStaticMeshInstance &InMeshInstance, bool bKeepAlive, bool bOverrideTransformUpdates=false)
Definition ISMPoolComponent.cpp:138
FISMPoolInstanceGroups InstanceGroups
Definition ISMPoolComponent.h:273
void CreateISM(USceneComponent *InOwningComponent)
Definition ISMPoolComponent.cpp:113
TArray< FPrimitiveInstanceId > InstanceIds
Definition ISMPoolComponent.h:275
Definition ISMPoolComponent.h:28
int32 Count
Definition ISMPoolComponent.h:36
int32 Start
Definition ISMPoolComponent.h:35
FInstanceGroupRange(int32 InStart, int32 InCount)
Definition ISMPoolComponent.h:29
Definition ISMPoolComponent.h:23
int32 TotalFreeInstanceCount
Definition ISMPoolComponent.h:93
bool IsEmpty() const
Definition ISMPoolComponent.h:49
int32 FInstanceGroupId
Definition ISMPoolComponent.h:24
FInstanceGroupId AddGroup(int32 Count)
Definition ISMPoolComponent.h:61
TArray< FInstanceGroupRange > GroupRanges
Definition ISMPoolComponent.h:94
void RemoveGroup(FInstanceGroupId GroupId)
Definition ISMPoolComponent.h:84
int32 TotalInstanceCount
Definition ISMPoolComponent.h:92
TArray< FInstanceGroupId > FreeList
Definition ISMPoolComponent.h:95
void Reset()
Definition ISMPoolComponent.h:40
int32 GetMaxInstanceIndex() const
Definition ISMPoolComponent.h:55
Definition ISMPoolComponent.h:239
bool bAllowPerInstanceRemoval
Definition ISMPoolComponent.h:255
int32 FMeshId
Definition ISMPoolComponent.h:240
bool BatchUpdateInstancesTransforms(FISMPool &ISMPool, FMeshId MeshId, int32 StartInstanceIndex, TArrayView< const FTransform > NewInstancesTransforms, bool bWorldSpace, bool bMarkRenderStateDirty, bool bTeleport)
Definition ISMPoolComponent.cpp:86
TArray< FISMPoolMeshInfo > MeshInfos
Definition ISMPoolComponent.h:252
FMeshId AddMesh(const FISMPoolStaticMeshInstance &MeshInstance, int32 InstanceCount, const FISMPoolMeshInfo &ISMInstanceInfo, TArrayView< const float > CustomDataFloats)
Definition ISMPoolComponent.cpp:73
void BatchUpdateInstanceCustomData(FISMPool &ISMPool, int32 CustomFloatIndex, float CustomFloatValue)
Definition ISMPoolComponent.cpp:96
void RemoveAllMeshes(FISMPool &ISMPool)
Definition ISMPoolComponent.cpp:104
Definition ISMPoolComponent.h:223
TArray< float > CustomData
Definition ISMPoolComponent.h:227
int32 ISMIndex
Definition ISMPoolComponent.h:224
FISMPoolInstanceGroups::FInstanceGroupId InstanceGroupIndex
Definition ISMPoolComponent.h:225
TArrayView< const float > CustomDataSlice(int32 InstanceIndex, int32 NumCustomDataFloatsPerInstance)
Definition ISMPoolComponent.cpp:67
void ShadowCopyCustomData(int32 InstanceCount, int32 NumCustomDataFloatsPerInstance, TArrayView< const float > CustomDataFloats)
Definition ISMPoolComponent.cpp:56
Definition ISMPoolComponent.h:162
FISMPoolComponentDescription Desc
Definition ISMPoolComponent.h:166
TWeakObjectPtr< UStaticMesh > StaticMesh
Definition ISMPoolComponent.h:163
TArray< float > CustomPrimitiveData
Definition ISMPoolComponent.h:165
TArray< TWeakObjectPtr< UMaterialInterface > > MaterialsOverrides
Definition ISMPoolComponent.h:164
bool operator==(const FISMPoolStaticMeshInstance &Other) const
Definition ISMPoolComponent.h:168
Definition ISMPoolComponent.h:281
TArray< int32 > FreeList
Definition ISMPoolComponent.h:320
void RemoveISM(FISMIndex ISMIndex, bool bKeepAlive, bool bRecycle)
Definition ISMPoolComponent.cpp:449
void BatchUpdateInstanceCustomData(FISMPoolMeshInfo const &MeshInfo, int32 CustomFloatIndex, float CustomFloatValue)
Definition ISMPoolComponent.cpp:381
bool bCachedKeepAlive
Definition ISMPoolComponent.h:325
int32 FISMIndex
Definition ISMPoolComponent.h:282
FISMPool()
Definition ISMPoolComponent.cpp:273
TArray< FISMPoolISM > ISMs
Definition ISMPoolComponent.h:312
TArray< int32 > FreeListISM
Definition ISMPoolComponent.h:322
void Clear()
Definition ISMPoolComponent.cpp:483
FISMPoolMeshInfo AddInstancesToISM(UISMPoolComponent *OwningComponent, const FISMPoolStaticMeshInstance &MeshInstance, int32 InstanceCount, TArrayView< const float > CustomDataFloats)
Definition ISMPoolComponent.cpp:314
bool bDisableBoundsAndTransformUpdate
Definition ISMPoolComponent.h:329
bool bCachedRecycle
Definition ISMPoolComponent.h:326
bool BatchUpdateInstancesTransforms(FISMPoolMeshInfo &MeshInfo, int32 StartInstanceIndex, TArrayView< const FTransform > NewInstancesTransforms, bool bWorldSpace, bool bMarkRenderStateDirty, bool bTeleport, bool bAllowPerInstanceRemoval)
Definition ISMPoolComponent.cpp:323
void UpdateAbsoluteTransforms(const FTransform &BaseTransform, EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport)
Definition ISMPoolComponent.cpp:558
FISMIndex GetOrAddISM(UISMPoolComponent *OwningComponent, const FISMPoolStaticMeshInstance &MeshInstance, bool &bOutISMCreated)
Definition ISMPoolComponent.cpp:279
void RemoveInstancesFromISM(const FISMPoolMeshInfo &MeshInfo)
Definition ISMPoolComponent.cpp:405
void RequestPreallocateMeshInstance(const FISMPoolStaticMeshInstance &MeshInstances)
Definition ISMPoolComponent.cpp:502
TMap< FISMPoolStaticMeshInstance, FISMIndex > MeshToISMIndex
Definition ISMPoolComponent.h:314
TSet< FISMPoolStaticMeshInstance > PrellocationQueue
Definition ISMPoolComponent.h:317
void ProcessPreallocationRequests(UISMPoolComponent *OwningComponent, int32 MaxPreallocations)
Definition ISMPoolComponent.cpp:533
Definition ResourceSize.h:31
Definition ObjectPtr.h:488
Definition WeakObjectPtrTemplates.h:25
FORCEINLINE bool HasSameIndexAndSerialNumber(const TWeakObjectPtr &Other) const
Definition WeakObjectPtrTemplates.h:273
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79