Advertisement

how to decide a box rotation when simulate an explosion

Started by August 31, 2020 02:10 AM
5 comments, last by _WeirdCat_ 4 years, 5 months ago

I'm now trying to simulate an explosion based on physx.

The idea is simple, I use a sphere trigger shape as a forcefield to find out the entites in the scope of explosion.

Then I add an impulse point from center of sphere to the mass center of the entity. The entities will act as blow up by the explosion. However they will not rotate, which looks wierd.

I searched a lot from google but didn't find anything about how to calculate the rotation about this. Can anyone give some suggestions on how to make the explosion looks more real. Thanks in advance.

I would try with a random rotational impulse. Play with it until it looks right.

Advertisement

For each object find first contact point (extend sphere find contact point) apply force to this contact point…

@alvaro Thanks for your reply, I thought about a random impulse as well because the explosion is complex and hard to simulate. Do you have any idea about some simple model that can calculate the random impulse.

@_WeirdCat_ Thanks for your reply. This looks like a real explosion if we reward the explosion as an ideal sphere expansion. however if we find the contact point, I think it's still hard to decide the direction of this impulse.

Well if you want to keep it simple its.center to the contact point, if you want more complex method youll have to compute pressure on the area of that point to see if the mass(and shape too) of the object directs pressure elsewhere. However you apply, a pressure over an area - sum forces, explosion act over time on the body meaning that you have found first contact point you add force but then over time you have another set of contact points - anyway you cant decide the direction of impulse because of? not implementing drag? Not assumming that force (pressure) will act on multiple areas with multiple values on the body making it rotate less?

This topic is closed to new replies.

Advertisement