From 2a08a6d48e1f2a7fdd2fa62d3220bb2796367be0 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 19 Nov 2014 16:07:07 -0800 Subject: [PATCH] fix a bug in updateEntity() caused by the new properties not containing registrationPoint --- libraries/entities/src/UpdateEntityOperator.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/entities/src/UpdateEntityOperator.cpp b/libraries/entities/src/UpdateEntityOperator.cpp index 2f70e96c60..9cee11d73c 100644 --- a/libraries/entities/src/UpdateEntityOperator.cpp +++ b/libraries/entities/src/UpdateEntityOperator.cpp @@ -47,6 +47,13 @@ UpdateEntityOperator::UpdateEntityOperator(EntityTree* tree, // the getMaximumAACube is the relaxed form. _oldEntityCube = _existingEntity->getMaximumAACube(); _oldEntityBox = _oldEntityCube.clamp(0.0f, 1.0f); // clamp to domain bounds + + // If the old properties doesn't contain the properties required to calculate a bounding box, + // get them from the existing entity. Registration point is required to correctly calculate + // the bounding box. + if (!_properties.registrationPointChanged()) { + _properties.setRegistrationPoint(_existingEntity->getRegistrationPoint()); + } // If the new properties has position OR dimension changes, but not both, we need to // get the old property value and set it in our properties in order for our bounds