Hi,

the rotate animation has two ways to define a axis
1. by using center/x-m and axis/[xyz]
2. by using axis/[xyz]1-m and axis/[xyz]2-m

The translate animation only supports method 1. and here comes a patch that 
enables method 2 for this animations, too.

Works fine for me and makes life a little easier.

I'd be happy if someone considers commiting this.

Thanks, Torsten


Index: animation.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/scene/model/animation.cxx,v
retrieving revision 1.77
diff -u -p -r1.77 animation.cxx
--- animation.cxx       12 Dec 2008 20:02:44 -0000      1.77
+++ animation.cxx       15 Feb 2009 19:14:44 -0000
@@ -655,9 +655,20 @@ SGTranslateAnimation::SGTranslateAnimati
   else
     _initialValue = 0;

-  _axis[0] = configNode->getDoubleValue("axis/x", 0);
-  _axis[1] = configNode->getDoubleValue("axis/y", 0);
-  _axis[2] = configNode->getDoubleValue("axis/z", 0);
+  if (configNode->hasValue("axis/x1-m")) {
+    SGVec3d v1, v2;
+    v1[0] = configNode->getDoubleValue("axis/x1-m", 0);
+    v1[1] = configNode->getDoubleValue("axis/y1-m", 0);
+    v1[2] = configNode->getDoubleValue("axis/z1-m", 0);
+    v2[0] = configNode->getDoubleValue("axis/x2-m", 0);
+    v2[1] = configNode->getDoubleValue("axis/y2-m", 0);
+    v2[2] = configNode->getDoubleValue("axis/z2-m", 0);
+    _axis = v2 - v1;
+  } else {
+    _axis[0] = configNode->getDoubleValue("axis/x", 0);
+    _axis[1] = configNode->getDoubleValue("axis/y", 0);
+    _axis[2] = configNode->getDoubleValue("axis/z", 0);
+  }
   if (8*SGLimitsd::min() < norm(_axis))
     _axis = normalize(_axis);
 }

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to