00001 #include <windows.h> 00002 #include "camera.h" 00003 #include "shared.h" 00004 #include "mmgr.h" 00005 00006 CAMERA::CAMERA() 00007 { 00008 } 00009 00010 CAMERA::~CAMERA() 00011 { 00012 } 00013 00014 void CAMERA::Reset() 00015 { 00016 Orientation.Reset(); 00017 Position.Reset(); 00018 Delta_x = 0.0; 00019 Delta_y = 0.0; 00020 Delta_z = 0.0; 00021 Matrix.LoadIdentity(); 00022 } 00023 00024 void CAMERA::Update() 00025 { 00026 Rotate(); 00027 00028 UpdatePosition(); 00029 } 00030 00031 void CAMERA::Apply() 00032 { 00033 Matrix.QuatToMatrix(Orientation); 00034 Matrix.MatrixInverse(); 00035 00036 glLoadMatrixf(Matrix.Element); 00037 glTranslatef(-Position.x,-Position.y,-Position.z); 00038 }