From a16f99c74c3f9aa2ccb114d29f7e22d62282e164 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 9 Jul 2001 23:14:14 +0000 Subject: [PATCH] allow scales to zero for BoundingLines --- panda/src/mathutil/boundingLine.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/mathutil/boundingLine.cxx b/panda/src/mathutil/boundingLine.cxx index de1cc0c04a..e54de2d47e 100644 --- a/panda/src/mathutil/boundingLine.cxx +++ b/panda/src/mathutil/boundingLine.cxx @@ -43,7 +43,11 @@ xform(const LMatrix4f &mat) { if (!is_empty() && !is_infinite()) { _origin = _origin * 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; + } } }