Detect stuck dynamic body

General discussion about Box2D tutorials
Post Reply
kyle.bong2@gmail.com
Posts: 41
Joined: Thu May 29, 2014 5:01 am

Detect stuck dynamic body

Post by kyle.bong2@gmail.com » Wed May 11, 2016 7:55 pm

Hi all, Anyone know best way to detect when dynamic bodies are stuck inside/between static bodies?? Please see screenshot. Any hints greatly appreciated.

Thanks!
Attachments
Untitled.png
Untitled.png (20.03 KiB) Viewed 12641 times

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Detect stuck dynamic body

Post by iforce2d » Thu May 12, 2016 9:59 am

This is very difficult, to the point where I probably would not bother. Better to spend your effort preventing this situation from occurring in the first place, for three reasons:
1. it's easier
2. it should improve player experience to not have things getting stuck to begin with
3. it avoids the question about where to move the stuck body once it is detected

Post Reply