|
Infinity Engine v0.6.20
C++ API Documentation
|
Container for mesh vertex attribute data. More...
#include <VertexBuffer.hpp>
Public Member Functions | |
| VertexBuffer () | |
| Default constructor. | |
| virtual | ~VertexBuffer () |
| Destructor. | |
| std::unique_ptr< Core::Base > | clone () const override |
| const Infinity::Types::TypeID & | typeId () const override |
| Gets the TypeID for VertexBuffer. | |
Public Member Functions inherited from Infinity::Types::Core::Data | |
| Data () | |
| Data (const Data &other) | |
| Data (Data &&other) | |
| Data & | operator= (const Data &other) |
| Data & | operator= (Data &&other) |
| virtual | ~Data () |
| Virtual destructor. | |
| bool | hasProperty (const std::string &key) const |
| template<typename T > | |
| void | setProperty (const std::string &key, T &&value) |
| Sets a typed property value. | |
| template<typename T > | |
| void | setProperty (const std::string &key, const T &value) |
| Sets a typed property value. | |
| void | setProperty (const std::string &key, PropertyValue &&value) |
| Sets a typed property value. | |
| const PropertyValue & | getProperty (const std::string &key) const |
| Gets a property value without type checking. | |
| template<typename T > | |
| const T & | getProperty (const std::string &key) const |
| Gets a typed property value. | |
| void | removeProperty (const std::string &key) |
Public Member Functions inherited from Infinity::Types::Core::Base | |
| virtual | ~Base () |
| Virtual destructor. | |
| virtual std::istream & | legibleDataRead (std::istream &in) override |
| Deserializes the object from a single-line text representation. | |
| virtual std::ostream & | legibleDataWrite (std::ostream &out) const override |
| Serializes the object to a single-line text representation. | |
Public Attributes | |
| Containers::Array< Infinity::Types::Math::Vector3 > | positions |
| Vertex positions in object/local space. | |
| Containers::Array< Infinity::Types::Math::Vector3 > | normals |
| Vertex normal vectors. | |
| Containers::Array< Infinity::Types::Math::Vector2 > | uvs |
| Texture coordinates (UVs). | |
| Containers::Array< Infinity::Types::Math::Vector4 > | colors |
| Per-vertex colors. | |
| Containers::Array< Infinity::Types::Math::Vector4 > | tangents |
| Tangent vectors with handedness. | |
Public Attributes inherited from Infinity::Types::Core::Data | |
| std::unordered_map< std::string, PropertyValue > | properties |
| Property storage for arbitrary metadata. | |
Container for mesh vertex attribute data.
VertexBuffer stores per-vertex attributes that define mesh geometry and appearance. It provides a structured representation of vertex data with separate arrays for each standard attribute type, enabling efficient mesh construction, manipulation, and rendering in the Infinity Engine.
The vertex buffer supports the following standard vertex attributes:
Not all attributes are required - only the arrays that are populated will be used during rendering. This allows flexible mesh definitions from simple position-only geometry to fully-featured meshes with all attributes.
Common use cases:
Example usage:
| Infinity::Types::Rendering::VertexBuffer::VertexBuffer | ( | ) |
Default constructor.
Creates an empty vertex buffer with no vertex data.
|
virtual |
Destructor.
|
overridevirtual |
Reimplemented from Infinity::Types::Core::Data.
|
overridevirtual |
Gets the TypeID for VertexBuffer.
Reimplemented from Infinity::Types::Core::Data.
| Containers::Array<Infinity::Types::Math::Vector4> Infinity::Types::Rendering::VertexBuffer::colors |
Per-vertex colors.
RGBA color values that can be used for vertex coloring, blending, or passed to shaders for custom effects. Values typically range [0, 1].
| Containers::Array<Infinity::Types::Math::Vector3> Infinity::Types::Rendering::VertexBuffer::normals |
Vertex normal vectors.
3D unit vectors perpendicular to the surface at each vertex, used for lighting calculations. Normals should be normalized (length = 1) for correct lighting behavior.
| Containers::Array<Infinity::Types::Math::Vector3> Infinity::Types::Rendering::VertexBuffer::positions |
Vertex positions in object/local space.
3D coordinates defining vertex locations. This is typically the only required attribute - all other attributes are optional depending on the mesh's rendering requirements.
| Containers::Array<Infinity::Types::Math::Vector4> Infinity::Types::Rendering::VertexBuffer::tangents |
Tangent vectors with handedness.
4D vectors where xyz is the tangent direction and w is the handedness (+1 or -1) used to calculate the bitangent for normal mapping. Tangent vectors are perpendicular to normals and aligned with UV space.
| Containers::Array<Infinity::Types::Math::Vector2> Infinity::Types::Rendering::VertexBuffer::uvs |
Texture coordinates (UVs).
2D coordinates defining how textures map onto the mesh surface. Standard UV range is [0, 1] but can extend beyond for tiling effects.