bbox.cpp

changeset 61
109b07334fa0
parent 60
961663d05463
child 62
915fc477cb6a
equal deleted inserted replaced
60:961663d05463 61:109b07334fa0
105 // ============================================================================= 105 // =============================================================================
106 double bbox::calcSize () { 106 double bbox::calcSize () {
107 double fXScale = (v0.x - v1.x); 107 double fXScale = (v0.x - v1.x);
108 double fYScale = (v0.y - v1.y); 108 double fYScale = (v0.y - v1.y);
109 double fZScale = (v0.z - v1.z); 109 double fZScale = (v0.z - v1.z);
110 double* fpSize = &fZScale; 110 double fSize = fZScale;
111 111
112 if (fXScale > fYScale) { 112 if (fXScale > fYScale) {
113 if (fXScale > fZScale) 113 if (fXScale > fZScale)
114 fpSize = &fXScale; 114 fSize = fXScale;
115 } else if (fYScale > fZScale) 115 } else if (fYScale > fZScale)
116 fpSize = &fYScale; 116 fSize = fYScale;
117 117
118 return (*fpSize) / 2; 118 if (fSize >= 2.0f)
119 return (fSize / 2);
120 return 1.0f;
119 } 121 }

mercurial