aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/boundingbox.cpp
diff options
context:
space:
mode:
authorPeter Kohaut2015-09-15 20:26:46 +0200
committerEugene Sandulenko2016-09-29 22:33:40 +0200
commit479d2f5b6293af2ae84fbdc718348a6e1126efb0 (patch)
treedfd6fd1a84b379aad003e005c0f47c8e211669b0 /engines/bladerunner/boundingbox.cpp
parent6672e443a870963354ee43298c75164d382a5636 (diff)
downloadscummvm-rg350-479d2f5b6293af2ae84fbdc718348a6e1126efb0.tar.gz
scummvm-rg350-479d2f5b6293af2ae84fbdc718348a6e1126efb0.tar.bz2
scummvm-rg350-479d2f5b6293af2ae84fbdc718348a6e1126efb0.zip
BLADERUNNER: still adding structures... and implementing some of script methods...
Diffstat (limited to 'engines/bladerunner/boundingbox.cpp')
-rw-r--r--engines/bladerunner/boundingbox.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/engines/bladerunner/boundingbox.cpp b/engines/bladerunner/boundingbox.cpp
index fb2ae94813..9b36eabe29 100644
--- a/engines/bladerunner/boundingbox.cpp
+++ b/engines/bladerunner/boundingbox.cpp
@@ -34,8 +34,7 @@ BoundingBox::BoundingBox(float x0, float y0, float z0, float x1, float y1, float
_vertices[1].z = z1;
}
-void BoundingBox::expand(float x0, float y0, float z0, float x1, float y1, float z1)
-{
+void BoundingBox::expand(float x0, float y0, float z0, float x1, float y1, float z1) {
_vertices[0].x += x0;
_vertices[0].y += y0;
_vertices[0].z += z0;
@@ -46,11 +45,40 @@ void BoundingBox::expand(float x0, float y0, float z0, float x1, float y1, float
}
-bool BoundingBox::isXYZInside(float x, float y, float z)
-{
+bool BoundingBox::inside(float x, float y, float z) {
return
x >= _vertices[0].x && x <= _vertices[1].x
&& y >= _vertices[0].y && y <= _vertices[1].y
&& z >= _vertices[0].z && z <= _vertices[1].z;
}
+
+
+void BoundingBox::setXyz(float x0, float y0, float z0, float x1, float y1, float z1) {
+ _vertices[0].x = x0;
+ _vertices[0].y = y0;
+ _vertices[0].z = z0;
+
+ _vertices[1].x = x1;
+ _vertices[1].y = y1;
+ _vertices[1].z = z1;
+}
+
+void BoundingBox::getXyz(float *x0, float *y0, float *z0, float *x1, float *y1, float *z1) {
+ *x0 = _vertices[0].x;
+ *y0 = _vertices[0].y;
+ *z0 = _vertices[0].z;
+
+ *x1 = _vertices[1].x;
+ *y1 = _vertices[1].y;
+ *z1 = _vertices[1].z;
+}
+
+
+float BoundingBox::getZ0() {
+ return _vertices[0].z;
+}
+
+float BoundingBox::getZ1() {
+ return _vertices[1].z;
+}
} // End of namespace BladeRunner