mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 06:23:35 +02:00
Merge pull request #9994 from sethalves/avoid-deadlock-on-10k-mesh-fbx
Avoid deadlock on 10k mesh fbx
This commit is contained in:
commit
0d2e0eb9c3
2 changed files with 8 additions and 0 deletions
|
@ -812,6 +812,13 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) {
|
||||||
auto& meshes = _model->getGeometry()->getMeshes();
|
auto& meshes = _model->getGeometry()->getMeshes();
|
||||||
int32_t numMeshes = (int32_t)(meshes.size());
|
int32_t numMeshes = (int32_t)(meshes.size());
|
||||||
|
|
||||||
|
const int MAX_ALLOWED_MESH_COUNT = 500;
|
||||||
|
if (numMeshes > MAX_ALLOWED_MESH_COUNT) {
|
||||||
|
// too many will cause the deadlock timer to throw...
|
||||||
|
shapeInfo.setParams(SHAPE_TYPE_BOX, 0.5f * dimensions);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ShapeInfo::PointCollection& pointCollection = shapeInfo.getPointCollection();
|
ShapeInfo::PointCollection& pointCollection = shapeInfo.getPointCollection();
|
||||||
pointCollection.clear();
|
pointCollection.clear();
|
||||||
if (type == SHAPE_TYPE_SIMPLE_COMPOUND) {
|
if (type == SHAPE_TYPE_SIMPLE_COMPOUND) {
|
||||||
|
|
|
@ -208,6 +208,7 @@ void PhysicalEntitySimulation::getObjectsToAddToPhysics(VectorOfMotionStates& re
|
||||||
assert(!entity->getPhysicsInfo());
|
assert(!entity->getPhysicsInfo());
|
||||||
if (entity->isDead()) {
|
if (entity->isDead()) {
|
||||||
prepareEntityForDelete(entity);
|
prepareEntityForDelete(entity);
|
||||||
|
entityItr = _entitiesToAddToPhysics.erase(entityItr);
|
||||||
} else if (!entity->shouldBePhysical()) {
|
} else if (!entity->shouldBePhysical()) {
|
||||||
// this entity should no longer be on the internal _entitiesToAddToPhysics
|
// this entity should no longer be on the internal _entitiesToAddToPhysics
|
||||||
entityItr = _entitiesToAddToPhysics.erase(entityItr);
|
entityItr = _entitiesToAddToPhysics.erase(entityItr);
|
||||||
|
|
Loading…
Reference in a new issue