java - libgdx - How to disable collisions -


so i'm attempting make one-way wall, means actor can pass throw object 1 side (for example bottom side or upper one). began reading tutorial: one-way-walls when try, after checking direction of actor, disable collision doesn't work. think issue on part

since using begincontact event occurs 1 time per collision, can use setenabled once alter behavior of contact. problem contact revert being enabled again after each step. make note of contacts have disabled , check list of them every time in presolve, kinda inefficient , more work can bothered today. or day :) we'll quietly sneak b2contact.cpp , comment out line @ beginning of update function re-enables contact. after you're done should this: // re-enable contact. //m_flags |= e_enabledflag;

the problem i'm using java version of libgdx in androidstudio , have no idea how find , change piece of code. need way change it, or different solution avoid collision state "re-enabling" @ every cycle.

you solve in presolve , store status (if contact should enabled or not) in fixtures userdata. of course should revert flag in endcontact.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -