refactored light-resizing
authorspog <spog>
Wed, 1 Mar 2006 00:19:01 +0000 (00:19 +0000)
committerspog <spog>
Wed, 1 Mar 2006 00:19:01 +0000 (00:19 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@30 8a3a26a2-13c4-0310-b231-cf6edde360e5

libs/dragplanes.h
plugins/entity/light.cpp

index 287b0ab..a8b54dc 100644 (file)
@@ -234,6 +234,12 @@ public:
 
     return AABB(vector3_mid(min, max), vector3_scaled(vector3_subtracted(max, min), 0.5));
   }
+  AABB evaluateResize(const Vector3& translation, const Matrix4& rotation) const
+  {
+    AABB aabb(evaluateResize(translation_to_local(translation, rotation)));
+    aabb.origin = m_bounds.origin + translation_from_local(aabb.origin - m_bounds.origin, rotation);
+    return aabb;
+  }
   Matrix4 evaluateTransform(const Vector3& translation) const
   {
     AABB aabb(evaluateResize(translation));
index 901e79d..3a4c003 100644 (file)
@@ -1686,10 +1686,7 @@ public:
       //globalOutputStream() << getTranslation() << "\n";
 
       m_dragPlanes.m_bounds = m_contained.aabb();
-      AABB aabb(m_dragPlanes.evaluateResize(translation_to_local(getTranslation(), rotation())));
-      aabb.origin = m_contained.aabb().origin + translation_from_local(aabb.origin - m_contained.aabb().origin, rotation());
-
-      m_contained.setLightRadius(aabb);
+      m_contained.setLightRadius(m_dragPlanes.evaluateResize(getTranslation(), rotation()));
     }
   }
   void applyTransform()