mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-04 18:10:10 +02:00
handle initial simulation of _model
This commit is contained in:
parent
2dd40beed5
commit
1467a9d2eb
1 changed files with 4 additions and 8 deletions
|
@ -251,7 +251,7 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
||||||
// check if the URL has changed
|
// check if the URL has changed
|
||||||
auto& currentURL = getParsedModelURL();
|
auto& currentURL = getParsedModelURL();
|
||||||
if (currentURL != _model->getURL()) {
|
if (currentURL != _model->getURL()) {
|
||||||
qDebug().noquote() << "Updating model URL: " << currentURL.toDisplayString();
|
qCDebug(entitiesrenderer).noquote() << "Updating model URL: " << currentURL.toDisplayString();
|
||||||
_model->setURL(currentURL);
|
_model->setURL(currentURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,12 +378,6 @@ Model* RenderableModelEntityItem::getModel(EntityTreeRenderer* renderer) {
|
||||||
} else { // we already have the model we want...
|
} else { // we already have the model we want...
|
||||||
result = _model;
|
result = _model;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_model && _needsInitialSimulation) {
|
|
||||||
PerformanceTimer perfTimer("_model->simulate");
|
|
||||||
_model->simulate(0.0f);
|
|
||||||
}
|
|
||||||
_needsInitialSimulation = false;
|
|
||||||
} else { // if our desired URL is empty, we may need to delete our existing model
|
} else { // if our desired URL is empty, we may need to delete our existing model
|
||||||
if (_model) {
|
if (_model) {
|
||||||
_myRenderer->releaseModel(_model);
|
_myRenderer->releaseModel(_model);
|
||||||
|
@ -463,7 +457,9 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
|
||||||
|
|
||||||
if (_needsInitialSimulation) {
|
if (_needsInitialSimulation) {
|
||||||
// the _model's offset will be wrong until _needsInitialSimulation is false
|
// the _model's offset will be wrong until _needsInitialSimulation is false
|
||||||
return false;
|
PerformanceTimer perfTimer("_model->simulate");
|
||||||
|
_model->simulate(0.0f);
|
||||||
|
_needsInitialSimulation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!_model->getCollisionURL().isEmpty());
|
assert(!_model->getCollisionURL().isEmpty());
|
||||||
|
|
Loading…
Reference in a new issue