diff --git a/lib/Ray/sources/Drawables/ADrawable3D.cpp b/lib/Ray/sources/Drawables/ADrawable3D.cpp index fabc12fd..2d7cfaf2 100644 --- a/lib/Ray/sources/Drawables/ADrawable3D.cpp +++ b/lib/Ray/sources/Drawables/ADrawable3D.cpp @@ -39,4 +39,15 @@ namespace RAY::Drawables void ADrawable3D::drawWiresOn(RAY::Window &) {} + + const RAY::Color &ADrawable3D::getDebugColor(void) const + { + return this->_debugColor; + } + + ADrawable3D &ADrawable3D::setDebugColor(const Color &debugColor) + { + this->_debugColor = debugColor; + return *this; + } } \ No newline at end of file diff --git a/lib/Ray/sources/Drawables/ADrawable3D.hpp b/lib/Ray/sources/Drawables/ADrawable3D.hpp index 3c52f5de..58aa5359 100644 --- a/lib/Ray/sources/Drawables/ADrawable3D.hpp +++ b/lib/Ray/sources/Drawables/ADrawable3D.hpp @@ -35,10 +35,16 @@ namespace RAY::Drawables { //! @return the color of the ADrawable const RAY::Color &getColor(void) const; - + //! @brief set color ADrawable3D &setColor(const RAY::Color &color); + //! @return the debug color of the ADrawable + const RAY::Color &getDebugColor(void) const; + + //! @brief set the debug color + ADrawable3D &setDebugColor(const RAY::Color &debugColor); + //! @return the position of the ADrawable virtual const RAY::Vector3 &getPosition(void) const; diff --git a/sources/Map/Map.cpp b/sources/Map/Map.cpp index 9bdc22ae..49841dda 100644 --- a/sources/Map/Map.cpp +++ b/sources/Map/Map.cpp @@ -165,7 +165,7 @@ namespace BBM for (int i = 0; i < width + 1; i++) { for (int j = 0; j < height + 1; j++) { if (map[std::make_tuple(i, 0, j)] != HOLE && map[std::make_tuple(i, -1, j)] != BUMPER) - scene->addEntity("Unbreakable Wall") + scene->addEntity("Floor") .addComponent(Vector3f(i, -1, j)) .addComponent(floorObj, false, std::make_pair(MAP_DIFFUSE, floorPng)); diff --git a/sources/System/Renderer/RenderSystem.cpp b/sources/System/Renderer/RenderSystem.cpp index b6a6e735..d21065c2 100644 --- a/sources/System/Renderer/RenderSystem.cpp +++ b/sources/System/Renderer/RenderSystem.cpp @@ -33,6 +33,7 @@ namespace BBM //draws hitbox if (dimsComponent) { RAY::Drawables::Drawables3D::Cube boundingBox(posComponent.position, dimsComponent->bound, WHITE); + boundingBox.setDebugColor(RED); boundingBox.drawWiresOn(this->_window); } //draws models contours @@ -52,11 +53,11 @@ namespace BBM if (modelShader) modelShader->model->setShader(modelShader->getShader()); drawable.drawable->setPosition(pos.position); - if (this->_debugMode) - this->drawBoundingBox(entity, pos, drawable); drawable.drawable->drawOn(this->_window); if (modelShader) modelShader->model->resetShader(); + if (this->_debugMode) + this->drawBoundingBox(entity, pos, drawable); } this->_window.unuseCamera();