bbox.cpp

changeset 61
109b07334fa0
parent 60
961663d05463
child 62
915fc477cb6a
--- a/bbox.cpp	Thu Mar 21 16:25:03 2013 +0200
+++ b/bbox.cpp	Thu Mar 21 18:26:57 2013 +0200
@@ -107,13 +107,15 @@
 	double fXScale = (v0.x - v1.x);
 	double fYScale = (v0.y - v1.y);
 	double fZScale = (v0.z - v1.z);
-	double* fpSize = &fZScale;
+	double fSize = fZScale;
 	
 	if (fXScale > fYScale) {
 		if (fXScale > fZScale)
-			fpSize = &fXScale;
+			fSize = fXScale;
 	} else if (fYScale > fZScale)
-		fpSize = &fYScale;
+		fSize = fYScale;
 	
-	return (*fpSize) / 2;
+	if (fSize >= 2.0f)
+		return (fSize / 2);
+	return 1.0f;
 }

mercurial