mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +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) {
|
btCollisionShape* ShapeManager::getShape(const ShapeInfo& info) {
|
||||||
if (info.getType() == SHAPE_TYPE_NONE) {
|
if (info.getType() == SHAPE_TYPE_NONE) {
|
||||||
// qDebug() << "OOOOOO type is null";
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// Very small or large objects are not supported.
|
// 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 MIN_SHAPE_DIAGONAL_SQUARED = 3.0e-4f; // 1 cm cube
|
||||||
const float MAX_SHAPE_DIAGONAL_SQUARED = 3.0e4f; // 100 m cube
|
const float MAX_SHAPE_DIAGONAL_SQUARED = 3.0e4f; // 100 m cube
|
||||||
if (diagonal < MIN_SHAPE_DIAGONAL_SQUARED || diagonal > MAX_SHAPE_DIAGONAL_SQUARED) {
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
DoubleHashKey key = info.getHash();
|
DoubleHashKey key = info.getHash();
|
||||||
ShapeReference* shapeRef = _shapeMap.find(key);
|
ShapeReference* shapeRef = _shapeMap.find(key);
|
||||||
if (shapeRef) {
|
if (shapeRef) {
|
||||||
// qDebug() << "OOOOOO ref";
|
|
||||||
shapeRef->refCount++;
|
shapeRef->refCount++;
|
||||||
return shapeRef->shape;
|
return shapeRef->shape;
|
||||||
}
|
}
|
||||||
btCollisionShape* shape = ShapeInfoUtil::createShapeFromInfo(info);
|
btCollisionShape* shape = ShapeInfoUtil::createShapeFromInfo(info);
|
||||||
if (shape) {
|
if (shape) {
|
||||||
// qDebug() << "OOOOOO shape";
|
|
||||||
ShapeReference newRef;
|
ShapeReference newRef;
|
||||||
newRef.refCount = 1;
|
newRef.refCount = 1;
|
||||||
newRef.shape = shape;
|
newRef.shape = shape;
|
||||||
|
@ -72,7 +68,7 @@ bool ShapeManager::releaseShape(const DoubleHashKey& key) {
|
||||||
collectGarbage();
|
collectGarbage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// attempt to remove shape that has no refs
|
// attempt to remove shape that has no refs
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -81,7 +77,7 @@ bool ShapeManager::releaseShape(const DoubleHashKey& key) {
|
||||||
// attempt to remove unmanaged shape
|
// attempt to remove unmanaged shape
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
assert(false);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShapeManager::releaseShape(const ShapeInfo& info) {
|
bool ShapeManager::releaseShape(const ShapeInfo& info) {
|
||||||
|
|
Loading…
Reference in a new issue