Hi,
I am testing Gideros box2d APIs.
So I have many objects that collide with each other and I can have callbacks to detect each collision (begin, end, post, pre).
But in case I want some of the bodies to break or get destroyed I need to know the force *absorbed* by the body because of the collision.
The events only give me the fixtures that are in collision. Of course from that I can get the bodies and their velocity and mass before and after the collision.
There are tons of factors that apply (mass, velocity, friction, bounce, angles, etc.) ...
Is there a relatively easy way to get the absorbed force using Gideros APIs since not all of Box2d API as exposed?
In the Box2d manual I see how I can do it and make it real enough, but the APIs and data structures and not exposed in Gideros.
What I can do in Gideros is get the pre and post velocities, convert them in forces and do some diffs using some complex formulas...
Is there an easy way? Someone has done it and can help with suggestions/formulas/code?
Comments
As I understood that is the sum of all normal impulses achieved during collision, so you can multiply it by some constant or round it, to make damage points more "prettier" and that's all.
Very helpful.
I could not find this in the documentation.
Do you have a link where this is described?
Are there other event values available for this event? All I can see in the docs is fixtureA and fixtureB...
Cheers
Vlad
Of course, better await for confirmation from @atilim
Sorry for the late reply. Yes it was missing and I've added this to the documentation a minute ago.
This feature was exactly what I was looking for!!