mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:56:44 +02:00
clean up, minimize diff
This commit is contained in:
parent
c96a09976e
commit
4ab2bfa854
1 changed files with 13 additions and 10 deletions
|
@ -210,6 +210,7 @@ void RenderableModelEntityItem::removeFromScene(EntityItemPointer self, std::sha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// NOTE: this only renders the "meta" portion of the Model, namely it renders debugging items, and it handles
|
// NOTE: this only renders the "meta" portion of the Model, namely it renders debugging items, and it handles
|
||||||
// the per frame simulation/update that might be required if the models properties changed.
|
// the per frame simulation/update that might be required if the models properties changed.
|
||||||
void RenderableModelEntityItem::render(RenderArgs* args) {
|
void RenderableModelEntityItem::render(RenderArgs* args) {
|
||||||
|
@ -249,6 +250,7 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
||||||
_model->setVisibleInScene(getVisible(), scene);
|
_model->setVisibleInScene(getVisible(), scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
remapTextures();
|
remapTextures();
|
||||||
} else {
|
} else {
|
||||||
static glm::vec4 greenColor(0.0f, 1.0f, 0.0f, 1.0f);
|
static glm::vec4 greenColor(0.0f, 1.0f, 0.0f, 1.0f);
|
||||||
|
@ -304,22 +306,23 @@ Model* RenderableModelEntityItem::getModel(EntityTreeRenderer* renderer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderableModelEntityItem::needsToCallUpdate() const {
|
bool RenderableModelEntityItem::needsToCallUpdate() const {
|
||||||
if (EntityItem::needsToCallUpdate()) {
|
if (!_dimensionsInitialized || _needsInitialSimulation || ModelEntityItem::needsToCallUpdate()) {
|
||||||
return true;
|
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()) {
|
if (!_dimensionsInitialized && _model && _model->isActive()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_myRenderer && (!_model || _needsModelReload)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (_model) {
|
if (_model) {
|
||||||
if (hasAnimation()) {
|
if (hasAnimation() || jointsMapped()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool movingOrAnimating = isMoving() || isAnimatingSomething();
|
bool movingOrAnimating = isMoving() || isAnimatingSomething();
|
||||||
if ((movingOrAnimating ||
|
if ((movingOrAnimating ||
|
||||||
_needsInitialSimulation ||
|
_needsInitialSimulation ||
|
||||||
|
@ -339,14 +342,14 @@ void RenderableModelEntityItem::update(const quint64& now) {
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
auto extents = _model->getMeshExtents();
|
auto extents = _model->getMeshExtents();
|
||||||
properties.setDimensions(extents.maximum - extents.minimum);
|
properties.setDimensions(extents.maximum - extents.minimum);
|
||||||
|
|
||||||
qCDebug(entitiesrenderer) << "Autoresizing:" << (!getName().isEmpty() ? getName() : getModelURL());
|
qCDebug(entitiesrenderer) << "Autoresizing:" << (!getName().isEmpty() ? getName() : getModelURL());
|
||||||
QMetaObject::invokeMethod(DependencyManager::get<EntityScriptingInterface>().data(), "editEntity",
|
QMetaObject::invokeMethod(DependencyManager::get<EntityScriptingInterface>().data(), "editEntity",
|
||||||
Qt::QueuedConnection,
|
Qt::QueuedConnection,
|
||||||
Q_ARG(QUuid, getEntityItemID()),
|
Q_ARG(QUuid, getEntityItemID()),
|
||||||
Q_ARG(EntityItemProperties, properties));
|
Q_ARG(EntityItemProperties, properties));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_myRenderer && (!_model || _needsModelReload)) {
|
if (_myRenderer && (!_model || _needsModelReload)) {
|
||||||
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
// TODO: this getModel() appears to be about 3% of model render time. We should optimize
|
||||||
PerformanceTimer perfTimer("getModel");
|
PerformanceTimer perfTimer("getModel");
|
||||||
|
|
Loading…
Reference in a new issue