A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by 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.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by 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.
-
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
by 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.
-
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
by 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
-
- 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 19 guests