t
Loading...
Searching...
No Matches
Geometry.hpp
1#include "primitives/BufferAttribute.hpp"
2#include <memory>
3#include <optional>
4
5#ifndef GEOMETRY_HPP
6#define GEOMETRY_HPP
7
8namespace t {
9
37class Geometry {
38public:
49 std::optional<BufferAttribute<int>>
58 FrontFace::CounterClockwise;
81 Geometry(const BufferAttribute<double> &_vertexPositions,
82 const BufferAttribute<double> &_vertexNormals)
83 : vertexPositions(_vertexPositions), vertexNormals(_vertexNormals) {}
84
93 void setIndices(BufferAttribute<int> _faceIndices) {
94 faceIndices = _faceIndices;
95 }
96};
97
98} // namespace t
99
100#endif // GEOMETRY_HPP
A class representing attributes, such as vertex positions, face indices, and vertex normals.
Definition BufferAttribute.hpp:27
The base 3D geometry class.
Definition Geometry.hpp:37
BufferAttribute< double > vertexNormals
The normal buffer.
Definition Geometry.hpp:54
std::optional< BufferAttribute< int > > faceIndices
The index buffer, which is optional.
Definition Geometry.hpp:50
Geometry(const BufferAttribute< double > &_vertexPositions, const BufferAttribute< double > &_vertexNormals)
Creates a new 3D geometry with the specified vertex buffer and normal buffer.
Definition Geometry.hpp:81
BufferAttribute< double > vertexPositions
The vertex buffer.
Definition Geometry.hpp:40
FrontFace frontFace
The vertex winding order which classifies the front face of a triangle.
Definition Geometry.hpp:57
void setIndices(BufferAttribute< int > _faceIndices)
Sets the index buffer of this geometry.
Definition Geometry.hpp:93
The t software 3D graphics library namespace.
Definition algorithms.hpp:12
FrontFace
The winding order that determines the front face of a triangle.
Definition constants.hpp:36