openfl / box2d

Haxe port of Box2D, a popular rigid-body 2D physics engine
Other
95 stars 28 forks source link

Needed fix for benchmark #13

Open DanielUranga opened 8 years ago

DanielUranga commented 8 years ago

I've ported a benchmark that compares this version of Box2d to a native "linc" c++ one: https://github.com/DanielUranga/haxe_box2d_benchmarks I think this can be highly interesting to measure hxcpp performance vs native.

The problem is that the Haxe version crash due to this: https://github.com/openfl/box2d/blob/master/box2D/dynamics/B2Body.hx#L77

Any chance we could fix it?

jgranick commented 8 years ago

Can we compare to Box2DFlash and see if this is in the original code or not? Are you sure that's the cause of the crash?

DanielUranga commented 8 years ago

This is the stacktrace:

Called from ? line 1
Called from MainBox2dHaxe.hx line 26
Called from box2D/dynamics/B2Body.hx line 169
Called from box2D/dynamics/B2Body.hx line 132
Called from box2D/dynamics/B2Fixture.hx line 320
Uncaught exception - Invalid field access : computeAABB

It calls m_shape.computeAABB(m_aabb, xf); on B2Fixture line 320, but m_shape is null.