mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +02:00
Merge pull request #11638 from ZappoMan/fixWireframe
fix the rendering of wireframe for model entities with bad model URLs
This commit is contained in:
commit
87294b8e67
1 changed files with 3 additions and 2 deletions
|
@ -951,7 +951,7 @@ using namespace render;
|
||||||
using namespace render::entities;
|
using namespace render::entities;
|
||||||
|
|
||||||
ItemKey ModelEntityRenderer::getKey() {
|
ItemKey ModelEntityRenderer::getKey() {
|
||||||
return ItemKey::Builder().withTypeMeta();
|
return ItemKey::Builder().withTypeMeta().withTypeShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ModelEntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
uint32_t ModelEntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
||||||
|
@ -1307,7 +1307,8 @@ void ModelEntityRenderer::doRender(RenderArgs* args) {
|
||||||
model = _model;
|
model = _model;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (_model && _model->didVisualGeometryRequestFail()) {
|
// If we don't have a model, or the model doesn't have visual geometry, render our bounding box as green wireframe
|
||||||
|
if (!model || (model && model->didVisualGeometryRequestFail())) {
|
||||||
static glm::vec4 greenColor(0.0f, 1.0f, 0.0f, 1.0f);
|
static glm::vec4 greenColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||||
gpu::Batch& batch = *args->_batch;
|
gpu::Batch& batch = *args->_batch;
|
||||||
batch.setModelTransform(_modelTransform); // we want to include the scale as well
|
batch.setModelTransform(_modelTransform); // we want to include the scale as well
|
||||||
|
|
Loading…
Reference in a new issue