home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 4 / CD_Magazyn_EXEC_nr_4.iso / Recent / dev / c / GSys.lha / gsys / g3d / G3DCamera.cpp next >
Encoding:
C/C++ Source or Header  |  2000-10-01  |  554 b   |  33 lines

  1.  
  2. /* Author Anders Kjeldsen */
  3.  
  4. #ifndef GCAMERA_CPP
  5. #define GCAMERA_CPP
  6.  
  7. #include "g3d/G3DCamera.h"
  8. #include "g3d/G3DMatrix.cpp"
  9. #include "g3d/G3DQuat.cpp"
  10.  
  11.  
  12. G3DCamera::G3DCamera()
  13. {
  14.     memset((void *)this, 0, sizeof (class G3DCamera) );
  15.     CamMatrix.SetIdentity();
  16. }
  17.  
  18.  
  19. void G3DCamera::SetDirection(float Ax, float Ay, float Az)
  20. {
  21.     MainQuat.Set(Ax, Ay, Az);
  22.     CamMatrix = MainQuat;
  23. }
  24.  
  25. void G3DCamera::AddDirection(float Ax, float Ay, float Az)
  26. {
  27.     
  28.     DiffQuat.Set(Ax, Ay, Az);
  29.     MainQuat = DiffQuat * MainQuat;
  30.     CamMatrix = MainQuat;
  31. }
  32.  
  33. #endif /* G3DCAMERA_CPP */