mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:56:54 +02:00
Actually call render on zone entities from tree
This commit is contained in:
parent
40295ab04e
commit
46cd1f458b
1 changed files with 27 additions and 28 deletions
|
@ -641,8 +641,7 @@ void EntityTreeRenderer::renderElement(OctreeElement* element, RenderArgs* args)
|
||||||
|
|
||||||
if (entityItem->isVisible()) {
|
if (entityItem->isVisible()) {
|
||||||
|
|
||||||
// NOTE: Zone Entities are a special case we handle here... Zones don't render
|
// NOTE: Zone Entities are a special case we handle here...
|
||||||
// like other entity types. So we will skip the normal rendering tests
|
|
||||||
if (entityItem->getType() == EntityTypes::Zone) {
|
if (entityItem->getType() == EntityTypes::Zone) {
|
||||||
if (entityItem->contains(_viewState->getAvatarPosition())) {
|
if (entityItem->contains(_viewState->getAvatarPosition())) {
|
||||||
float entityVolumeEstimate = entityItem->getVolumeEstimate();
|
float entityVolumeEstimate = entityItem->getVolumeEstimate();
|
||||||
|
@ -663,42 +662,42 @@ void EntityTreeRenderer::renderElement(OctreeElement* element, RenderArgs* args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// render entityItem
|
|
||||||
AABox entityBox = entityItem->getAABox();
|
|
||||||
|
|
||||||
// TODO: some entity types (like lights) might want to be rendered even
|
|
||||||
// when they are outside of the view frustum...
|
|
||||||
float distance = args->_viewFrustum->distanceToCamera(entityBox.calcCenter());
|
|
||||||
|
|
||||||
bool outOfView = args->_viewFrustum->boxInFrustum(entityBox) == ViewFrustum::OUTSIDE;
|
// render entityItem
|
||||||
if (!outOfView) {
|
AABox entityBox = entityItem->getAABox();
|
||||||
bool bigEnoughToRender = _viewState->shouldRenderMesh(entityBox.getLargestDimension(), distance);
|
|
||||||
|
// TODO: some entity types (like lights) might want to be rendered even
|
||||||
|
// when they are outside of the view frustum...
|
||||||
|
float distance = args->_viewFrustum->distanceToCamera(entityBox.calcCenter());
|
||||||
|
|
||||||
|
bool outOfView = args->_viewFrustum->boxInFrustum(entityBox) == ViewFrustum::OUTSIDE;
|
||||||
|
if (!outOfView) {
|
||||||
|
bool bigEnoughToRender = _viewState->shouldRenderMesh(entityBox.getLargestDimension(), distance);
|
||||||
|
|
||||||
if (bigEnoughToRender) {
|
if (bigEnoughToRender) {
|
||||||
renderProxies(entityItem, args);
|
renderProxies(entityItem, args);
|
||||||
|
|
||||||
Glower* glower = NULL;
|
Glower* glower = NULL;
|
||||||
if (entityItem->getGlowLevel() > 0.0f) {
|
if (entityItem->getGlowLevel() > 0.0f) {
|
||||||
glower = new Glower(entityItem->getGlowLevel());
|
glower = new Glower(entityItem->getGlowLevel());
|
||||||
}
|
}
|
||||||
entityItem->render(args);
|
entityItem->render(args);
|
||||||
args->_itemsRendered++;
|
args->_itemsRendered++;
|
||||||
if (glower) {
|
if (glower) {
|
||||||
delete glower;
|
delete glower;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
args->_itemsTooSmall++;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
args->_itemsOutOfView++;
|
args->_itemsTooSmall++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
args->_itemsOutOfView++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float EntityTreeRenderer::getSizeScale() const {
|
float EntityTreeRenderer::getSizeScale() const {
|
||||||
return _viewState->getSizeScale();
|
return _viewState->getSizeScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue