]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/SGRotateTransform.cxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / model / SGRotateTransform.cxx
index 0b79f59ec051329bd827c29a78f6b66ee944eeb4..d1792f19175d61fcb6c7e033e5681228ae8da7c8 100644 (file)
 #include <osgDB/Input>
 #include <osgDB/Output>
 
+#include <simgear/scene/util/OsgMath.hxx>
+
 #include "SGRotateTransform.hxx"
 
-static void
-set_rotation (osg::Matrix &matrix, double position_rad,
-              const SGVec3d &center, const SGVec3d &axis)
+void SGRotateTransform::set_rotation (osg::Matrix &matrix, double position_rad,
+                                      const SGVec3d &center,
+                                      const SGVec3d &axis)
 {
   double temp_angle = -position_rad;
   
@@ -128,7 +130,7 @@ osg::BoundingSphere
 SGRotateTransform::computeBound() const
 {
   osg::BoundingSphere bs = osg::Group::computeBound();
-  osg::BoundingSphere centerbs(_center.osg(), bs.radius());
+  osg::BoundingSphere centerbs(toOsg(_center), bs.radius());
   centerbs.expandBy(bs);
   return centerbs;
 }
@@ -147,7 +149,7 @@ bool RotateTransform_readLocalData(osg::Object& obj, osgDB::Input& fr)
             fr += 3;
         else
             return false;
-        rot.setCenter(SGVec3d(center));
+        rot.setCenter(toSG(center));
     }
     if (fr[0].matchWord("axis")) {
         ++fr;
@@ -156,7 +158,7 @@ bool RotateTransform_readLocalData(osg::Object& obj, osgDB::Input& fr)
             fr += 3;
         else
             return false;
-        rot.setCenter(SGVec3d(axis));
+        rot.setCenter(toSG(axis));
     }
     if (fr[0].matchWord("angle")) {
         ++fr;