Guillaume 1.0.0
Guillaume.
|
Represents a rectangle primitive. The Rectangle class is a derived class of Polygon that represents a rectangle shape defined by its width and height. It provides methods to manage the points and render the rectangle. More...
#include <rectangle.hpp>
Public Member Functions | |
Rectangle (void) | |
Default constructor - initializes an square centered at origin with width and height of 1 unit. | |
~Rectangle (void) override=default | |
Destructor. | |
float | getWidth () const |
Accessors. | |
float | getHeight () const |
Accessors. | |
Rectangle & | setDimensions (float width, float height) |
Sets the dimensions of the rectangle. | |
Rectangle & | setHeight (float height) |
Sets the height of the rectangle. | |
Rectangle & | setWidth (float width) |
Sets the width of the rectangle. | |
![]() | |
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 rectangle primitive. The Rectangle class is a derived class of Polygon that represents a rectangle shape defined by its width and height. It provides methods to manage the points and render the rectangle.
|
inline |
Sets the dimensions of the rectangle.
This method sets the width and height of the rectangle.
width | The width of the rectangle. |
height | The height of the rectangle. |
|
inline |
Sets the height of the rectangle.
This method sets the height of the rectangle.
height | The height of the rectangle. |
|
inline |
Sets the width of the rectangle.
This method sets the width of the rectangle.
width | The width of the rectangle. |