fix model hulls

This commit is contained in:
Seth Alves 2016-03-07 11:40:18 -08:00
parent 8b8604f9b0
commit 40c953e0b9

View file

@ -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());
}
}