add wires + bounding box drawing for 3D shapes/Models

This commit is contained in:
arthur.jamet
2021-06-14 10:07:08 +02:00
parent d05d6f317b
commit ae68d5ab68
11 changed files with 49 additions and 1 deletions

View File

@@ -114,6 +114,20 @@ namespace RAY::Drawables::Drawables3D
this->_color);
}
void Model::drawWiresOn(RAY::Window &)
{
if (this->_model->meshCount) {
::BoundingBox box = GetMeshBoundingBox(*this->_model->meshes);
box.min.x += this->_position.x;
box.min.y += this->_position.y;
box.min.z += this->_position.z;
box.max.x += this->_position.x;
box.max.y += this->_position.y;
box.max.z += this->_position.z;
DrawBoundingBox(box, GREEN);
}
}
void Model::setShader(const RAY::Shader &shader)
{
this->_originalShader = this->_model->materials[0].shader;