Browse Source

allow scales to zero for BoundingLines

David Rose 24 years ago
parent
commit
a16f99c74c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      panda/src/mathutil/boundingLine.cxx

+ 5 - 1
panda/src/mathutil/boundingLine.cxx

@@ -43,7 +43,11 @@ xform(const LMatrix4f &mat) {
   if (!is_empty() && !is_infinite()) {
   if (!is_empty() && !is_infinite()) {
     _origin = _origin * mat;
     _origin = _origin * mat;
     _vector = _vector * mat;
     _vector = _vector * mat;
-    _vector.normalize();
+    if (!_vector.normalize()) {
+      // If we just scaled the line down to nothing, it becomes an
+      // empty volume.
+      _flags |= F_empty;
+    }
   }
   }
 }
 }