chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.75k stars 455 forks source link

Bug: fixing collisionreport data #240

Open leberknecht opened 8 years ago

leberknecht commented 8 years ago

getBody0() returns an object, therefore _objects_ammo[ manifold.getBody0() ]; results in undefined, and as reportdata is Float32Array, we end up with NaNin report data. Using ammo-js v0.0.2 and chrome v43.0.2357.134

seanjohnite commented 8 years ago

God. I was just struggling with this for way too long. I think this happens with an updated version of Ammo.js. Replacing with the ammo.js found in the examples folder also fixed this issue.

ribeirobreno commented 8 years ago

248

acerix commented 8 years ago

I also spent a while tracking this issue down... What is holding back this patch?

To avoid breaking examples using an older ammo.js, would it be better to make it backwards compatible? eg. id = typeof body==='object' ? body.ptr : body

This also fixes issue https://github.com/chandlerprall/Physijs/issues/220.