3D drawables all have a position. Non-positionable object will throw an error when a setter/getter is called

This commit is contained in:
arthur.jamet
2021-05-24 11:45:17 +02:00
parent 60cfc7f9be
commit 1624b53baa
22 changed files with 78 additions and 156 deletions
+13 -3
View File
@@ -17,8 +17,9 @@ namespace RAY::Drawables::Drawables3D {
class ADrawable3D: public IDrawable
{
public:
//! @param Color Color of the drawable
ADrawable3D(const RAY::Color &color);
//! @param Color Color of the drawable
//! @param Position Position of the drawable (wether its center or start position for lines)
ADrawable3D(const RAY::Vector3 &position, const RAY::Color &color);
//! @brief A default copy constructor
ADrawable3D(const ADrawable3D &) = default;
@@ -30,12 +31,21 @@ namespace RAY::Drawables::Drawables3D {
virtual void drawOn(RAY::Window &) = 0;
//! @return the color of the ADrawable
const Color &getColor(void) const;
const RAY::Color &getColor(void) const;
//! @brief set color
ADrawable3D &setColor(const RAY::Color &color);
//! @return the position of the ADrawable
virtual const Vector3 &getPosition(void) const;
//! @brief set position
virtual ADrawable3D &setPosition(const Vector3 &position);
protected:
//! @brief Position of the ADrawable
Vector3 _position;
//! @brief Color of the ADrawable
Color _color;