Guillaume 1.0.0
Guillaume.
|
Represents a triangle primitive for 3D rendering. More...
#include <triangle.hpp>
Public Member Functions | |
Triangle (void) | |
Default constructor - initializes an empty triangle. | |
Triangle (const Point &p1, const Point &p2, const Point &p3) | |
Constructor from three 3D points. | |
~Triangle (void) override=default | |
Destructor. | |
![]() | |
Polygon (void) | |
Default constructor - initializes an empty polygon. | |
Polygon (const std::vector< Vertex > &vertices, const Vector< float, 3 > &rotation=Vector< float, 3 >()) | |
Constructor from a list of vertices. | |
~Polygon (void) override=default | |
Destroy the Polygon object. | |
Polygon & | addVertex (const Vertex &vertex) |
Adds a vertex to the polygon. | |
const std::vector< Vertex > & | getVertices (void) const |
Gets the vertices defining the polygon. | |
const Vector< float, 3 > & | getRotation (void) const |
Gets the rotation of the polygon in Euler angles (radians) | |
const Vector< float, 3 > & | getTranslation (void) const |
Gets the translation of the polygon in 3D space. | |
Polygon & | setRotation (const Vector< float, 3 > &rotation) |
Sets the rotation of the polygon in Euler angles (radians) | |
Polygon & | setTranslation (const Vector< float, 3 > &translation) |
Sets the translation of the polygon in 3D space. | |
![]() | |
Primitive (void) | |
Constructs a Primitive object. | |
virtual | ~Primitive (void)=default |
Destroy the Primitive object. | |
Represents a triangle primitive for 3D rendering.
The Triangle class is a derived class of Polygon that represents a triangle shape defined by three 3D points (vertices). It inherits all 3D capabilities from Polygon including normal calculation and centroid computation.
Constructor from three 3D points.
Initializes the triangle with the specified 3D vertices.
p1 | The first vertex of the triangle in 3D space |
p2 | The second vertex of the triangle in 3D space |
p3 | The third vertex of the triangle in 3D space |
|
overridedefault |
Destructor.
Cleans up the triangle resources.