Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Oct 27, 2011 3:01 am 
Offline
User avatar

Joined: Wed Nov 11, 2009 9:09 pm
Posts: 28
Curious:

I want objects to be "blown away" due to a nearby explosion. Is there something like this included? Sort of a reverse gravity?


Or should I do apply linear force and apply angular force to objects within the blast radius to simulate this myself?



thanks


Top
 Profile  
 
PostPosted: Thu Oct 27, 2011 4:24 am 
Offline
User avatar

Joined: Tue Jun 29, 2010 10:27 pm
Posts: 237
You would need to do this yourself. One common way would be to create a ghost sphere representing the blast, and iterate over all objects inside it an apply forces correspondingly, perhaps based on the distance from the centre of the sphere (the blast origin). This is a "simple" approach. To get fancier, you could perhaps do something like casting a ray from the blast origin to one or more points (such as the centre or bounding box corners) on each object in the blast radius to determine if that object is "visible" to the blast, and not shielded behind something else (in which case you might not want to apply any forces). You could also use the distance of the raycast hits from the blast origin - and their local position on the object - to apply varying forces across an object (which would result in linear+angular velocity).


Top
 Profile  
 
PostPosted: Thu Oct 27, 2011 1:09 pm 
Offline
User avatar

Joined: Wed Nov 11, 2009 9:09 pm
Posts: 28
thanks! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group