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
+15 -2
View File
@@ -7,8 +7,8 @@
#include "Drawables/ADrawable3D.hpp"
RAY::Drawables::Drawables3D::ADrawable3D::ADrawable3D(const RAY::Color &color):
_color(color)
RAY::Drawables::Drawables3D::ADrawable3D::ADrawable3D(const RAY::Vector3 &position, const RAY::Color &color):
_position(position), _color(color)
{
}
@@ -23,3 +23,16 @@ RAY::Drawables::Drawables3D::ADrawable3D &RAY::Drawables::Drawables3D::ADrawable
this->_color = color;
return *this;
}
const RAY::Vector3 &RAY::Drawables::Drawables3D::ADrawable3D::getPosition(void) const
{
return this->_position;
}
RAY::Drawables::Drawables3D::ADrawable3D &RAY::Drawables::Drawables3D::ADrawable3D::setPosition(const RAY::Vector3 &position)
{
this->_position = position;
return *this;
}