From 49aa535be9aaadc7ed3f8597b368d2889243ebd0 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Thu, 26 Jul 2007 03:44:21 +0000 Subject: [PATCH] updated to make projects compiler under double precision. GIMPACT compiles/links, but doesn't work properly. --- .../include/GIMPACT/core/gim_basic_geometry_operations.h | 6 +++--- Extras/GIMPACT/include/GIMPACT/core/gim_tri_collision.h | 4 ++-- src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Extras/GIMPACT/include/GIMPACT/core/gim_basic_geometry_operations.h b/Extras/GIMPACT/include/GIMPACT/core/gim_basic_geometry_operations.h index 5526fe65c..5ef7132c9 100755 --- a/Extras/GIMPACT/include/GIMPACT/core/gim_basic_geometry_operations.h +++ b/Extras/GIMPACT/include/GIMPACT/core/gim_basic_geometry_operations.h @@ -101,10 +101,10 @@ SIMD_FORCE_INLINE bool POINT_IN_HULL( const CLASS_POINT& point,const CLASS_PLANE * planes,GUINT plane_count) { GREAL _dis; - for (GUINT _i = 0;_i< plane_count;++_i) + for (GUINT _i = 0;_i< plane_count;++_i) { _dis = DISTANCE_PLANE_POINT(planes[_i],point); - if(_dis>0.0f) return false; + if(_dis>0.0f) return false; } return true; } @@ -473,7 +473,7 @@ SIMD_FORCE_INLINE void SEGMENT_COLLISION( VEC_CROSS(_M,_N,_BD); _M[3] = VEC_DOT(_M,vB1); - LINE_PLANE_COLLISION(_M,_AD,vA1,vPointA,_tp,0.0f, 1.0f); + LINE_PLANE_COLLISION(_M,_AD,vA1,vPointA,_tp,btScalar(0), btScalar(1)); /*Closest point on segment*/ VEC_DIFF(vPointB,vPointA,vB1); _tp = VEC_DOT(vPointB, _BD); diff --git a/Extras/GIMPACT/include/GIMPACT/core/gim_tri_collision.h b/Extras/GIMPACT/include/GIMPACT/core/gim_tri_collision.h index 31725ab68..dba6f742c 100755 --- a/Extras/GIMPACT/include/GIMPACT/core/gim_tri_collision.h +++ b/Extras/GIMPACT/include/GIMPACT/core/gim_tri_collision.h @@ -327,7 +327,7 @@ if 0.0<= u+v <=1.0 then they are inside of triangle faceplane[3] = m_vertices[0].dot(faceplane); } - GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam,0.0f, tmax); + GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam, btScalar(0), tmax); if(res == 0) return false; if(! is_point_inside(pout,faceplane)) return false; @@ -360,7 +360,7 @@ if 0.0<= u+v <=1.0 then they are inside of triangle faceplane[3] = m_vertices[0].dot(faceplane); } - GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam,0.0f, tmax); + GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam, btScalar(0), tmax); if(res != 1) return false; if(!is_point_inside(pout,faceplane)) return false; diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp index ad7fc3a26..15204560b 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -345,7 +345,7 @@ void btHingeConstraint::solveConstraint(btScalar timeStep) // Clamp the accumulated impulse btScalar temp = m_accLimitImpulse; - m_accLimitImpulse = btMax(m_accLimitImpulse + impulseMag, 0.0f ); + m_accLimitImpulse = btMax(m_accLimitImpulse + impulseMag, btScalar(0) ); impulseMag = m_accLimitImpulse - temp;