From: Tim Moore Date: Fri, 17 Jul 2009 14:16:25 +0000 (+0200) Subject: Store material data with Effect X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=828d561113c39ed0b89f1c40efa2bfa38e66ddd6;p=simgear.git Store material data with Effect Somehow this got left out, which broke ground intersection queries. --- diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 3a9e9673..5cb949a9 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -246,6 +246,7 @@ void SGMaterial::buildEffectProperties(const osgDB::ReaderWriter::Options* options) { using namespace osg; + ref_ptr 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()); } }