diff options
Diffstat (limited to 'thirdparty/bullet/BulletCollision/Gimpact/btQuantization.h')
-rw-r--r-- | thirdparty/bullet/BulletCollision/Gimpact/btQuantization.h | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/thirdparty/bullet/BulletCollision/Gimpact/btQuantization.h b/thirdparty/bullet/BulletCollision/Gimpact/btQuantization.h index bd2633cfc5..19a02a2177 100644 --- a/thirdparty/bullet/BulletCollision/Gimpact/btQuantization.h +++ b/thirdparty/bullet/BulletCollision/Gimpact/btQuantization.h @@ -27,54 +27,47 @@ subject to the following restrictions: #include "LinearMath/btTransform.h" - - - - - SIMD_FORCE_INLINE void bt_calc_quantization_parameters( - btVector3 & outMinBound, - btVector3 & outMaxBound, - btVector3 & bvhQuantization, - const btVector3& srcMinBound,const btVector3& srcMaxBound, + btVector3& outMinBound, + btVector3& outMaxBound, + btVector3& bvhQuantization, + const btVector3& srcMinBound, const btVector3& srcMaxBound, btScalar quantizationMargin) { //enlarge the AABB to avoid division by zero when initializing the quantization values - btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin); + btVector3 clampValue(quantizationMargin, quantizationMargin, quantizationMargin); outMinBound = srcMinBound - clampValue; outMaxBound = srcMaxBound + clampValue; btVector3 aabbSize = outMaxBound - outMinBound; bvhQuantization = btVector3(btScalar(65535.0), btScalar(65535.0), - btScalar(65535.0)) / aabbSize; + btScalar(65535.0)) / + aabbSize; } - SIMD_FORCE_INLINE void bt_quantize_clamp( unsigned short* out, const btVector3& point, - const btVector3 & min_bound, - const btVector3 & max_bound, - const btVector3 & bvhQuantization) + const btVector3& min_bound, + const btVector3& max_bound, + const btVector3& bvhQuantization) { - btVector3 clampedPoint(point); clampedPoint.setMax(min_bound); clampedPoint.setMin(max_bound); btVector3 v = (clampedPoint - min_bound) * bvhQuantization; - out[0] = (unsigned short)(v.getX()+0.5f); - out[1] = (unsigned short)(v.getY()+0.5f); - out[2] = (unsigned short)(v.getZ()+0.5f); + out[0] = (unsigned short)(v.getX() + 0.5f); + out[1] = (unsigned short)(v.getY() + 0.5f); + out[2] = (unsigned short)(v.getZ() + 0.5f); } - SIMD_FORCE_INLINE btVector3 bt_unquantize( const unsigned short* vecIn, - const btVector3 & offset, - const btVector3 & bvhQuantization) + const btVector3& offset, + const btVector3& bvhQuantization) { - btVector3 vecOut; + btVector3 vecOut; vecOut.setValue( (btScalar)(vecIn[0]) / (bvhQuantization.getX()), (btScalar)(vecIn[1]) / (bvhQuantization.getY()), @@ -83,6 +76,4 @@ SIMD_FORCE_INLINE btVector3 bt_unquantize( return vecOut; } - - -#endif // BT_GIMPACT_QUANTIZATION_H_INCLUDED +#endif // BT_GIMPACT_QUANTIZATION_H_INCLUDED |