Navigation
API > API/Runtime > API/Runtime/Engine
Tracks changes for instances, but that assumes storing stuff per index except the removed status which must be kept ID-based Removed items are tracked by ID and kept separate as we need to remember if an item was ever removed in order to handle these correctly. Designed to use move semantics to clear the state and transfer to the updating worker task.
| Name | FInstanceAttributeTracker |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/InstancedStaticMesh/InstanceAttributeTracker.h |
| Include Path | #include "InstancedStaticMesh/InstanceAttributeTracker.h" |
Syntax
class FInstanceAttributeTracker
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| InstancedStaticMesh/InstanceAttributeTracker.h | |||
FInstanceAttributeTracker
(
FInstanceAttributeTracker&& Other |
InstancedStaticMesh/InstanceAttributeTracker.h |
Classes
| Name | Remarks |
|---|---|
| FAnyValidIterator | Iterator for iterating tracked state with the given flags. |
| FDeltaRange | Represents the delta range for a given attribute, can either refer to the tracked data or just a span, or be empty. |
Structs
| Name | Remarks |
|---|---|
| FToBit | Helper struct to convert the flag to its bitmask at comile time. |
Enums
Public
| Name | Remarks |
|---|---|
| EFlag | Flag describing the changed attribute. Note that not all are created equal, see comments. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ElementType | uint32 | Underlying type to store per-instance masks packed in. For example, with EFlag::Num == 4, and uint32 we can store 8 masks in each element. | InstancedStaticMesh/InstanceAttributeTracker.h |
| FBitManip | UE::InstanceAttributeTracker::Implementation::FBitManip< ElementType > | InstancedStaticMesh/InstanceAttributeTracker.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AddedElementMask | ElementType | InstancedStaticMesh/InstanceAttributeTracker.h | |
| AnyFlagMask | ElementType | InstancedStaticMesh/InstanceAttributeTracker.h | |
| BitsPerElement | uint32 | InstancedStaticMesh/InstanceAttributeTracker.h | |
| IndexChangedElementMask | ElementType | Masks replicated to all masks that fit inside ElementType | InstancedStaticMesh/InstanceAttributeTracker.h |
| MasksPerElement | int32 | InstancedStaticMesh/InstanceAttributeTracker.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Data | TArray< ElementType > | Data for packed per-instance change attribute mask. | InstancedStaticMesh/InstanceAttributeTracker.h | |
| FirstChangedIndex | int32 | Tracks the first & last mask with any change flag set | InstancedStaticMesh/InstanceAttributeTracker.h | |
| FirstRemovedIdIndex | int32 | Tracks the index of the first non-zero bit in the Removed bitvector. | InstancedStaticMesh/InstanceAttributeTracker.h | |
| LastChangedIndex | int32 | InstancedStaticMesh/InstanceAttributeTracker.h | ||
| MaxIndex | int32 | Maximum valid index. | InstancedStaticMesh/InstanceAttributeTracker.h | |
| NumChanged | int32 | Tracks the number of changes for each attribute in such a way that NumChanged[Added] + NumChanged[OtherAttribute] is the total number we need to copy over. | InstancedStaticMesh/InstanceAttributeTracker.h | |
| Removed | TBitArray | Removed items are tracked by ID and kept separate as we need to remember if an item was ever removed in order to handle these correctly. | InstancedStaticMesh/InstanceAttributeTracker.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SIZE_T GetAllocatedSize() |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
FAnyValidIterator< Mask > GetChangedIterator() |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
FDeltaRange< Flag > GetDeltaRange
(
bool bForceFullUpdate, |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
ElementType GetFlags
(
int32 Index |
Get the masked flags for a given index. | InstancedStaticMesh/InstanceAttributeTracker.h | |
| Get an iterator that iterates over the IDs (note, not index as they don't exist any more) of removed instances. | InstancedStaticMesh/InstanceAttributeTracker.h | ||
bool HasAnyChanges() |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
void MarkIndex
(
int32 Index, |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
void MarkRemoved
(
FPrimitiveInstanceId Id |
Lazy allocate bits in the bit vector tracking removed instances and set the flag for the instance ID. | InstancedStaticMesh/InstanceAttributeTracker.h | |
void RemoveAt
(
FPrimitiveInstanceId Id, |
Mark removed & update the tracked bits (remove & move operation) Note: this is not something that should be used really as it forces the tracker to touch all the masks after the removed item... | InstancedStaticMesh/InstanceAttributeTracker.h | |
void RemoveAtSwap
(
FPrimitiveInstanceId Id, |
Mark removed & update the tracked bits (remove & swap operation) | InstancedStaticMesh/InstanceAttributeTracker.h | |
void Reset() |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
void SetNum
(
int32 InstanceIndexMax |
InstancedStaticMesh/InstanceAttributeTracker.h | ||
bool TestFlag
(
int32 Index |
Test a specific flag at a given index. | InstancedStaticMesh/InstanceAttributeTracker.h | |
void Validate() |
InstancedStaticMesh/InstanceAttributeTracker.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void Move
(
FInstanceAttributeTracker& Dest, |
InstancedStaticMesh/InstanceAttributeTracker.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void operator=
(
FInstanceAttributeTracker&& Other |
InstancedStaticMesh/InstanceAttributeTracker.h |