From: spog Date: Wed, 1 Mar 2006 00:19:01 +0000 (+0000) Subject: refactored light-resizing X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f3f461f38a2ef63ff9637247c87509e4a2e4d104;p=xonotic%2Fnetradiant.git refactored light-resizing git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@30 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- diff --git a/libs/dragplanes.h b/libs/dragplanes.h index 287b0ab5..a8b54dc1 100644 --- a/libs/dragplanes.h +++ b/libs/dragplanes.h @@ -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)); diff --git a/plugins/entity/light.cpp b/plugins/entity/light.cpp index 901e79de..3a4c003a 100644 --- a/plugins/entity/light.cpp +++ b/plugins/entity/light.cpp @@ -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()