From 70391108fd4b7034e90766ded8ba0bdd13c016a0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 3 Jul 2006 16:21:57 +0000 Subject: [PATCH] Fixed orientation and lighting of model. --- src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp b/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp index acb199eaa..94d8183c3 100644 --- a/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp +++ b/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp @@ -198,7 +198,7 @@ public: -osg::Geode* ReaderWriterQ3BSP::convertFromBSP(BSPLoad& aLoadData,const osgDB::ReaderWriter::Options* options) const +osg::Geode* ReaderWriterQ3BSP::convertFromBSP(BSPLoad& aLoadData,const osgDB::ReaderWriter::Options*) const { std::vector texture_array; @@ -209,22 +209,21 @@ osg::Geode* ReaderWriterQ3BSP::convertFromBSP(BSPLoad& aLoadData,const osgDB::Re osg::Geode* map_geode=new osg::Geode; - - // Convertir los vertices unsigned int num_load_vertices=aLoadData.m_loadVertices.size(); osg::Vec3Array* vertex_array = new osg::Vec3Array(num_load_vertices); osg::Vec2Array* text_decal_array = new osg::Vec2Array(num_load_vertices); osg::Vec2Array* text_lmap_array = new osg::Vec2Array(num_load_vertices); + float scale = 0.03; unsigned int i; for(i=0; igetOrCreateStateSet(); if(texture) + { stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); + } + if(lightmap_texture) - { + { stateset->setTextureAttributeAndModes(1,lightmap_texture,osg::StateAttribute::ON); - } - - + } + //patch_group->addChild(map_geode); current_patch.m_quadraticPatches[y*numPatchesWide+x].Tesselate(8/*aCurveTesselation*/,patch_geom); @@ -346,6 +347,7 @@ osg::Geode* ReaderWriterQ3BSP::convertFromBSP(BSPLoad& aLoadData,const osgDB::Re //const osg::BoundingSphere& bs=map_geom->getBound(); + map_geode->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); return map_geode;