From 724fba4af9ebdc6a684d6c4a47d4f6af2f31f386 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Tue, 1 Jan 2013 14:18:39 +0100 Subject: [PATCH] canvas::Element: parse full 3x3 matrix 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 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/simgear/canvas/elements/CanvasElement.cxx b/simgear/canvas/elements/CanvasElement.cxx index fff667d7..485c162d 100644 --- a/simgear/canvas/elements/CanvasElement.cxx +++ b/simgear/canvas/elements/CanvasElement.cxx @@ -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),