From 40c953e0b9d0770111cb6a6349cb95766413923e Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 7 Mar 2016 11:40:18 -0800 Subject: [PATCH] fix model hulls --- libraries/entities-renderer/src/RenderableModelEntityItem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 53b7674b11..71b04d06a1 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -703,6 +703,9 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) { _points[i][j] += _model->getOffset(); // scale so the collision points match the model points _points[i][j] *= scale; + // this next subtraction is done so we can give info the offset, which will cause + // the shape-key to change. + _points[i][j] -= _model->getOffset(); box += _points[i][j]; } } @@ -710,6 +713,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) { glm::vec3 collisionModelDimensions = box.getDimensions(); info.setParams(type, collisionModelDimensions, _compoundShapeURL); info.setConvexHulls(_points); + info.setOffset(_model->getOffset()); } }