iengine/camera.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 1998-2001 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_IENGINE_CAMERA_H__ 00020 #define __CS_IENGINE_CAMERA_H__ 00021 00030 #include "csutil/scf.h" 00031 00032 #define CS_VEC_FORWARD csVector3(0,0,1) 00033 #define CS_VEC_BACKWARD csVector3(0,0,-1) 00034 #define CS_VEC_RIGHT csVector3(1,0,0) 00035 #define CS_VEC_LEFT csVector3(-1,0,0) 00036 #define CS_VEC_UP csVector3(0,1,0) 00037 #define CS_VEC_DOWN csVector3(0,-1,0) 00038 00039 #define CS_VEC_ROT_RIGHT csVector3(0,1,0) 00040 #define CS_VEC_ROT_LEFT csVector3(0,-1,0) 00041 #define CS_VEC_TILT_RIGHT (-csVector3(0,0,1)) 00042 #define CS_VEC_TILT_LEFT (-csVector3(0,0,-1)) 00043 #define CS_VEC_TILT_UP (-csVector3(1,0,0)) 00044 #define CS_VEC_TILT_DOWN (-csVector3(-1,0,0)) 00045 00046 class csOrthoTransform; 00047 class csPlane3; 00048 class csVector2; 00049 class csVector3; 00050 00051 struct iSector; 00052 struct iCamera; 00053 struct iSceneNode; 00054 00062 struct iCameraSectorListener : public virtual iBase 00063 { 00064 SCF_INTERFACE (iCameraSectorListener, 0, 0, 1); 00065 00067 virtual void NewSector (iCamera* camera, iSector* sector) = 0; 00068 }; 00069 00102 struct iCamera : public virtual iBase 00103 { 00104 SCF_INTERFACE(iCamera, 2,0,0); 00109 virtual iCamera *Clone () const = 0; 00110 00116 virtual iSceneNode* QuerySceneNode () = 0; 00117 00119 virtual int GetFOV () const = 0; 00121 virtual float GetInvFOV () const = 0; 00123 virtual float GetFOVAngle () const = 0; 00124 00129 virtual void SetFOV (int fov, int width) = 0; 00134 virtual void SetFOVAngle (float fov, int width) = 0; 00135 00140 virtual float GetShiftX () const = 0; 00145 virtual float GetShiftY () const = 0; 00150 virtual void SetPerspectiveCenter (float x, float y) = 0; 00151 00160 virtual csOrthoTransform& GetTransform () = 0; 00161 00163 virtual const csOrthoTransform& GetTransform () const = 0; 00164 00169 virtual void SetTransform (const csOrthoTransform& tr) = 0; 00170 00177 virtual void MoveWorld (const csVector3& v, bool cd = true) = 0; 00181 virtual void Move (const csVector3& v, bool cd = true) = 0; 00189 virtual void MoveWorldUnrestricted (const csVector3& v) = 0; 00197 virtual void MoveUnrestricted (const csVector3& v) = 0; 00198 00200 virtual iSector* GetSector () const = 0; 00202 virtual void SetSector (iSector*) = 0; 00203 00208 virtual void Correct (int n) = 0; 00209 00211 virtual bool IsMirrored () const = 0; 00213 virtual void SetMirrored (bool m) = 0; 00214 00221 virtual csPlane3* GetFarPlane () const = 0; 00222 00231 virtual void SetFarPlane (csPlane3* fp) = 0; 00232 00239 virtual long GetCameraNumber () const = 0; 00240 00245 CS_DEPRECATED_METHOD_MSG("Use Perspective(const csVector3&) instead") 00246 virtual void Perspective (const csVector3& v, csVector2& p) const = 0; 00251 CS_DEPRECATED_METHOD_MSG("Use InvPerspective(const csVector2&, float) " 00252 "instead") 00253 virtual void InvPerspective (const csVector2& p, float z, 00254 csVector3& v) const = 0; 00256 virtual csVector2 Perspective (const csVector3& v) const = 0; 00258 virtual csVector3 InvPerspective (const csVector2& p, float z) const = 0; 00259 00267 virtual void OnlyPortals (bool hop) = 0; 00268 00270 virtual bool GetOnlyPortals () = 0; 00271 00273 virtual void AddCameraSectorListener (iCameraSectorListener* listener) = 0; 00275 virtual void RemoveCameraSectorListener (iCameraSectorListener* listener) = 0; 00276 }; 00277 00280 #endif // __CS_IENGINE_CAMERA_H__ 00281
Generated for Crystal Space by doxygen 1.4.7