small help - body collision energy / damage

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

small help - body collision energy / damage

Postby JernejL » Wed Aug 01, 2018 6:59 am

I need some help regarding applying damage from collisions during material callback, when my cars collide - i process all the contacts to create special effects.

But after that is done, i'd like to calculate sort of damage to apply to both vehicles from their mass and velocity - and somehow divide that energy based on relative velocity into how much damage each car takes - basically, somehow divide collision energy based on velocity and mass of bodies.

I'm not totally sure if i even use proper terminology for this, but basically, when 2 cars going parallel touch at high speed, the relative collision energy is low, but if one object is slower and another crashes into it, the other body receives relaticely more energy than the first one.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: small help - body collision energy / damage

Postby JoeJ » Wed Aug 01, 2018 7:41 am

JernejL wrote:but if one object is slower and another crashes into it, the other body receives relaticely more energy than the first one.


I don't think so, it's only contactNormal.Dot(relativeVelocity) * massSum that matters?
Of course some car is more safe than another, and some regions of the chassis are more robust etc.

But if one guy holds an egg at rest, and the other smashes his egg against it, there's a 50/50 chance which egg breaks.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: small help - body collision energy / damage

Postby JernejL » Mon Aug 06, 2018 2:13 am

You mean NewtonMaterialGetContactNormalSpeed() ?

http://newtondynamics.com/wiki/index.ph ... ormalSpeed

"Calculate the speed of this contact along the normal vector of the contact."

I'm not sure what this actually means, but i've found one case on github, where this is directly used to calculate damage:

https://github.com/Alexei-Kornienko/Rac ... ar.cpp#L29

So i guess this is what i was looking for? this is the kinetic energy of the collision?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: small help - body collision energy / damage

Postby JoeJ » Tue Aug 07, 2018 3:50 pm

JernejL wrote:You mean NewtonMaterialGetContactNormalSpeed() ?


Probably yes. But i'm confused wiki says the returned value is always positive. This would only be the case if the bodies are ordered accordingly, which i think is unlikely.

You could implement yourself if results are not as expected.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: small help - body collision energy / damage

Postby Julio Jerez » Tue Aug 07, 2018 4:17 pm

For a contact joints the value is positive, because the the negative friction force for contacts is zero.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 17 guests