Hi
Before I add a body to the world I would like to check if that action would result in collisions. Is there a sensible way to do that? (this is in regards to placing towers in a tower defense game, I would like to check if the new tower would overlap with any existing towers)
Kind regards
Test collision before adding new Body
Re: Test collision before adding new Body
You can use the family of 'detect' methotds on the world.
http://docs.dyn4j.org/v3.2.4/org/dyn4j/ ... util.List-
http://docs.dyn4j.org/v3.2.4/org/dyn4j/ ... util.List-
Re: Test collision before adding new Body
Thank you. Exactly what I was looking for :
Code: Select all
public boolean detect(Convex convex,
java.util.List<DetectResult> results)
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 1 guest