diff --git a/Demos/CcdPhysicsDemo/main.cpp b/Demos/CcdPhysicsDemo/main.cpp index 327e5430b..9f9fe2dca 100644 --- a/Demos/CcdPhysicsDemo/main.cpp +++ b/Demos/CcdPhysicsDemo/main.cpp @@ -17,6 +17,10 @@ subject to the following restrictions: #include "GlutStuff.h" #include "GLDebugDrawer.h" #include "btBulletDynamicsCommon.h" +#ifdef __DEBUG_FPU_ISSUES +#define _GNU_SOURCE +#include +#endif GLDebugDrawer gDebugDrawer; @@ -25,6 +29,14 @@ int main(int argc,char** argv) CcdPhysicsDemo* ccdDemo = new CcdPhysicsDemo(); +#ifdef __DEBUG_FPU_ISSUES +// feenableexcept (FE_DIVBYZERO); +// feenableexcept (FE_INEXACT); +// feenableexcept (FE_INVALID); +// feenableexcept (FE_OVERFLOW|FE_DIVBYZERO|FE_UNDERFLOW); +// feenableexcept (FE_UNDERFLOW); +#endif + ccdDemo->initPhysics(); ccdDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer); diff --git a/Demos/OpenGL/DemoApplication.cpp b/Demos/OpenGL/DemoApplication.cpp index 5e72beb0c..8c97eef72 100644 --- a/Demos/OpenGL/DemoApplication.cpp +++ b/Demos/OpenGL/DemoApplication.cpp @@ -200,6 +200,9 @@ void DemoApplication::updateCamera() { m_cameraPosition[2] = eyePos.getZ(); m_cameraPosition += m_cameraTargetPosition; + if (m_glutScreenWidth == 0 && m_glutScreenHeight == 0) + return; + if (m_glutScreenWidth > m_glutScreenHeight) { btScalar aspect = m_glutScreenWidth / (btScalar)m_glutScreenHeight; diff --git a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h index 78a770231..f561c65dd 100644 --- a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h +++ b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h @@ -67,7 +67,7 @@ public: int m_numConstraintRows,nub; }; - struct btConstraintInfo2 { + ATTRIBUTE_ALIGNED16(struct) btConstraintInfo2 { // integrator parameters: frames per second (1/stepsize), default error // reduction parameter (0..1). btScalar fps,erp; diff --git a/src/LinearMath/btScalar.h b/src/LinearMath/btScalar.h index 71cf13467..18489b44a 100644 --- a/src/LinearMath/btScalar.h +++ b/src/LinearMath/btScalar.h @@ -130,8 +130,8 @@ inline int btGetVersion() //non-windows systems #define SIMD_FORCE_INLINE inline - #define ATTRIBUTE_ALIGNED16(a) a - #define ATTRIBUTE_ALIGNED128(a) a + #define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16))) + #define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128))) #ifndef assert #include #endif