]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
refactored light-resizing
authorspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Wed, 1 Mar 2006 00:19:01 +0000 (00:19 +0000)
committerspog <spog@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Wed, 1 Mar 2006 00:19:01 +0000 (00:19 +0000)
git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@30 8a3a26a2-13c4-0310-b231-cf6edde360e5

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

index 287b0ab5c7eea0d90e5f42ab22638400b027e980..a8b54dc19b26dc9c84a1211596cbe0960fd4e733 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 901e79de6167777503d1be3dabce277d6de166d2..3a4c003aadb3fa7603ceb084907d5ca8fed3bb7f 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()