mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-15 18:13:15 +02:00
move some more code over
This commit is contained in:
parent
cfcff42004
commit
5cd047da15
1 changed files with 11 additions and 11 deletions
|
@ -247,18 +247,7 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
_model->setVisibleInScene(getVisible(), scene);
|
||||
}
|
||||
|
||||
|
||||
remapTextures();
|
||||
{
|
||||
// float alpha = getLocalRenderAlpha();
|
||||
|
||||
if (!_model || _needsModelReload) {
|
||||
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
||||
PerformanceTimer perfTimer("getModel");
|
||||
EntityTreeRenderer* renderer = static_cast<EntityTreeRenderer*>(args->_renderer);
|
||||
getModel(renderer);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
static glm::vec4 greenColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
gpu::Batch& batch = *args->_batch;
|
||||
|
@ -317,6 +306,11 @@ bool RenderableModelEntityItem::needsToCallUpdate() const {
|
|||
return true;
|
||||
}
|
||||
// these if statements match the structure of those in RenderableModelEntityItem::update
|
||||
if (hasModel() && _myRenderer) {
|
||||
if (!_model || _needsModelReload) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!_dimensionsInitialized && _model && _model->isActive()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -351,6 +345,12 @@ void RenderableModelEntityItem::update(const quint64& now) {
|
|||
Q_ARG(EntityItemProperties, properties));
|
||||
}
|
||||
|
||||
if (!_model || _needsModelReload) {
|
||||
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
||||
PerformanceTimer perfTimer("getModel");
|
||||
getModel(_myRenderer);
|
||||
}
|
||||
|
||||
if (_model) {
|
||||
// handle animations..
|
||||
if (hasAnimation()) {
|
||||
|
|
Loading…
Reference in a new issue