]> git.mxchange.org Git - simgear.git/commitdiff
canvas::Element: parse full 3x3 matrix
authorThomas Geymayer <tomgey@gmail.com>
Tue, 1 Jan 2013 13:18:39 +0000 (14:18 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Tue, 1 Jan 2013 13:18:39 +0000 (14:18 +0100)
This doesn't change any existing behaviour but allows specifying
full 3x3 matrix to eg. perform a perspective transform needed
for some HUDs.

simgear/canvas/elements/CanvasElement.cxx

index fff667d7f4313d53d94cc0a5af8a8b7bf43381e3..485c162d61de3192eb22837fee44bd25ffd16769 100644 (file)
@@ -88,14 +88,24 @@ namespace canvas
         {
           case TT_MATRIX:
             tf = osg::Matrix( tf_node->getDoubleValue("m[0]", 1),
-                              tf_node->getDoubleValue("m[1]", 0), 0, 0,
+                              tf_node->getDoubleValue("m[1]", 0),
+                              0,
+                              tf_node->getDoubleValue("m[6]", 0),
 
                               tf_node->getDoubleValue("m[2]", 0),
-                              tf_node->getDoubleValue("m[3]", 1), 0, 0,
+                              tf_node->getDoubleValue("m[3]", 1),
+                              0,
+                              tf_node->getDoubleValue("m[7]", 0),
+
+                              0,
+                              0,
+                              1,
+                              0,
 
-                              0,    0,    1, 0,
                               tf_node->getDoubleValue("m[4]", 0),
-                              tf_node->getDoubleValue("m[5]", 0), 0, 1 );
+                              tf_node->getDoubleValue("m[5]", 0),
+                              0,
+                              tf_node->getDoubleValue("m[8]", 1) );
             break;
           case TT_TRANSLATE:
             tf.makeTranslate( osg::Vec3f( tf_node->getDoubleValue("t[0]", 0),