1ipt0n Posted May 6, 2015 Share Posted May 6, 2015 Hi,Im trying to detect collision in p2 from one side (like jumping on top of something) its easy with arcade phisics, but p2 don't have such option, i think. So is there any way to implement this? if not than I was thinking about sticking another invisible body to a side of object and detect collision with that second object instead.But I dont know how to stick other object to first one and I've experimented with RevoluteConstraint to do it but it;s not what I intended. my code:var constraint = game.physics.p2.createRevoluteConstraint(arrow, [20, 5.5 ], arrowTop, [5.5,5.5]); constraint.collideConnected=false; constraint.setStiffness(600); constraint.update();but it behave like two objects on elastic rope so sometimes arrowTop if closer to arrow and sometimes its further . even if I set more stiffness it's bouncing.Is there way to stick two bodies like on glue instead of rope ? Link to comment Share on other sites More sharing options...
icp Posted May 6, 2015 Share Posted May 6, 2015 https://schteppe.github.io/p2.js/demos/lock.html Use game.physics.p2.LockConstraint . Link to comment Share on other sites More sharing options...
1ipt0n Posted May 6, 2015 Author Share Posted May 6, 2015 This is great, thank You icp ! Link to comment Share on other sites More sharing options...
Recommended Posts