Skip to content

Commit

Permalink
ODE: dInfinity is real infinity on x64 now
Browse files Browse the repository at this point in the history
Removed previous code
  • Loading branch information
Xottab-DUTY committed Jun 15, 2018
1 parent bc83958 commit 664ddca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
51 changes: 20 additions & 31 deletions Externals/ode/include/ode/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,40 +58,29 @@ extern "C" {

#include <math.h>



#if defined(WIN32) && (defined(MSVC) || defined(MINGW))

static union { unsigned char __c[4]; float __f; } __ode_huge_valf =

{{0,0,0x80,0x7f}};

#define _INFINITY4 (__ode_huge_valf.__f)

static union { unsigned char __c[8]; double __d; } __ode_huge_val =

{{0,0,0,0,0,0,0xf0,0x7f }};

#define _INFINITY8 (__ode_huge_val.__d)

/* Define the dInfinity macro */
#ifdef INFINITY
#ifdef dSINGLE
#define dInfinity ((float)INFINITY)
#else

#define _INFINITY8 HUGE_VAL

#define _INFINITY4 HUGE_VALF

#define dInfinity ((double)INFINITY)
#endif



#if defined(dSINGLE)

#define dInfinity _INFINITY4

#elif defined(HUGE_VAL)
#ifdef dSINGLE
#ifdef HUGE_VALF
#define dInfinity HUGE_VALF
#else

#define dInfinity _INFINITY8

#define dInfinity ((float)HUGE_VAL)
#endif
#else
#define dInfinity HUGE_VAL
#endif
#else
#ifdef dSINGLE
#define dInfinity ((float)(1.0/0.0))
#else
#define dInfinity (1.0/0.0)
#endif
#endif


Expand Down
2 changes: 1 addition & 1 deletion src/xrPhysics/Physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ IC static int CollideIntoGroup(
}

if (pushing_neg)
surface.mu = std::numeric_limits<dReal>::infinity();
surface.mu = dInfinity;

if (do_collide && collided_contacts < MAX_CONTACTS)
{
Expand Down

0 comments on commit 664ddca

Please sign in to comment.