From 412a80b5c2b8c8704a03cb374da21eadee8af531 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 31 Mar 2013 18:22:55 +0000 Subject: cCuboid: Added the IsCompletelyInside() function git-svn-id: http://mc-server.googlecode.com/svn/trunk@1339 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Cuboid.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/Cuboid.cpp') diff --git a/source/Cuboid.cpp b/source/Cuboid.cpp index b7de25b26..ea6f7c453 100644 --- a/source/Cuboid.cpp +++ b/source/Cuboid.cpp @@ -72,6 +72,22 @@ bool cCuboid::DoesIntersect(const cCuboid & a_Other) const +bool cCuboid::IsCompletelyInside(const cCuboid & a_Outer) const +{ + return ( + (p1.x >= a_Outer.p1.x) && + (p2.x <= a_Outer.p2.x) && + (p1.y >= a_Outer.p1.y) && + (p2.y <= a_Outer.p2.y) && + (p1.z >= a_Outer.p1.z) && + (p2.z <= a_Outer.p2.z) + ); +} + + + + + void cCuboid::Move(int a_OfsX, int a_OfsY, int a_OfsZ) { p1.x += a_OfsX; -- cgit v1.2.3