#include <vertexattribute.h>
Public Member Functions | |
virtual void | reserve (size_t numElements) override |
virtual size_t | getCapacity () const override |
void | resize (size_t numElements) |
void | clear () |
const std::vector< ELEMENTTYPE > & | getData () const |
std::vector< ELEMENTTYPE > & | getData () |
void | addData (const ELEMENTTYPE &element) |
void | addData (const ELEMENTTYPE *elements, int numElements) |
void | setData (const std::vector< ELEMENTTYPE > &values) |
void | setData (const ELEMENTTYPE *elements, int numElements) |
virtual VkFormat | getFormat () const override |
virtual int | getCount () const override |
ELEMENTTYPE & | operator[] (std::size_t index) |
const ELEMENTTYPE & | operator[] (std::size_t index) const |
![]() | |
BaseVertexAttribute () | |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
std::vector< ELEMENTTYPE > | mData |
Actual typed data of the attribute. More... | |
![]() | |
std::string | mAttributeID |
Name/ID of the attribute. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Member Functions | |
virtual void * | getRawData () override |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Typed interface for vertex attributes. CPU data can be read by using getValues(). CPU data can be updated by using the various other functions. Make sure to call MeshInstance::update() after edits are performed. Notice that all known vertex attribute types have specializations for GetType and GetNumComponents.
void addData | ( | const ELEMENTTYPE & | element | ) |
Adds a single element to the end of the buffer. Data is copied.
element | to add. |
void addData | ( | const ELEMENTTYPE * | elements, |
int | numElements | ||
) |
Adds data to the existing data in the buffer. Data is copied.
elements | pointer to the elements to add. |
numElements | number of elements in buffer to add. |
void clear | ( | ) |
Clears all data associated with this attribute
|
overridevirtual |
Implements BaseVertexAttribute.
|
overridevirtual |
Implements BaseVertexAttribute.
std::vector<ELEMENTTYPE>& getData | ( | ) |
const std::vector<ELEMENTTYPE>& getData | ( | ) | const |
|
overridevirtual |
Implements BaseVertexAttribute.
|
overrideprotectedvirtual |
Implementation for all typed buffer, returns data.
Implements BaseVertexAttribute.
ELEMENTTYPE& operator[] | ( | std::size_t | index | ) |
Array subscript overload
index | the index of the attribute value |
const ELEMENTTYPE& operator[] | ( | std::size_t | index | ) | const |
Const array subscript overload
index | the index of the attribute value |
|
overridevirtual |
Reserves a certain amount of CPU memory to hold the given number of elements
numElements | the number of elements to reserve memory for. |
Implements BaseVertexAttribute.
void resize | ( | size_t | numElements | ) |
Resizes the data container to hold the given number of elements.
numElements | the new number of elements. |
void setData | ( | const ELEMENTTYPE * | elements, |
int | numElements | ||
) |
Sets the entire vertex attribute buffer.
elements | pointer to the elements to copy. |
numElements | amount of elements to copy. |
void setData | ( | const std::vector< ELEMENTTYPE > & | values | ) |
Sets the internal values based on the contained type
values | the values that will be copied over |
std::vector<ELEMENTTYPE> mData |
Actual typed data of the attribute.