Game Development Reference
In-Depth Information
happens when an explosion is generated between the boxes (epicenter and direction
of travel added for artistic flair):
Note that to simulate the explosion a little more realistically, the strength of the ex-
plosion follows an inverse law, since we wouldn't expect an object further from the
center to experience the same impulse as those that are near.
if (dist != 0.0) strength /= dist;
Also note that an additional parameter was added to the Raycast() function to al-
low us to decide whether we want it to return collisions with static objects or not (like
the ground plane). These were ignored originally because we didn't want our Des-
troyGameObject() function to destroy the ground plane. But, now we need this
Search WWH ::




Custom Search