]> git.mxchange.org Git - simgear.git/commitdiff
Add cullFaceFront as a state attribute to the StateAttributeFactory
authortimoore <timoore>
Wed, 10 Dec 2008 22:38:14 +0000 (22:38 +0000)
committertimoore <timoore>
Wed, 10 Dec 2008 22:38:14 +0000 (22:38 +0000)
simgear/scene/util/StateAttributeFactory.cxx
simgear/scene/util/StateAttributeFactory.hxx

index 30407b05caab501fa1612bc2a177f9154459533f..902379606c859787f51dc636c9c375120e166dcb 100644 (file)
@@ -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);
 }
index c638108ccd8f1b1c4be6b5b6fa9dfc7a9a47006a..0a7809dd74dacd8e073bec9605648e0b2714c597 100644 (file)
@@ -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<osg::TexEnv> _standardTexEnv;
     osg::ref_ptr<osg::Texture2D> _whiteTexture;
     osg::ref_ptr<osg::Vec4Array> _white;
+    osg::ref_ptr<osg::CullFace> _cullFaceFront;
     osg::ref_ptr<osg::CullFace> _cullFaceBack;
     static osg::ref_ptr<StateAttributeFactory> _theInstance;
     static OpenThreads::Mutex _instanceMutex;