Box2D setAngle() Keep crashing

BlitzMax Forums/Brucey's Modules/Box2D setAngle() Keep crashing

Armitage 1982(Posted 2009) [#1]
Well
I did a complete revamp of my level editor lately.
I now create respective shape and shapeDef with correct class (b2PolygonShape, b2CircleShape or b2EdgeShape).
But no matter how I try (setXForm() after redefining, setAngle() or even setAsOrientedBox() in radian).

Setting angle parameters of any SetAsBox PolygonShape randomly crash !
Mostly I have to change 3 times the angle before a crash, sometimes it crash the first time, sometimes it work 6 times in a row then crash.

Don't know well if this related with the BlitzMax module or not (see my lonely topic on Box2d forum http://www.box2d.org/forum/viewtopic.php?f=3&t=2077&start=0).

I always had this problem with the Box2d Module and since I can't find any answers after months...

The crash is very strange too since I get no runtime error, my game simply freeze this let me think it's maybe not my fault.

One more thing : The crash seem to only appear with perfect square SetAsBox Shape.
A clone of my "crashing cube" type but with rectangular values don't crash when changing angle at "redefining".

Thanks

EDIT: If I add even 0.01 in width or height as size for the SetAsBox() this fix the bug. It's ugly but nearly the same as a true square shape.


Brucey(Posted 2009) [#2]
Freezing implies an infinite loop somewhere.

I don't suppose you have any smaller examples, other than your game itself?


Armitage 1982(Posted 2009) [#3]
héhé :)

Hum, they obviously asking the same thing at Box2d forum.
Well, if I found a way to reproduce this at smaller scale I will post something...
But I get this since the very beginning of my game development and I revamp my code often without track down this weird behaviour.