From 8623a0606cd48be6fa43ec7095419a40b9a85bc2 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 14 Apr 2015 15:39:24 -0700 Subject: [PATCH 1/2] remove accidentally commited debug code --- libraries/entities-renderer/src/RenderableModelEntityItem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 3dd8f79fff..c67e1f04e5 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -299,7 +299,6 @@ bool RenderableModelEntityItem::isReadyToComputeShape() { } // the model is still being downloaded. - std::cout << "adebug still being downloaded" << std::endl; // adebug return false; } return true; From aec42cf2dc64935fa22dfc4beb422d207b86c330 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 14 Apr 2015 15:39:49 -0700 Subject: [PATCH 2/2] enforce ShapeType agreement for ModeEntityItem --- libraries/entities/src/ModelEntityItem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index acee2a594f..e98f784765 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -276,6 +276,16 @@ void ModelEntityItem::debugDump() const { } void ModelEntityItem::updateShapeType(ShapeType type) { + // BEGIN_TEMPORARY_WORKAROUND + // we have allowed inconsistent ShapeType's to be stored in SVO files in the past (this was a bug) + // but we are now enforcing the entity properties to be consistent. To make the possible we're + // introducing a temporary workaround: we will ignore ShapeType updates that conflict with the + // _collisionModelURL. + if (hasCollisionModel()) { + type = SHAPE_TYPE_COMPOUND; + } + // END_TEMPORARY_WORKAROUND + if (type != _shapeType) { _shapeType = type; _dirtyFlags |= EntityItem::DIRTY_SHAPE | EntityItem::DIRTY_MASS; @@ -296,6 +306,7 @@ void ModelEntityItem::setCollisionModelURL(const QString& url) { if (_collisionModelURL != url) { _collisionModelURL = url; _dirtyFlags |= EntityItem::DIRTY_SHAPE | EntityItem::DIRTY_MASS; + _shapeType = _collisionModelURL.isEmpty() ? SHAPE_TYPE_NONE : SHAPE_TYPE_COMPOUND; } }