mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:18:36 +02:00
Merge pull request #6639 from sethalves/dont-simulate-model-too-soon
don't simulate model until it has geometry
This commit is contained in:
commit
beeb3becd6
1 changed files with 8 additions and 7 deletions
|
@ -455,13 +455,6 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
|
||||||
return false; // hmm...
|
return false; // hmm...
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_needsInitialSimulation) {
|
|
||||||
// the _model's offset will be wrong until _needsInitialSimulation is false
|
|
||||||
PerformanceTimer perfTimer("_model->simulate");
|
|
||||||
_model->simulate(0.0f);
|
|
||||||
_needsInitialSimulation = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(!_model->getCollisionURL().isEmpty());
|
assert(!_model->getCollisionURL().isEmpty());
|
||||||
|
|
||||||
if (_model->getURL().isEmpty()) {
|
if (_model->getURL().isEmpty()) {
|
||||||
|
@ -475,6 +468,14 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
|
||||||
if ((collisionNetworkGeometry && collisionNetworkGeometry->isLoaded()) &&
|
if ((collisionNetworkGeometry && collisionNetworkGeometry->isLoaded()) &&
|
||||||
(renderNetworkGeometry && renderNetworkGeometry->isLoaded())) {
|
(renderNetworkGeometry && renderNetworkGeometry->isLoaded())) {
|
||||||
// we have both URLs AND both geometries AND they are both fully loaded.
|
// we have both URLs AND both geometries AND they are both fully loaded.
|
||||||
|
|
||||||
|
if (_needsInitialSimulation) {
|
||||||
|
// the _model's offset will be wrong until _needsInitialSimulation is false
|
||||||
|
PerformanceTimer perfTimer("_model->simulate");
|
||||||
|
_model->simulate(0.0f);
|
||||||
|
_needsInitialSimulation = false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue