Fancy car Wheels

Hi guys, I created a test project to see fancy car, but the wheels are not lined up problem, any reason behind this?, its only the left side.



pic,



http://i.imgur.com/ysLxl.jpg

Hi,



I just updated my jMonkeyPlatform IDE to last svn version and I’m having the same issue. In the testFancyCar, left car wheels are displaced from where they should be located to the center of the car…



Any ideas?

Nope, no idea, must be either the model or the geometry.center() command. the simple vehicle test works.

but both (code [testFancyCar class from tests] and the model itself) remain the same as before… About Spatial.center() method, I’ve been looking at the google code page and it has not been changed for the last 6 months or more.

@joliver82 said:
but both (code [testFancyCar class from tests] and the model itself) remain the same as before... About Spatial.center() method, I've been looking at the google code page and it has not been changed for the last 6 months or more.

Well so you got something to investigate, I didn't find the reason last time I looked into it. Stable doesn't have this issue btw.
@normen said:
Well so you got something to investigate, I didn't find the reason last time I looked into it. Stable doesn't have this issue btw.


I'll look into it and post my findings (if any) ;)

Finally I found it! The bug is caused by the modification of BoundingBox class (method containAABB) at revision 9548 (http://code.google.com/p/jmonkeyengine/source/diff?spec=svn9701&r=9548&format=side&path=/trunk/engine/src/core/com/jme3/bounding/BoundingBox.java&old_path=/trunk/engine/src/core/com/jme3/bounding/BoundingBox.java&old=9282) 8)



– EDIT –



@normen, to fix this bug, Float.NEGATIVE_INFINITY should be assigned to maxX,maxY and maxZ instead of Float.MIN_VALUE because, acording to the Float javadoc: “MIN_VALUE: A constant holding the smallest positive nonzero value of type float, 2-149. It is equal to the hexadecimal floating-point literal 0x0.000002P-126f and also equal to Float.intBitsToFloat(0x1).”



[patch]

228c228

< float maxX = Float.MIN_VALUE, maxY = Float.MIN_VALUE, maxZ = Float.MIN_VALUE;



> float maxX = Float.NEGATIVE_INFINITY, maxY = Float.NEGATIVE_INFINITY, maxZ = Float.NEGATIVE_INFINITY;

[/patch]

2 Likes

Cool, thanks!

Thanks, it was committed

Great! I’m happy to help :wink: