Revision: 8698
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8698&view=rev
Author:   hsujohnhsu
Date:     2010-05-20 02:02:03 +0000 (Thu, 20 May 2010)

Log Message:
-----------
check to make sure it's LT_SPOTLIGHT before calling setSpotLightRange, throws 
in 1.7

Modified Paths:
--------------
    code/gazebo/trunk/server/rendering/Light.cc

Modified: code/gazebo/trunk/server/rendering/Light.cc
===================================================================
--- code/gazebo/trunk/server/rendering/Light.cc 2010-05-20 01:07:08 UTC (rev 
8697)
+++ code/gazebo/trunk/server/rendering/Light.cc 2010-05-20 02:02:03 UTC (rev 
8698)
@@ -377,10 +377,11 @@
   if (**this->spotInnerAngleP != angle)
     this->spotInnerAngleP->SetValue( angle );
 
-  this->light->setSpotlightRange(
-      Ogre::Radian(Ogre::Degree(**this->spotInnerAngleP)), 
-      Ogre::Radian(Ogre::Degree(**this->spotOutterAngleP)), 
-      **this->spotFalloffP);
+  if (this->light->getType() == Ogre::Light::LT_SPOTLIGHT)
+    this->light->setSpotlightRange(
+        Ogre::Radian(Ogre::Degree(**this->spotInnerAngleP)), 
+        Ogre::Radian(Ogre::Degree(**this->spotOutterAngleP)), 
+        **this->spotFalloffP);
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -390,10 +391,11 @@
   if (**this->spotOutterAngleP != angle)
     this->spotOutterAngleP->SetValue( angle );
 
-  this->light->setSpotlightRange(
-      Ogre::Radian(Ogre::Degree(**this->spotInnerAngleP)), 
-      Ogre::Radian(Ogre::Degree(**this->spotOutterAngleP)), 
-      **this->spotFalloffP);
+  if (this->light->getType() == Ogre::Light::LT_SPOTLIGHT)
+    this->light->setSpotlightRange(
+        Ogre::Radian(Ogre::Degree(**this->spotInnerAngleP)), 
+        Ogre::Radian(Ogre::Degree(**this->spotOutterAngleP)), 
+        **this->spotFalloffP);
 
 }
 
@@ -404,9 +406,10 @@
   if (**this->spotFalloffP != angle)
     this->spotFalloffP->SetValue( angle );
 
-  this->light->setSpotlightRange(
-      Ogre::Radian(Ogre::Degree(**this->spotInnerAngleP)), 
-      Ogre::Radian(Ogre::Degree(**this->spotOutterAngleP)), 
-      **this->spotFalloffP);
+  if (this->light->getType() == Ogre::Light::LT_SPOTLIGHT)
+    this->light->setSpotlightRange(
+        Ogre::Radian(Ogre::Degree(**this->spotInnerAngleP)), 
+        Ogre::Radian(Ogre::Degree(**this->spotOutterAngleP)), 
+        **this->spotFalloffP);
 
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------

_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to