Jump to content

p2 body seems to be touchingDown but up in the air next to a wall


valueerror
 Share

Recommended Posts

the problem can be seen here (as always ;-) ) http://test.xapient.net/phaser/ALL/

 

i apply a frictionless material so it doesn't stick to the wall... 

 

this works most of the time..

but if you push the button to move into the direction of the wall in the air again.. it will eventually stick to the wall ..  (it does that even if i set every contactmaterial to friction=0 )

i think it shouldn't because there is no friction at all..

 

 

 

this is maybe related to another post right here: http://www.html5gamedevs.com/topic/4807-physics-bodies-stick-when-colliding-from-the-side/

 

i am trying to get something like the arcade "touchingDown" with this function (thx to rich's lab experiment)

 

function touchingDown(player){    var yAxis = p2.vec2.fromValues(0,1);    var result = false;    for(var i=0; i<game.physics.p2.world.narrowphase.contactEquations.length; i++){    var c = game.physics.p2.world.narrowphase.contactEquations[i];        if(c.bi === player.body.data || c.bj === player.body.data){            var d = p2.vec2.dot(c.ni,yAxis); // Normal dot Y-axis            if(c.bi === player.body.data) d *= -1;            if(d > 0.4) result = true;        }    }    return result;}

and it showed me that (if you change (d>0.4) to (d>0) )  touchingDown is always true when the player sticks .. i honestly think that this is something to be solved at the "phaser side"   - at least i did't find a 'cure' yet

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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