diff --git a/libraries/physics/src/ShapeInfoUtil.cpp b/libraries/physics/src/ShapeInfoUtil.cpp index 42492a235a..e98bb07052 100644 --- a/libraries/physics/src/ShapeInfoUtil.cpp +++ b/libraries/physics/src/ShapeInfoUtil.cpp @@ -91,86 +91,3 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) { } return shape; } - -/* -const DoubleHashKey& ShapeInfo::computeHash() { - if (_hash.isNull()) { - // compute hash1 - // TODO?: provide lookup table for hash/hash2 of _type rather than recompute? - int primeIndex = 0; - _doubleHashKey._hash = DoubleHashKey::hashFunction((uint32_t)_type, primeIndex++); - _doubleHashKey._hash2 = DoubleHashKey::hashFunction2((uint32_t)_type()); - - if (getData()) { - // if externalData exists we use that to continue the hash - - // compute hash - uint32_t hash = _doubleHashKey._hash; - const QVector& data = getData(); - - glm::vec3 tmpData; - int numData = data.size(); - for (int i = 0; i < numData; ++i) { - tmpData = data[i]; - for (int j = 0; j < 3; ++j) { - // NOTE: 0.49f is used to bump the float up almost half a millimeter - // so the cast to int produces a round() effect rather than a floor() - uint32_t floatHash = - DoubleHashKey::hashFunction((uint32_t)(tmpData[j] * MILLIMETERS_PER_METER + copysignf(1.0f, tmpData[j]) * 0.49f), primeIndex++); - hash ^= floatHash; - } - } - _doubleHashKey._hash = (int32_t)hash; - - // compute hash2 - hash = _doubleHashKey._hash2; - for (int i = 0; i < numData; ++i) { - tmpData = data[i]; - for (int j = 0; j < 3; ++j) { - // NOTE: 0.49f is used to bump the float up almost half a millimeter - // so the cast to int produces a round() effect rather than a floor() - uint32_t floatHash = - DoubleHashKey::hashFunction2((uint32_t)(tmpData[j] * MILLIMETERS_PER_METER + copysignf(1.0f, tmpData[j]) * 0.49f)); - hash += ~(floatHash << 17); - hash ^= (floatHash >> 11); - hash += (floatHash << 4); - hash ^= (floatHash >> 7); - hash += ~(floatHash << 10); - hash = (hash << 16) | (hash >> 16); - } - } - _doubleHashKey._hash2 = (uint32_t)hash; - } else { - // this shape info has no external data so we just use extents to continue hash - // compute hash1 - uint32_t hash = _doubleHashKey._hash; - for (int j = 0; j < 3; ++j) { - // NOTE: 0.49f is used to bump the float up almost half a millimeter - // so the cast to int produces a round() effect rather than a floor() - uint32_t floatHash = - DoubleHashKey::hashFunction((uint32_t)(_halfExtents[j] * MILLIMETERS_PER_METER + copysignf(1.0f, _halfExtents[j]) * 0.49f), primeIndex++); - hash ^= floatHash; - } - _doubleHashKey._hash = (uint32_t)hash; - - // compute hash2 - hash = _doubleHashKey._hash2; - for (int j = 0; j < 3; ++j) { - // NOTE: 0.49f is used to bump the float up almost half a millimeter - // so the cast to int produces a round() effect rather than a floor() - uint32_t floatHash = - DoubleHashKey::hashFunction2((uint32_t)(_halfExtents[j] * MILLIMETERS_PER_METER + copysignf(1.0f, _halfExtents[j]) * 0.49f)); - hash += ~(floatHash << 17); - hash ^= (floatHash >> 11); - hash += (floatHash << 4); - hash ^= (floatHash >> 7); - hash += ~(floatHash << 10); - hash = (hash << 16) | (hash >> 16); - } - _doubleHashKey._hash2 = (uint32_t)hash; - } - } - - return _doubleHashKey; -} -*/ diff --git a/libraries/physics/src/ShapeInfoUtil.h b/libraries/physics/src/ShapeInfoUtil.h index d55ad2cdfb..fb59f30c69 100644 --- a/libraries/physics/src/ShapeInfoUtil.h +++ b/libraries/physics/src/ShapeInfoUtil.h @@ -15,7 +15,6 @@ #include #include -#include #include // translates between ShapeInfo and btShape @@ -25,8 +24,6 @@ namespace ShapeInfoUtil { btCollisionShape* createShapeFromInfo(const ShapeInfo& info); - //DoubleHashKey computeHash(const ShapeInfo& info); - // TODO? just use bullet shape types everywhere? int toBulletShapeType(int shapeInfoType); int fromBulletShapeType(int bulletShapeType);