Aloush154 / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

Macro "SIMD_2_PI" missing parentheses. #777

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.SIMD_2_PI is defined like this "#define SIMD_2_PI         btScalar(2.0) * 
SIMD_PI"
2.But SIMD_RADS_PER_DEG is defined like this "#define SIMD_RADS_PER_DEG 
(SIMD_2_PI / btScalar(360.0))"
3.When you use SIMD_RADS_PER_DEG, you will get wrong result.

What is the expected output? What do you see instead?
After macro expansion, the correct result should be "((btScalar(2.0) * SIMD_PI) 
/ btScalar(360.0))".
But now it is "(btScalar(2.0) * SIMD_PI / btScalar(360.0))"

SIMD_2_PI should be defined like this "#define SIMD_2_PI         (btScalar(2.0) 
* SIMD_PI)".
Missing parentheses.

What version of the product are you using? On what operating system?
bullet version:bullet-2.82-r2704
os: win7 64bit vs2012

Please provide any additional information below.
SIMD_DEGS_PER_RAD has the same problem.

Original issue reported on code.google.com by echo...@gmail.com on 4 Dec 2013 at 2:33

GoogleCodeExporter commented 8 years ago
Also, shouldn't SIMD_RADS_PER_DEG be defined as 

#define SIMD_RADS_PER_DEG (SIMD_PI / btScalar(180.0))

for better performance?

Original comment by brf_co...@yahoo.com.br on 4 Dec 2013 at 1:18

GoogleCodeExporter commented 8 years ago
It was already fixed in svn, see
https://code.google.com/p/bullet/source/detail?r=2717

There shouldn't be any performance difference, those constants are pre-computed 
at compile time.

Original comment by erwin.coumans on 4 Dec 2013 at 4:36