User Tag List

Results 1 to 9 of 9

Thread: What is wrong with the physics? Body does not match image

  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,191
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Exclamation What is wrong with the physics? Body does not match image

    I have had this problem a number of times where the "shape" of the "body" of an objects physics does not match the image, even when I have it set to be the shape of the first image. I have uploaded an example where I have an object that is supposed to be shaped like an acorn, but the physics object is not matching the actual image but is off somehow. It looks a little bit to me like the physics body is the actual image upside down, but could be wrong about that ? Do anyone know how to fix this and what is wrong?

    (You can spawn acorns by pressing the right mouse button)
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    990
    Mentioned
    50 Post(s)
    Tagged
    0 Thread(s)
    I remember reading about this issue somewhere else. The answer was that Box 2d is not able to match concave shapes properly. If you look, the buggy collision happens exactly at the concave side, while the convex parts of the acorn work pretty well.
    Think it's a limitation with no real workaround besides making the colliding shape smaller than the displayed object and accept a slight overlap working around the "gap" issue.

  3. #3
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    168
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Read the help file it explains how it works

  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,191
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Julian82 View Post
    I remember reading about this issue somewhere else. The answer was that Box 2d is not able to match concave shapes properly. If you look, the buggy collision happens exactly at the concave side, while the convex parts of the acorn work pretty well.
    Think it's a limitation with no real workaround besides making the colliding shape smaller than the displayed object and accept a slight overlap working around the "gap" issue.
    Hmm I have tried to modify the first frame a bit but could not get anything that looked convincing, is it possible to display the actual physics bodies somehow?

    Quote Originally Posted by fnkycoldmadeanr View Post
    Read the help file it explains how it works
    Did not find anything about this in the help file?

  5. #5
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    168
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Help file keywords > Movements, Physics, Shapes and Collisions

    "Shapes and collisions

    A crucial part of a physical engine is collisions. The engine must detect when two objects collide with each-other, and take appropriate actions, like stopping the objects or pushing one onto another.
    Box2D performs collisions based on shapes. A shape being the form of an object in the world. The shape must be set during initialization, that is, in a Clickteam Fusion 2.5 application, at start of frame, or when the object is created. Box2D works with only one shape for an object : it does not accept very well that the shape of an object is changed in the middle of the game. Clickteam Fusion 2.5 therefore defines the shape of the object in the physical word as soon as the object is created.
    Most of the different movements allow you to choose between 3 different shapes for your objects:

    Box
    The shape of the object is a simple box. The dimensions of the box are the dimensions of the first image of the object. You may need to use this shape if you want an object to be perfectly balanced on each side of its center of gravity : using a shape constructed by Clickteam Fusion 2.5 may not produce a completely symetrical shape.
    Circle
    The shape of the object is a circle. The radius of the circle is calculated from the width and height of the first image (by using the average between the two values). Circle shape will allow your object to roll perfectly on the ground.
    Shape of first image
    With this option, Clickteam Fusion 2.5 analyses the shape of the first image of the object, and converts it into a shape that can be understood by Box2D. To avoid slowing down the engine, the number of points defining this shape is limited to 8, so the shape created is a rough estimation of the shape of the object."



    More info in the help file..

  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,191
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fnkycoldmadeanr View Post
    Help file keywords > Movements, Physics, Shapes and Collisions

    "Shapes and collisions

    A crucial part of a physical engine is collisions. The engine must detect when two objects collide with each-other, and take appropriate actions, like stopping the objects or pushing one onto another.
    Box2D performs collisions based on shapes. A shape being the form of an object in the world. The shape must be set during initialization, that is, in a Clickteam Fusion 2.5 application, at start of frame, or when the object is created. Box2D works with only one shape for an object : it does not accept very well that the shape of an object is changed in the middle of the game. Clickteam Fusion 2.5 therefore defines the shape of the object in the physical word as soon as the object is created.
    Most of the different movements allow you to choose between 3 different shapes for your objects:

    Box
    The shape of the object is a simple box. The dimensions of the box are the dimensions of the first image of the object. You may need to use this shape if you want an object to be perfectly balanced on each side of its center of gravity : using a shape constructed by Clickteam Fusion 2.5 may not produce a completely symetrical shape.
    Circle
    The shape of the object is a circle. The radius of the circle is calculated from the width and height of the first image (by using the average between the two values). Circle shape will allow your object to roll perfectly on the ground.
    Shape of first image
    With this option, Clickteam Fusion 2.5 analyses the shape of the first image of the object, and converts it into a shape that can be understood by Box2D. To avoid slowing down the engine, the number of points defining this shape is limited to 8, so the shape created is a rough estimation of the shape of the object."



    More info in the help file..

    Ok I found that part, it did not really describe the problem though or how to overcome it, apart from that the shape is made of 8 points so it is not exact.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    990
    Mentioned
    50 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Outcast View Post
    Hmm I have tried to modify the first frame a bit but could not get anything that looked convincing, is it possible to display the actual physics bodies somehow?
    Nope :/ I’ve also not found a way to handle concave shapes myself.

  8. #8
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleSWF Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    fnkycoldmadeanr's Avatar
    Join Date
    Jul 2017
    Location
    Melbourne, Australia
    Posts
    168
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Help file > Physics - Things to know

    "Moving objects seem to collide far from background objects
    This problem might occur if your object has a concave shape. Box2D does not accept concave shapes. You should cut your object into several, convex objects."

  9. #9
    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,191
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I think I got the best result by just moving the hotspot a bit up on the object. It is not perfect, but it looks alright now I think. It would be hugely helpful if it was actually possible to draw the actual physics bodies on top of the object somehow to show how the actual physics bodies are vs the graphics objects and even be able to toggle between them. It is a bit now like trying to adjust something blind
    Attached files Attached files

Similar Threads

  1. Replies: 0
    Last Post: 16th March 2019, 07:55 PM
  2. Something wrong with Physics. Please HELP
    By kimel28 in forum Android Export Module 2.5
    Replies: 3
    Last Post: 21st March 2017, 04:47 PM
  3. Physics - Background object has wrong hitbox
    By H4x1 in forum Fusion 2.5
    Replies: 3
    Last Post: 15th October 2016, 04:49 PM
  4. Physics bouncing ball with wrong bounce...(BUG?)
    By paobrasil in forum Fusion 2.5
    Replies: 3
    Last Post: 7th March 2014, 01:59 AM
  5. Physics question! Making AI that uses Physics Platformer/Physics Static movement
    By Krim in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th December 2013, 03:19 AM

Posting Permissions

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