From: frohlich Date: Thu, 19 Mar 2009 07:58:32 +0000 (+0000) Subject: No longer change the material properties for ac models on the fly. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=403d9b6ac162b097740cb88398b4fb5ade2f3443;p=simgear.git No longer change the material properties for ac models on the fly. Modified Files: simgear/scene/model/ModelRegistry.cxx --- diff --git a/simgear/scene/model/ModelRegistry.cxx b/simgear/scene/model/ModelRegistry.cxx index 0ebdf06f..2e92c836 100644 --- a/simgear/scene/model/ModelRegistry.cxx +++ b/simgear/scene/model/ModelRegistry.cxx @@ -297,18 +297,6 @@ public: } }; -class SGAcMaterialCrippleVisitor : public SGStateAttributeVisitor { -public: - virtual void apply(StateSet::RefAttributePair& refAttr) - { - Material* material; - material = dynamic_cast(refAttr.first.get()); - if (!material) - return; - material->setColorMode(Material::AMBIENT_AND_DIFFUSE); - } -}; - } // namespace Node* DefaultProcessPolicy::process(Node* node, const string& filename, @@ -592,16 +580,7 @@ struct ACProcessPolicy { transform->setDataVariance(Object::STATIC); transform->setMatrix(m); transform->addChild(node); - // Ok, this step is questionable. - // It is there to have the same visual appearance of ac objects for the - // first cut. Osg's ac3d loader will correctly set materials from the - // ac file. But the old plib loader used GL_AMBIENT_AND_DIFFUSE for the - // materials that in effect igored the ambient part specified in the - // file. We emulate that for the first cut here by changing all - // ac models here. But in the long term we should use the - // unchanged model and fix the input files instead ... - SGAcMaterialCrippleVisitor matCriple; - root->accept(matCriple); + return root; } };