Results 1 to 2 of 2

Thread: Explosions with DMM?

  1. #1

    Explosions with DMM?

    Hi there.

    Im testing DMM with the evaluation kit and have some Questions. At the moment im trying to generate something like a FireBall. If it hits it should generate a big explosion. But i dount have an idea how to do the explosion it self. I found a tutorial that explains maya forces. But im not an artist and i dount have Maya. So i wonder if there is a way to do this just by code. Im shure there must be a way... but how? How can i generate a force field to simulate a explosions shokwave?

  2. #2

    Re: Explosions with DMM?

    Hi GRAuM,

    The way to do it is to use either Node::AddForce or Object::AddNodesForce, with the later being a single call for multiple nodes of an object. I'm attaching a force manager we use for internal testing that isn't quite as optimal as it could be, but should be a decent starting point to play with.

    The way it's invoked is to add the objects you want affected by the explosion to the manager, and then make the following call:
    Code:
    // 20 atmosphere pressure at 1 meter radius, centered at pos
    forceManager->explode(pos, 101325 * 20 * 30, 4.0f/60.0f);
    That's assuming your units are kg and meters.

    In a production environment, in order to save memory, you might very well set the OBJECT_FIXED_ONLY bit and/or the OBJECT_DISABLED_BIT on objects. You'll want to get in the habit of not calling things like AddForce on those objects if you think you might get to the point of using those types of objects.
    Attached Files Attached Files
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” - Don Knuth

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •