Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. If newPos.x<collisions.left Then
  2.     depth=collisions.left-newPos.x
  3.     newPos.x+=collisions.leftNormal.x*depth
  4.     newPos.z+=collisions.leftNormal.z*depth
  5. Endif
  6.  
  7. If newPos.x>collisions.right Then
  8.     depth=collisions.right-newPos.x
  9.     newPos.x-=collisions.rightNormal.x*depth
  10.     newPos.z-=collisions.rightNormal.z*depth
  11. Endif
  12.  
  13. If newPos.z<collisions.backward Then
  14.     depth=collisions.backward-newPos.z
  15.     newPos.x+=collisions.backwardNormal.x*depth
  16.     newPos.z+=collisions.backwardNormal.z*depth
  17. Endif
  18.  
  19. If newPos.z>collisions.forward Then
  20.     depth=collisions.forward-newPos.z
  21.     newPos.x-=collisions.forwardNormal.x*depth
  22.     newPos.z-=collisions.forwardNormal.z*depth
  23. Endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement