User Tag List

Results 1 to 8 of 8

Thread: Box2D Shape test

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Box2D Shape test

    Do anyone know how to make a box2d object immune to a shape test? I want to check for shapes in an area and destroy all shapes in that area, but some objects should not be destroyed. I have created an example where i create an object that makes a shape test. I tried to make it immune to this by using a flag, but I guess the flag I use is checking the actual flag of the box2d extension and not the object?

    How can I do this so the object is not destroyed by the shape test?
    Attached files Attached files

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    bump.

  3. #3
    No Products Registered

    Join Date
    Apr 2013
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That file require FlashFx.mfx so I assume it need flash exporter. Can you make example for PC runtime?

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BigHatLogan View Post
    That file require FlashFx.mfx so I assume it need flash exporter. Can you make example for PC runtime?
    Oh crap, thanks for pointing that out! I have made an updated example here for regular runtime. I also added some red boxes. You press the left button to spawn a "bomb" (the blue object). It will detonate and destroy all boxes in an area. What I want is that the blue box should not be destroyed however. I want to make that object "immune" to the shape test.
    Attached files Attached files

  5. #5
    No Products Registered

    Join Date
    Apr 2013
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, testing for flag this way is not going to work. But you can change collision type of the "bomb" and test for that in shape test event. Also if you want it to be a bit more precise than the shape test ( that is box shape) you can create actual new circular body as a sensor and test for collision with that. I upload both examples, so I hope one of them to be helpful.
    Attached files Attached files

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Wow thanks that is awesome!

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I actually seem to have stumbled on a bug with the flash version of box2d. I added an event to destroy the bomb when it detonates, but that does not work if you build it for flash.
    Attached files Attached files

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Ok I found a workaround by destroying the bomb by activating a group that works in Flash. But now I found another bug in the flash version :P If you use qualifiers instead for checking for shapes (which I do in the real app because there are different physics objects that should be destroyed) it does not work in the flash version.
    Attached files Attached files

Similar Threads

  1. Box2D or Chipmunk physics, how do I shrink or grow a shape?
    By RedHades in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 1st February 2012, 03:36 AM
  2. BOX2D - Shape Test / BodyID to an array then loop
    By Tuna in forum Hardware Accelerated Runtime
    Replies: 9
    Last Post: 12th April 2010, 10:26 PM
  3. Box2D - When item explodes, affect body/shape near
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th March 2010, 01:18 AM
  4. Box2D rotating bat test problem
    By Bruto in forum File Archive
    Replies: 2
    Last Post: 7th December 2009, 07:02 PM
  5. Phizix - Box2D Ragdoll Test
    By Werbad in forum File Archive
    Replies: 45
    Last Post: 2nd August 2009, 12:35 PM

Posting Permissions

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