Jump to content

"Vibrating" blocks on mobile devices


Geaz
 Share

Recommended Posts

HI and thanks for the replies!

 

The demo uses another broadphase algorithm (SAPBroadphase). If i use it, it seems to help, but my collisions are not working anymore...anyone knows why?

 

Otherwise I will try harder and look what I forgot :)

 

Thanks,

Geaz

Link to comment
Share on other sites

Phaser defaults to SAP as well, so it's not that.

 

p2 World defaults are: 

 

gravity: 0, -9.78

friction: 0.3

 

Phaser sets both of these to 0. So you may want to change back. Although I see the collision demo sets gravity to 10 (values are p2, not px)

 

More importantly though he's adjusted the solver defaults:

        world.solver.iterations = 20;        world.solver.stiffness = 1e4;        world.solver.relaxation = 4;

You can do the same via a physics configuration object in the game constructor.

Link to comment
Share on other sites

Unfortunately it did not help.

I tried it with pure p2 and pixi - no phaser at all. Here as well: as soon as I set the anchor of the sprites to 0.5 they start "vibrating".

 

So I normalized the p2 position values to fit an anchor at 0,0. Now I got no vibrations and correct physics.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...