Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualInferiarum

Posted 14 August 2012 - 10:03 AM

For a simple scheme, this is how i would do it:

Lets say x is the position of the player and r the radius.

If x is completely inside a box, move it in direction of the normal of the nearest plane until the distance to the plane is r. This should not happen usually.

Else find the nearest point p on each box and move x in direction p - x if  norm(p-x) < r.

edit: see e.g. http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/  for more details on the subject.

#1Inferiarum

Posted 14 August 2012 - 09:37 AM

For a simple scheme, this is how i would do it:

Lets say x is the position of the player and r the radius.

If x is completely inside a box, move it in direction of the normal of the nearest plane until the distance to the plane is r. This should not happen usually.

Else find the nearest point p on each box and move x in direction p - x if  norm(p-x) < r.

PARTNERS