The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macros Are Evil
08-28-2015, 10:21 AM,
#1
Macros Are Evil
So I've spent some time today try to figure out why cars are still flying off in random directions when hitting curbs sometimes.

It turns out it is a bug in Bullet, to be more specific in the SIMD_DEGS_PER_RAD macro.

Code:
#define SIMD_PI           btScalar(3.1415926535897932384626433832795029)
#define SIMD_2_PI         btScalar(2.0) * SIMD_PI
#define SIMD_HALF_PI      (SIMD_PI * btScalar(0.5))
#define SIMD_RADS_PER_DEG (SIMD_2_PI / btScalar(360.0))
#define SIMD_DEGS_PER_RAD  (btScalar(360.0) / SIMD_2_PI)

The first one to spot it gets a virtual cookie. Big Grin

PS:
What is affected by this bug? Tire forces (cars flying off randomly and stuff) and AI steering calculations.
Reply


Messages In This Thread
Macros Are Evil - by NaN - 08-28-2015, 10:21 AM
RE: Macros Are Evil - by CrystalH - 08-28-2015, 10:31 AM
RE: Macros Are Evil - by NaN - 08-28-2015, 10:56 AM
RE: Macros Are Evil - by CrystalH - 08-28-2015, 11:41 AM
RE: Macros Are Evil - by CrystalH - 08-29-2015, 03:12 AM
RE: Macros Are Evil - by NaN - 08-29-2015, 09:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)