forked from speed-dreams/speed-dreams-code
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:
parent
71d037aed8
commit
acfdeda347
1 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue