t
Loading...
Searching...
No Matches
t::BufferAttribute< BufferType > Class Template Reference

A class representing attributes, such as vertex positions, face indices, and vertex normals. More...

#include <BufferAttribute.hpp>

Public Member Functions

 BufferAttribute (std::initializer_list< BufferType > _array, int _itemSize)
 Creates a new buffer attribute with the specified array and item size.
 

Public Attributes

std::vector< BufferType > array
 The array holding the data of the attribute.
 
int itemSize
 The number of values of the array that are associated with a particular vertex e.g.
 

Detailed Description

template<class BufferType>
class t::BufferAttribute< BufferType >

A class representing attributes, such as vertex positions, face indices, and vertex normals.

An attribute is a buffer (array) storing data associated with a type of primitve. For example:

  • the vertex positions attribute (a.k.a. the vertex buffer) stores the positions of the vertices of a mesh. Every 3 consecutive values in the array specify the x, y, and z coordinates of a vertex. It is required for all geometries;
  • the face indices attribute (a.k.a. the index buffer) stores the indices of the vertices of the faces of a mesh;
  • the vertex normals attribute (a.k.a. the normal buffer) stores the vertex normals of a mesh.

Constructor & Destructor Documentation

◆ BufferAttribute()

template<class BufferType >
t::BufferAttribute< BufferType >::BufferAttribute ( std::initializer_list< BufferType > _array,
int _itemSize )
inline

Creates a new buffer attribute with the specified array and item size.

Parameters
_arrayThe array holding the data of the attribute.
_itemSizeThe number of values of the array that are associated with a particular vertex.

Member Data Documentation

◆ itemSize

The number of values of the array that are associated with a particular vertex e.g.

for vertex positions, itemSize should be 3 as a position in 3D space is specified using 3 values.


The documentation for this class was generated from the following file: