Merge pull request #14009 from sethalves/fix-worn-shape-double-scale

fix scaling of worn shape entities
This commit is contained in:
John Conklin II 2018-09-28 13:08:46 -07:00 committed by GitHub
commit 5d00aa0bdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,10 +97,10 @@ void ShapeEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
withWriteLock([&] { withWriteLock([&] {
auto entity = getEntity(); auto entity = getEntity();
_position = entity->getWorldPosition(); _position = entity->getWorldPosition();
_dimensions = entity->getScaledDimensions(); _dimensions = entity->getUnscaledDimensions(); // get unscaled to avoid scaling twice
_orientation = entity->getWorldOrientation(); _orientation = entity->getWorldOrientation();
updateModelTransformAndBound(); updateModelTransformAndBound();
_renderTransform = getModelTransform(); _renderTransform = getModelTransform(); // contains parent scale, if this entity scales with its parent
if (_shape == entity::Sphere) { if (_shape == entity::Sphere) {
_renderTransform.postScale(SPHERE_ENTITY_SCALE); _renderTransform.postScale(SPHERE_ENTITY_SCALE);
} }