From 5a08afeb07751954e3deac811bda26c81cdd18d1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 6 Sep 2006 09:46:32 +0000 Subject: [PATCH] From Brede Johansen, "The previous submission didn't handle Objects with transforms. The attached file corrects this. I also removed the multitexture macro for the Object record. Only Face and Mesh records are valid targets." --- src/osgPlugins/OpenFlight/PrimaryRecords.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp index db293d2f6..3495f1d0f 100644 --- a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp +++ b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp @@ -784,8 +784,20 @@ public: META_setID(_object) META_setComment(_object) - META_setMatrix(_object) - META_setMultitexture(_object) + + virtual void setMatrix(osg::Matrix& matrix) + { + if (_object.valid()) + insertMatrixTransform(*_object,matrix); + else + { + _object = new osg::MatrixTransform(matrix); + _object->setDataVariance(osg::Object::STATIC); + + if (_parent.valid()) + _parent->addChild(*_object); + } + } virtual void addChild(osg::Node& child) {