Guest User

Untitled

a guest
Sep 27th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. glm::vec3 AABBCollider::get_farthest_point(const glm::vec3& dir)
  2.     {
  3.         F32 x, y, z;
  4.         x = dir.x >= 0 ? size.x : -size.x;
  5.         y = dir.y >= 0 ? size.y : -size.y;
  6.         z = dir.z >= 0 ? size.z : -size.z;
  7.  
  8.         return center + glm::vec3(x, y, z);
  9.  
  10.     }
  11.  
  12.  
  13.     glm::vec3 SphereCollider::get_farthest_point(const glm::vec3& dir)
  14.     {
  15.         return center + normalize(dir) *radius;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment