]> git.mxchange.org Git - simgear.git/commitdiff
Store material data with Effect
authorTim Moore <timoore@redhat.com>
Fri, 17 Jul 2009 14:16:25 +0000 (16:16 +0200)
committerTim Moore <timoore@redhat.com>
Fri, 17 Jul 2009 14:18:12 +0000 (16:18 +0200)
Somehow this got left out, which broke ground intersection queries.

simgear/scene/material/mat.cxx

index 3a9e96738bebe338f0d6e51a3bb8ee72a15888cb..5cb949a93f2ed665e2c5c01ba8fef28291c389b8 100644 (file)
@@ -246,6 +246,7 @@ void SGMaterial::buildEffectProperties(const osgDB::ReaderWriter::Options*
                                        options)
 {
     using namespace osg;
+    ref_ptr<SGMaterialUserData> user = new SGMaterialUserData(this);
     SGPropertyNode_ptr propRoot = new SGPropertyNode();
     makeChild(propRoot, "inherits-from")->setStringValue(effect);
     SGPropertyNode* paramProp = makeChild(propRoot, "parameters");
@@ -277,6 +278,7 @@ void SGMaterial::buildEffectProperties(const osgDB::ReaderWriter::Options*
         makeChild(tex2dProp, "wrap-t")
             ->setStringValue(wrapv ? "repeat" : "clamp");
         matState.effect = makeEffect(effectProp, false, options);
+        matState.effect->setUserData(user.get());
     }
 }