Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- virtual void IsBoxInsideMe(Entity* ent) {
- //For example sake we'll pretend this member function's class has 'entity' as a reference to it's LE entity.
- AABB* aabb = entity->GetAABB(Entity::GlobalAABB);
- Vec3 pos = ent->GetPoisition(true);
- if (pos.x < aabb->min.x) { return false; }
- if (pos.y < aabb->min.y) { return false; }
- if (pos.z < aabb->min.z) { return false; }
- if (pos.x > aabb->max.x) { return false; }
- if (pos.y > aabb->max.y) { return false; }
- if (pos.z > aabb->max.z) { return false; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement