Games Water simulation on Box2D

Discussion in 'Game Development' started by Eme Fibonacci, Oct 11, 2018.

  1. Eme Fibonacci

    Eme Fibonacci Active Member Licensed User

    Does anyone have some sample source code using box2d simulating water?
    Can you share?
    Thank you.
     
  2. Star-Dust

    Star-Dust Expert Licensed User

    I had started to translate this but then other commitments prevented me from continuing the work

    Here You find the result
    Here the code is source in Java
     
    Eme Fibonacci likes this.
  3. Eme Fibonacci

    Eme Fibonacci Active Member Licensed User

    seems very complex to me.
    I had wondered if anyone did anything in 2D with b4a or b4j and box2d for simple games with water simulation
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    box2d is a physics engine for rigid bodies. It might be possible to create water simulation but it is not really designed for it.
     
  5. Star-Dust

    Star-Dust Expert Licensed User

  6. Star-Dust

    Star-Dust Expert Licensed User

  7. Eme Fibonacci

    Eme Fibonacci Active Member Licensed User

    I just trying to get results like theses.

    http://www.iforce2d.net/b2dtut/buoyancy
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    I see. You want to simulate the behavior of rigid bodies inside water. I will try to create an example based on this tutorial.
     
  9. Eme Fibonacci

    Eme Fibonacci Active Member Licensed User

    Wow! That's why I love b4x.
     
  10. Star-Dust

    Star-Dust Expert Licensed User

    Martin Fernandez likes this.
  11. Erel

    Erel Administrator Staff Member Licensed User

    [XUI2D] Floating Bodies Simulation
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice