[Teleus-cvs] teleus/src/gfx camera.cpp,1.5,1.6 camera.hpp,1.6,1.7
Status: Inactive
Brought to you by:
spiffgq
|
From: Daniel R. <sp...@us...> - 2004-05-25 21:15:46
|
Update of /cvsroot/teleus/teleus/src/gfx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29840/src/gfx Modified Files: camera.cpp camera.hpp Log Message: gfx::Camera class needs a lot of work. I changed obj::Mass and this stopped working. It seems to be working now, but I'm not comfortable with it. Index: camera.hpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/gfx/camera.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** camera.hpp 25 Feb 2004 06:34:01 -0000 1.6 --- camera.hpp 25 May 2004 21:15:18 -0000 1.7 *************** *** 41,45 **** ! private: Object *mBound; --- 41,45 ---- ! public: Object *mBound; Index: camera.cpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/gfx/camera.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** camera.cpp 25 Feb 2004 06:34:01 -0000 1.5 --- camera.cpp 25 May 2004 21:15:17 -0000 1.6 *************** *** 30,33 **** --- 30,34 ---- #include "obj/object.hpp" #include "math/physics.hpp" + #include "math/vector.hpp" #include "debug.hpp" *************** *** 109,113 **** if (radians >= math::TWO_PI){ radians -= math::TWO_PI; ! }else if (radians < 0){ radians += math::TWO_PI; } --- 110,114 ---- if (radians >= math::TWO_PI){ radians -= math::TWO_PI; ! }else if (radians < 0.0){ radians += math::TWO_PI; } *************** *** 137,141 **** if (radians >= math::TWO_PI){ radians -= math::TWO_PI; ! }else if (radians < 0){ radians += math::TWO_PI; } --- 138,142 ---- if (radians >= math::TWO_PI){ radians -= math::TWO_PI; ! }else if (radians < 0.0){ radians += math::TWO_PI; } *************** *** 156,162 **** --- 157,173 ---- void Camera::applyRotation(){ + #if 1 double x, y, z, angle; mBound->mRotation.getAxisAngle (x, y, z, angle); + glRotatef (math::radiansToDegrees(angle), x, y, -z); + #else + + double x, y, z, angle; + math::Vector4d quat; + //quat.setEulerAngles(math::radiansToDegrees(mAzimuthAngle), math::radiansToDegrees(mHeadingAngle), 0.0); + quat.setEulerAngles(315.0, 341.0, 0.0); + quat.getAxisAngle(x, y, z, angle); glRotatef (math::radiansToDegrees(angle), -x, -y, z); + #endif } *************** *** 170,177 **** void Camera::applyTranslation(){ glTranslatef ( -mBound->mPosition.x, ! -mBound->mPosition.y, ! mBound->mPosition.z ); } --- 181,194 ---- void Camera::applyTranslation(){ + #if 1 glTranslatef ( -mBound->mPosition.x, ! -mBound->mPosition.y, ! mBound->mPosition.z ); + #else + glTranslatef(50.0, -100.0, -100.0); + #endif + + } |