offset is included in shape key for models

This commit is contained in:
Seth Alves 2016-03-06 14:29:30 -08:00
parent dcb720a832
commit 5c585acd9a
2 changed files with 4 additions and 6 deletions

View file

@ -710,12 +710,7 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
} }
glm::vec3 collisionModelDimensions = box.getDimensions(); glm::vec3 collisionModelDimensions = box.getDimensions();
QString shapeKey = _compoundShapeURL + "," + info.setParams(type, collisionModelDimensions, _compoundShapeURL);
QString::number(_registrationPoint.x) + "," +
QString::number(_registrationPoint.y) + "," +
QString::number(_registrationPoint.z);
info.setParams(type, collisionModelDimensions, shapeKey);
info.setConvexHulls(_points); info.setConvexHulls(_points);
info.setOffset(_model->getOffset()); info.setOffset(_model->getOffset());
} }

View file

@ -1231,6 +1231,8 @@ void RenderablePolyVoxEntityItem::computeShapeInfoWorkerAsync() {
} }
glm::vec3 collisionModelDimensions = box.getDimensions(); glm::vec3 collisionModelDimensions = box.getDimensions();
// include the registrationPoint in the shape key, because the offset is already
// included in the points and the shapeManager wont know that the shape has changed.
QString shapeKey = QString(_voxelData.toBase64()) + "," + QString shapeKey = QString(_voxelData.toBase64()) + "," +
QString::number(_registrationPoint.x) + "," + QString::number(_registrationPoint.x) + "," +
QString::number(_registrationPoint.y) + "," + QString::number(_registrationPoint.y) + "," +
@ -1238,6 +1240,7 @@ void RenderablePolyVoxEntityItem::computeShapeInfoWorkerAsync() {
_shapeInfoLock.lockForWrite(); _shapeInfoLock.lockForWrite();
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey); _shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey);
_shapeInfo.setConvexHulls(points); _shapeInfo.setConvexHulls(points);
// adjustShapeInfoByRegistration(_shapeInfo);
_shapeInfoLock.unlock(); _shapeInfoLock.unlock();
_meshLock.lockForWrite(); _meshLock.lockForWrite();