Sign in to follow this  
emmes

Arcade Physics Bounce not correct for circular objects

Recommended Posts

I'm trying to create some billiard-like game, and want to be using arcade physics due to the number of objects.

When using the (newer) circular objects, bounce does not seem to work like it's intended - at least if one object is very massy or immovable.

Please try https://samme.github.io/phaser-examples-mirror/arcade%20physics/bounce%20knock.html and add a 

   knocker.body.setCircle (16);
   ball.body.setCircle(16);

after both bodys are created - a debugger in render() helps also:

    game.debug.body(knocker);
    game.debug.body(ball);

You will notice a significant difference in behaviour, when the ball hits the knocker straight on. It should be reflected (bounce is 1), but instead momentum is almost completely killed, it just drifts a bit sideways if movement was not straight on.

I can imagine the bounce routines are still rectangular based only, so they work so-so for circular/rectangular hits, but not for circular/circular... but then for rectangular hitboxes it works as intended...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.