10#include "Misc/Optional.h"
11#include "WorldLocations.generated.h"
18 class FNetRefHandleManager;
32 FVector MinPos = { -0.5f * 2097152.0f, -0.5f * 2097152.0f, -0.5f * 2097152.0f };
36 FVector MaxPos = { +0.5f * 2097152.0f, +0.5f * 2097152.0f, +0.5f * 2097152.0f };
40 float MaxNetCullDistance = 150000.f;
67 float CullDistance = 0.0f;
73 void PostSendUpdate();
78 return ValidInfoIndexes.IsBitSet(ObjectIndex);
106 ObjectsRequiringFrequentWorldLocationUpdate.SetBitValue(ObjectIndex, ValidInfoIndexes.GetBit(ObjectIndex) &&
bRequiresFrequentUpdate);
112 return ObjectsRequiringFrequentWorldLocationUpdate.GetBit(ObjectIndex);
130 return ValidInfoIndexes.IsBitSet(ObjectIndex) ? GetObjectInfo(ObjectIndex).CullDistanceOverride !=
FLT_MAX :
false;
146 void LockDirtyInfoList(
bool bLock);
161 return (Location.X >= MinWorldPos.X && Location.Y >= MinWorldPos.Y && Location.Z >= MinWorldPos.Z &&
162 Location.X <= MaxWorldPos.X && Location.Y <= MaxWorldPos.Y && Location.Z <= MaxWorldPos.Z);
176 float CullDistance = 0.0f;
179 float CullDistanceOverride =
FLT_MAX;
184 StorageElementsPerChunk = 65536U /
sizeof(FObjectInfo),
191 return StorageIndexes[ObjectIndex];
196 return StoredObjectInfo[GetStorageIndex(ObjectIndex)];
201 return StoredObjectInfo[GetStorageIndex(ObjectIndex)];
207 FNetBitArray ValidInfoIndexes;
210 FNetBitArray ObjectsWithDirtyInfo;
213 FNetBitArray ObjectsRequiringFrequentWorldLocationUpdate;
219 FNetBitArray ReservedStorageSlot;
221 TNetChunkedArray<FObjectInfo, StorageElementsPerChunk> StoredObjectInfo;
228 float MaxNetCullDistance;
231 bool bLockdownDirtyList =
false;
236 return ValidInfoIndexes.IsBitSet(ObjectIndex) ? GetObjectInfo(ObjectIndex).WorldLocation :
FVector::Zero();
241 if (ValidInfoIndexes.IsBitSet(ObjectIndex))
243 const FObjectInfo&
Info = GetObjectInfo(ObjectIndex);
244 return Info.CullDistanceOverride ==
FLT_MAX ?
Info.CullDistance :
Info.CullDistanceOverride;
252 if (ValidInfoIndexes.IsBitSet(ObjectIndex))
254 const FObjectInfo&
Info = GetObjectInfo(ObjectIndex);
258 .CullDistance =
Info.CullDistanceOverride ==
FLT_MAX ?
Info.CullDistance :
Info.CullDistanceOverride,
constexpr FNullOpt NullOpt
Definition Optional.h:15
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Init()
Definition LockFreeList.h:4
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
Definition Engine.Build.cs:7
Definition NetBitArray.h:337
Definition WorldLocations.h:57
const FNetBitArrayView GetObjectsWithWorldInfo() const
Definition WorldLocations.h:140
bool HasInfoForObject(UE::Net::Private::FInternalNetRefIndex ObjectIndex) const
Definition WorldLocations.h:76
const FVector & GetWorldMaxPos() const
Definition WorldLocations.h:150
const FVector & GetWorldMinPos() const
Definition WorldLocations.h:149
const FNetBitArrayView GetObjectsRequiringFrequentWorldLocationUpdate() const
Definition WorldLocations.h:134
void SetObjectRequiresFrequentWorldLocationUpdate(UE::Net::Private::FInternalNetRefIndex ObjectIndex, bool bRequiresFrequentUpdate)
Definition WorldLocations.h:104
bool HasCullDistanceOverride(UE::Net::Private::FInternalNetRefIndex ObjectIndex) const
Definition WorldLocations.h:128
bool IsValidLocation(const FVector &Location) const
Definition WorldLocations.h:159
void ResetObjectsWithDirtyInfo()
FVector ClampPositionToBoundary(const FVector &Position) const
Definition WorldLocations.h:153
const FNetBitArrayView GetObjectsWithDirtyInfo() const
Definition WorldLocations.h:137
bool GetObjectRequiresFrequentWorldLocationUpdate(UE::Net::Private::FInternalNetRefIndex ObjectIndex) const
Definition WorldLocations.h:110
Definition NetRefHandleManager.h:72
Definition ReplicationSystem.h:70
Definition WorldLocations.h:26
Definition NetworkVersion.cpp:28
uint32 FInternalNetRefIndex
Definition ReplicationStateStorage.h:20
FNetBitArrayView MakeNetBitArrayView(const FNetBitArrayView::StorageWordType *Storage, uint32 BitCount)
Definition NetBitArray.h:1677
Definition AdvancedWidgetsModule.cpp:13
Definition ObjectPtr.h:488
Definition Optional.h:131
static TVector< double > Zero()
Definition Vector.h:112
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79
TVector< T > BoundToBox(const TVector< T > &Min, const TVector< T > &Max) const
Definition Vector.h:1872
Definition WorldLocations.h:47
Definition WorldLocations.h:62
FVector WorldLocation
Definition WorldLocations.h:64