engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | Protected 属性 | 友元 | 所有成员列表
FAttributesSetBase类 参考

This is the container for all attributes and their arrays. 更多...

#include <MeshAttributeArray.h>

+ 类 FAttributesSetBase 继承关系图:

Public 成员函数

 FAttributesSetBase ()
 Constructor
 
template<typename Allocator >
void GetAttributeNames (TArray< FName, Allocator > &OutAttributeNames) const
 Returns an array of all the attribute names registered
 
bool HasAttribute (const FName AttributeName) const
 Determines whether an attribute exists with the given name
 
template<typename AttributeType >
bool HasAttributeOfType (const FName AttributeName) const
 Determines whether an attribute of the given type exists with the given name
 
void Initialize (const int32 Count)
 Initializes all attributes to have the given number of elements with the default value
 
template<typename AttributeType >
void RegisterAttribute (const FName AttributeName, const int32 NumberOfIndices=1, const AttributeType &Default=AttributeType(), const EMeshAttributeFlags Flags=EMeshAttributeFlags::None)
 Register a new attribute name with the given type (must be a member of the AttributeTypes tuple). 更多...
 
void Remap (const TSparseArray< int32 > &IndexRemap)
 Applies the given remapping to the attributes set
 
void UnregisterAttribute (const FName AttributeName)
 Unregister an attribute with the given name.
 

Protected 成员函数

void Insert (const int32 Index)
 Insert a new element at the given index. 更多...
 
void Remove (const int32 Index)
 Remove an element at the given index. 更多...
 

Protected 属性

TMap< FName, FAttributesSetEntry > Map
 The actual container
 
int32 NumElements
 The number of elements in each attribute array
 

友元

MESHDESCRIPTION_API FArchive & operator<< (FArchive &Ar, FAttributesSetBase &AttributesSet)
 Serialization
 

详细描述

This is the container for all attributes and their arrays.

It wraps a TMap, mapping from attribute name to attribute array. An attribute may be of any arbitrary type; we use a mixture of polymorphism and compile-time templates to handle the different types.

成员函数说明

◆ Insert()

void FAttributesSetBase::Insert ( const int32  Index)
inlineprotected

Insert a new element at the given index.

The public API version of this function takes an ID of ElementIDType instead of a typeless index.

◆ RegisterAttribute()

template<typename AttributeType >
void FAttributesSetBase::RegisterAttribute ( const FName  AttributeName,
const int32  NumberOfIndices = 1,
const AttributeType &  Default = AttributeType(),
const EMeshAttributeFlags  Flags = EMeshAttributeFlags::None 
)

Register a new attribute name with the given type (must be a member of the AttributeTypes tuple).

If the attribute name is already registered, it will update it to use the new type, number of indices and flags.

Example of use:

VertexInstanceAttributes().RegisterAttribute<FVector2D>( "UV", 8 );
                   . . .
TVertexInstanceAttributeArray<FVector2D>& UV0 = VertexInstanceAttributes().GetAttributes<FVector2D>( "UV", 0 );
UV0[ VertexInstanceID ] = FVector2D( 1.0f, 1.0f );

◆ Remove()

void FAttributesSetBase::Remove ( const int32  Index)
inlineprotected

Remove an element at the given index.

The public API version of this function takes an ID of ElementIDType instead of a typeless index.


该类的文档由以下文件生成: