Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

KX_Camera.h

Go to the documentation of this file.
00001 #ifndef __KX_CAMERA
00002 #define __KX_CAMERA
00003 
00004 
00005 #include "MT_Transform.h"
00006 #include "MT_Matrix3x3.h"
00007 #include "MT_Vector3.h"
00008 #include "MT_Point3.h"
00009 #include "KX_GameObject.h"
00010 #include "IntValue.h"
00011 
00012 class KX_Camera : public KX_GameObject
00013 {
00014         
00015         void    MoveTo(const MT_Point3& movevec)

00016         {
00017                 /*MT_Transform camtrans;

00018                 camtrans.invert(m_trans1);

00019                 MT_Matrix3x3 camorient = camtrans.getBasis();

00020                 camtrans.translate(camorient.inverse()*movevec);

00021                 m_trans1.invert(camtrans);

00022                 */
00023         }
00024 
00025 public:
00026 
00027         KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks) :
00028         KX_GameObject(sgReplicationInfo,callbacks){
00029                 SetProperty("camera",new CIntValue(1));
00030         };
00031         virtual ~KX_Camera() {};
00032 <<<<<<< KX_Camera.h
00033         //void RotateRight(MT_Scalar speed)     {               EulerRotate(MT_Vector3(0,1,0),speed);   }
00034         //void RotateLeft(MT_Scalar speed)      {               EulerRotate(MT_Vector3(0,1,0),-speed);  }
00035         //void RotateUp(MT_Scalar speed)        {               EulerRotate(MT_Vector3(1,0,0),speed);   }
00036         //void RotateDown(MT_Scalar speed)      {               EulerRotate(MT_Vector3(1,0,0),-speed);  }
00037         //void MoveForward(MT_Scalar speed) { MoveTo (MT_Point3(0,0,speed));}
00038         //void MoveBackward(MT_Scalar speed) { MoveTo (MT_Point3(0,0,-speed));}
00039 
00040 
00041 =======
00042         
00043 >>>>>>> 1.7
00044         
00045          MT_Transform GetWorldToCamera() const { 
00046                 MT_Transform camtrans;
00047                  MT_Transform trans;
00048                 trans.setBasis(NodeGetWorldOrientation());
00049                 trans.setOrigin(NodeGetWorldPosition());
00050 
00051                 camtrans.invert(trans);
00052                 return camtrans;
00053         }
00054         
00055         void    SetWorldToCamera(const MT_Transform& trans) {
00056                 //m_trans1.invert(trans);
00057         };
00058         void    CorrectLookUp(MT_Scalar speed)

00059         {
00060                 /*
00061                 MT_Transform camtrans;

00062                 camtrans.invert(m_trans1);

00063                 MT_Matrix3x3 camorient = camtrans.getBasis();

00064                 MT_Scalar upcorrection = camtrans.getBasis()[0][2];

00065                 MT_Matrix3x3 mat = RotateWorld(MT_Vector3(0,0,1),upcorrection*speed);

00066                 camtrans.setBasis(mat*camorient);

00067                 MT_Matrix3x3 matinv = mat;

00068                 matinv.inverse();

00069                 MT_Point3 pos = camtrans.getOrigin();

00070                 pos = matinv*pos;

00071                 camtrans.setOrigin(pos);

00072                 m_trans1.invert(camtrans);

00073                 */
00074         }
00075         const MT_Point3 GetCameraLocation()  {
00076                 //return m_trans1.getOrigin();
00077                 return MT_Point3(0,0,0);
00078         }
00079 };
00080 #endif //__KX_CAMERA

Generated at Thu Feb 1 13:03:04 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000