|
From: <cn...@us...> - 2009-05-31 21:38:45
|
Revision: 297
http://hgengine.svn.sourceforge.net/hgengine/?rev=297&view=rev
Author: cnlohr
Date: 2009-05-31 21:38:26 +0000 (Sun, 31 May 2009)
Log Message:
-----------
add info for user
Modified Paths:
--------------
Mercury2/src/Camera.cpp
Modified: Mercury2/src/Camera.cpp
===================================================================
--- Mercury2/src/Camera.cpp 2009-05-31 21:07:59 UTC (rev 296)
+++ Mercury2/src/Camera.cpp 2009-05-31 21:38:26 UTC (rev 297)
@@ -49,6 +49,12 @@
m_y += m->dy/1200.0f;
m_x += m->dx/1200.0f;
+ //keep m_y within [-PI -> PI]
+ if( m_y < -Q_PI ) m_y += Q_PI*2.;
+ if( m_y > Q_PI ) m_y -= Q_PI*2.;
+
+ //if m_y is < -PI/2 or m_y > PI/2 one must invert the axes
+
MQuaternion qLeftRight = MQuaternion::CreateFromAxisAngle(MercuryVector(0,1,0), m_x);
MercuryVector LocalLookAt = MercuryVector( 1, 0, 0 );
LocalLookAt = LocalLookAt.Rotate( qLeftRight );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|