mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 19:10:38 +02:00
change shape-key when registration point changes so shape cache doesn't incorrectly reuse the old shape
This commit is contained in:
parent
9346171695
commit
8bc2c76a8b
2 changed files with 10 additions and 3 deletions
|
@ -700,7 +700,11 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
|||
}
|
||||
|
||||
glm::vec3 collisionModelDimensions = box.getDimensions();
|
||||
info.setParams(type, collisionModelDimensions, _compoundShapeURL);
|
||||
QString shapeKey = _compoundShapeURL + "," +
|
||||
QString::number(_registrationPoint.x) + "," +
|
||||
QString::number(_registrationPoint.y) + "," +
|
||||
QString::number(_registrationPoint.z);
|
||||
info.setParams(type, collisionModelDimensions, shapeKey);
|
||||
info.setConvexHulls(_points);
|
||||
adjustShapeInfoByRegistration(info);
|
||||
}
|
||||
|
|
|
@ -1224,9 +1224,12 @@ void RenderablePolyVoxEntityItem::computeShapeInfoWorkerAsync() {
|
|||
}
|
||||
|
||||
glm::vec3 collisionModelDimensions = box.getDimensions();
|
||||
QByteArray b64 = _voxelData.toBase64();
|
||||
QString shapeKey = QString(_voxelData.toBase64()) + "," +
|
||||
QString::number(_registrationPoint.x) + "," +
|
||||
QString::number(_registrationPoint.y) + "," +
|
||||
QString::number(_registrationPoint.z);
|
||||
_shapeInfoLock.lockForWrite();
|
||||
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, QString(b64));
|
||||
_shapeInfo.setParams(SHAPE_TYPE_COMPOUND, collisionModelDimensions, shapeKey);
|
||||
_shapeInfo.setConvexHulls(points);
|
||||
adjustShapeInfoByRegistration(_shapeInfo);
|
||||
_shapeInfoLock.unlock();
|
||||
|
|
Loading…
Reference in a new issue