OSG: EM reaching the goal.

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5505 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 7097997f771370f943022b96c9ee8841ff1ca04c
Former-commit-id: 2a3bb204a582aac4a28e16051a18f2e035ec142d
This commit is contained in:
rvlander 2013-06-10 20:37:10 +00:00
parent 71d037aed8
commit acfdeda347

View file

@ -132,6 +132,8 @@ void SDReflectionMapping::update(){
tCarElt * car = screens->getActiveView()->getCurrentCar();
osg::Camera * viewCam = screens->getActiveView()->getOsgCam();
SDCars * cars = (SDCars *)getCars();
SDCar * sdcar = cars->getCar(car);
@ -172,7 +174,12 @@ void SDReflectionMapping::update(){
up[2] = car->_posMat[2][2];
cameras[osg::TextureCubeMap::POSITIVE_Z]->setViewMatrixAsLookAt(eye,center,up);
osg::Matrix n = osg::Matrix(-1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
0.0,0.0,0.0,1.0);
cameras[osg::TextureCubeMap::POSITIVE_Z]->setViewMatrix(osg::Matrix::translate(-eye)*osg::Matrix::rotate(viewCam->getViewMatrix().getRotate())*n);
osg::Matrix mat = cameras[osg::TextureCubeMap::POSITIVE_Z]->getViewMatrix();
osg::Matrix negX = osg::Matrix::rotate(osg::inDegrees(-90.0),osg::Y_AXIS);