Advertisement
Codeblocks

Untitled

Aug 2nd, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. virtual void IsBoxInsideMe(Entity* ent) {
  2.     //For example sake we'll pretend this member function's class has 'entity' as a reference to it's LE entity.
  3.     AABB* aabb = entity->GetAABB(Entity::GlobalAABB);
  4.     Vec3 pos = ent->GetPoisition(true);
  5.     if (pos.x < aabb->min.x) { return false; }
  6.     if (pos.y < aabb->min.y) { return false; }
  7.     if (pos.z < aabb->min.z) { return false; }
  8.     if (pos.x > aabb->max.x) { return false; }
  9.     if (pos.y > aabb->max.y) { return false; }
  10.     if (pos.z > aabb->max.z) { return false; }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement