Move snowballs compass, see #43

--HG--
branch : multipass-stereo
This commit is contained in:
kaetemi 2013-06-26 17:38:20 +02:00
parent 4864ce7a5a
commit 9255bd73de

View file

@ -28,6 +28,7 @@
#include <nel/3d/u_driver.h> #include <nel/3d/u_driver.h>
#include <nel/3d/u_text_context.h> #include <nel/3d/u_text_context.h>
#include <nel/3d/u_texture.h> #include <nel/3d/u_texture.h>
#include <nel/3d/stereo_ovr.h>
#include "mouse_listener.h" #include "mouse_listener.h"
#include "camera.h" #include "camera.h"
@ -94,6 +95,13 @@ void updateCompass ()
{ {
float x = CompassPosX; float x = CompassPosX;
float y = CompassPosY; float y = CompassPosY;
if (StereoHMD)
{
float xshift, yshift;
StereoHMD->getInterface2DShift(xshift, yshift, 4.0f);
x += xshift;
y += yshift;
}
float radius = CompassRadius; float radius = CompassRadius;
// tri // tri
@ -109,7 +117,8 @@ void updateCompass ()
quad.V2.set ( radius, radius, 0); quad.V2.set ( radius, radius, 0);
quad.V3.set (-radius, radius, 0); quad.V3.set (-radius, radius, 0);
Driver->setMatrixMode2D43 (); if (StereoHMD) Driver->setMatrixMode2D11();
else Driver->setMatrixMode2D43();
CMatrix mtx; CMatrix mtx;
@ -152,7 +161,7 @@ void updateCompass ()
Driver->setModelMatrix (mtx); Driver->setModelMatrix (mtx);
Driver->drawQuad (quad, CompassMaterial); Driver->drawQuad (quad, CompassMaterial);
x *= 3.0/4.0f; if (!StereoHMD) x *= 3.0/4.0f;
// Print position // Print position
TextContext->setHotSpot(UTextContext::MiddleTop); TextContext->setHotSpot(UTextContext::MiddleTop);