Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If newPos.x<collisions.left Then
- depth=collisions.left-newPos.x
- newPos.x+=collisions.leftNormal.x*depth
- newPos.z+=collisions.leftNormal.z*depth
- Endif
- If newPos.x>collisions.right Then
- depth=collisions.right-newPos.x
- newPos.x-=collisions.rightNormal.x*depth
- newPos.z-=collisions.rightNormal.z*depth
- Endif
- If newPos.z<collisions.backward Then
- depth=collisions.backward-newPos.z
- newPos.x+=collisions.backwardNormal.x*depth
- newPos.z+=collisions.backwardNormal.z*depth
- Endif
- If newPos.z>collisions.forward Then
- depth=collisions.forward-newPos.z
- newPos.x-=collisions.forwardNormal.x*depth
- newPos.z-=collisions.forwardNormal.z*depth
- Endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement