Explosions and physics

Started by
11 comments, last by Sweenie 19 years, 6 months ago
I think I saw this posted on the Newton website, and after reading the answer I think I like the second idea better.

Essentially you use the physics engine internal data structures to do all the setup for you. You only need to apply the explosion physics with impulses to the objects collected by the sphere.

I think also that the expansion wave and occlusion can be incorporated easily be just casting rays from the extents of the object box to the explosion origin.

Oliii said
"idea 2 is to be avoided. This looks like a hack, and does not have any physical meaning."

I do not understand why this should be avoided: perhaps you can clarify what you mean by no physical meaning, your answer does not seems to have any physical meaning either, and it sound way of a lot more complex.

Roberto
Roberto
Advertisement
Well ODE for example separates the Physics Simulator from the collision detection system.

So for the collision detection system you creat a sphere that changes in size. And in your sphere collision CALLBACK FUNCTION (thats how ODE does collision response) you just set the velocity (that results from the impulse) to the objects that collided with your sphere with out actually passing the collision joints to the physics simulator.

Just my 5 cents.

P.S. You set a velocity (center of mass and rotational) for the object instead of a force. Because explosion wave that hits an object is an impulse(it creates an instantaneus "discontunuous" change in velocity for the object). Just like an object collding with a wall, the physics simulator does not add a force to change the direction of the object as it collides with a wall it adds an impulse, because the velocity changes instantenuously. Well not really, but the time displacement is so small because forces happen on atomic level that physisists came up with an idea of impulse. Sorry if i am borring you. =(

[Edited by - snisarenko on October 14, 2004 9:25:28 PM]
Quote:Oliii said
"idea 2 is to be avoided. This looks like a hack, and does not have any physical meaning."

I do not understand why this should be avoided: perhaps you can clarify what you mean by no physical meaning, your answer does not seems to have any physical meaning either, and it sound way of a lot more complex.


I don't think you are talking about the same thing Roberto.

Idea nr 2 was that the sphere would reject all bodies that was inside the sphere and it would all be handled by the collision-system.

If I understood you correctly you mean that the sphere should be used only to detect which bodies are inside it and then apply all impulses yourself.
A combination of Idea nr 1 and Idea nr 2.
And I think that is actually a good idea.

That way you won't have to cast a ray to every object in the scene, just the ones intersecting the sphere.(If you want objects to be protected by fixed objects, that is)
<-Sweenie->

This topic is closed to new replies.

Advertisement