mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 02:37:02 +02:00
still recovering from troubled merge
This commit is contained in:
parent
2345e5a4f9
commit
8481a65fbb
1 changed files with 2 additions and 6 deletions
|
@ -29,7 +29,6 @@ ShapeManager::~ShapeManager() {
|
|||
|
||||
btCollisionShape* ShapeManager::getShape(const ShapeInfo& info) {
|
||||
if (info.getType() == SHAPE_TYPE_NONE) {
|
||||
// qDebug() << "OOOOOO type is null";
|
||||
return NULL;
|
||||
}
|
||||
// Very small or large objects are not supported.
|
||||
|
@ -37,19 +36,16 @@ btCollisionShape* ShapeManager::getShape(const ShapeInfo& info) {
|
|||
const float MIN_SHAPE_DIAGONAL_SQUARED = 3.0e-4f; // 1 cm cube
|
||||
const float MAX_SHAPE_DIAGONAL_SQUARED = 3.0e4f; // 100 m cube
|
||||
if (diagonal < MIN_SHAPE_DIAGONAL_SQUARED || diagonal > MAX_SHAPE_DIAGONAL_SQUARED) {
|
||||
// qDebug() << "OOOOOO too small " << diagonal << MIN_SHAPE_DIAGONAL_SQUARED << MAX_SHAPE_DIAGONAL_SQUARED;
|
||||
return NULL;
|
||||
}
|
||||
DoubleHashKey key = info.getHash();
|
||||
ShapeReference* shapeRef = _shapeMap.find(key);
|
||||
if (shapeRef) {
|
||||
// qDebug() << "OOOOOO ref";
|
||||
shapeRef->refCount++;
|
||||
return shapeRef->shape;
|
||||
}
|
||||
btCollisionShape* shape = ShapeInfoUtil::createShapeFromInfo(info);
|
||||
if (shape) {
|
||||
// qDebug() << "OOOOOO shape";
|
||||
ShapeReference newRef;
|
||||
newRef.refCount = 1;
|
||||
newRef.shape = shape;
|
||||
|
@ -72,7 +68,7 @@ bool ShapeManager::releaseShape(const DoubleHashKey& key) {
|
|||
collectGarbage();
|
||||
}
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
} else {
|
||||
// attempt to remove shape that has no refs
|
||||
assert(false);
|
||||
|
@ -81,7 +77,7 @@ bool ShapeManager::releaseShape(const DoubleHashKey& key) {
|
|||
// attempt to remove unmanaged shape
|
||||
assert(false);
|
||||
}
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShapeManager::releaseShape(const ShapeInfo& info) {
|
||||
|
|
Loading…
Reference in a new issue