mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 13:25:10 +00:00
adding red color for collisions boxes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,12 @@ namespace RAY::Drawables {
|
||||
//! @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;
|
||||
|
||||
|
||||
@@ -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<PositionComponent>(Vector3f(i, -1, j))
|
||||
.addComponent<Drawable3DComponent, RAY3D::Model>(floorObj, false,
|
||||
std::make_pair(MAP_DIFFUSE, floorPng));
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user