prettify the debug wireframe drawing of sphere, capsule, cylinder and cone

add an btAssert in normalize of btVector3 and 'normalized' always use 'normalize'
This commit is contained in:
erwin.coumans
2013-09-17 02:01:14 +00:00
parent 5f5d601ebf
commit 858c890c96
2 changed files with 85 additions and 60 deletions

View File

@@ -289,6 +289,9 @@ public:
* x^2 + y^2 + z^2 = 1 */
SIMD_FORCE_INLINE btVector3& normalize()
{
btAssert(length() != btScalar(0));
#if defined(BT_USE_SSE_IN_API) && defined (BT_USE_SSE)
// dot product first
__m128 vd = _mm_mul_ps(mVec128, mVec128);
@@ -940,13 +943,9 @@ SIMD_FORCE_INLINE btScalar btVector3::distance(const btVector3& v) const
SIMD_FORCE_INLINE btVector3 btVector3::normalized() const
{
#if defined(BT_USE_SSE_IN_API) && defined (BT_USE_SSE)
btVector3 norm = *this;
return norm.normalize();
#else
return *this / length();
#endif
}
SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar _angle ) const