From: timoore Date: Wed, 10 Dec 2008 22:38:14 +0000 (+0000) Subject: Add cullFaceFront as a state attribute to the StateAttributeFactory X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=862a827fe602acdf893da424e07af26294dbd834;p=simgear.git Add cullFaceFront as a state attribute to the StateAttributeFactory --- diff --git a/simgear/scene/util/StateAttributeFactory.cxx b/simgear/scene/util/StateAttributeFactory.cxx index 30407b05..90237960 100644 --- a/simgear/scene/util/StateAttributeFactory.cxx +++ b/simgear/scene/util/StateAttributeFactory.cxx @@ -60,6 +60,8 @@ StateAttributeFactory::StateAttributeFactory() _white = new Vec4Array(1); (*_white)[0].set(1.0f, 1.0f, 1.0f, 1.0f); _white->setDataVariance(Object::STATIC); + _cullFaceFront = new CullFace(CullFace::FRONT); + _cullFaceFront->setDataVariance(Object::STATIC); _cullFaceBack = new CullFace(CullFace::BACK); _cullFaceBack->setDataVariance(Object::STATIC); } diff --git a/simgear/scene/util/StateAttributeFactory.hxx b/simgear/scene/util/StateAttributeFactory.hxx index c638108c..0a7809dd 100644 --- a/simgear/scene/util/StateAttributeFactory.hxx +++ b/simgear/scene/util/StateAttributeFactory.hxx @@ -49,7 +49,8 @@ public: osg::Texture2D* getWhiteTexture() { return _whiteTexture.get(); } // White color osg::Vec4Array* getWhiteColor() {return _white.get(); } - // cull back facing polygons + // cull front and back facing polygons + osg::CullFace* getCullFaceFront() { return _cullFaceFront.get(); } osg::CullFace* getCullFaceBack() { return _cullFaceBack.get(); } static StateAttributeFactory* instance(); @@ -62,6 +63,7 @@ protected: osg::ref_ptr _standardTexEnv; osg::ref_ptr _whiteTexture; osg::ref_ptr _white; + osg::ref_ptr _cullFaceFront; osg::ref_ptr _cullFaceBack; static osg::ref_ptr _theInstance; static OpenThreads::Mutex _instanceMutex;