- Update OsgGraph
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5984 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: e4e30592404b6f3a9376790fe33510bebc47382c Former-commit-id: c5cbe8d19419e40e8ece35cac1196883e7fbdc9d
This commit is contained in:
parent
efcd77176b
commit
230949176c
4 changed files with 8 additions and 8 deletions
|
@ -487,7 +487,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *car, bool tracktype, bool subcat
|
|||
|
||||
this->shader = new SDCarShader(pCar.get(), this);
|
||||
|
||||
if (carshader)
|
||||
if (carshader > 1)
|
||||
this->reflectionMappingMethod = REFLECTIONMAPPING_DYNAMIC;
|
||||
else
|
||||
this->reflectionMappingMethod = REFLECTIONMAPPING_OFF;
|
||||
|
|
|
@ -127,12 +127,12 @@ SDReflectionMapping::SDReflectionMapping(SDCar *c):car(c)
|
|||
camerasRoot->addChild(camera);
|
||||
cameras.push_back(camera);
|
||||
|
||||
if (reflectionShader == 1)
|
||||
if (reflectionShader > 1)
|
||||
camera->setNodeMask(0);
|
||||
}
|
||||
|
||||
//ACTIVATE to enable Environment MApping <= temporary hack.
|
||||
if (reflectionShader == 1)
|
||||
if (reflectionShader > 1)
|
||||
{
|
||||
SDScreens * screens = (SDScreens*)getScreens();
|
||||
screens->registerViewDependantPreRenderNode(this->getCamerasRoot());
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "OsgCar.h"
|
||||
#include "OsgSky.h"
|
||||
|
||||
SDCarShader::SDCarShader(osg::Node *car, SDCar *c)
|
||||
SDCarShader::SDCarShader(osg::Group *car, SDCar *c)
|
||||
{
|
||||
std::string TmpPath = GetDataDir();
|
||||
osg::ref_ptr<osg::Shader> vertShader = new osg::Shader( osg::Shader::VERTEX);
|
||||
|
@ -39,7 +39,7 @@ SDCarShader::SDCarShader(osg::Node *car, SDCar *c)
|
|||
program->addShader( vertShader.get() );
|
||||
program->addShader( fragShader.get() );
|
||||
|
||||
pCar= car;
|
||||
pCar= dynamic_cast<osg::Group *> (car);
|
||||
this->pSdCar = c;
|
||||
stateset = pCar->getOrCreateStateSet();
|
||||
stateset->setAttributeAndModes(program);
|
||||
|
|
|
@ -45,7 +45,7 @@ private :
|
|||
osg::ref_ptr<osg::Uniform> reflectionMapStaticOffsetCoords;
|
||||
|
||||
public :
|
||||
SDCarShader(osg::Node *car, SDCar *c);
|
||||
SDCarShader(osg::Group *car, SDCar *c);
|
||||
void update(osg::Matrixf view);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue