CrystalSpace

Public API Reference

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 
00055 SCF_VERSION (iCameraSectorListener, 0, 0, 1);
00056 
00061 struct iCameraSectorListener : public iBase
00062 {
00064   virtual void NewSector (iCamera* camera, iSector* sector) = 0;
00065 };
00066 
00098 struct iCamera : public virtual iBase
00099 {
00100   SCF_INTERFACE(iCamera, 2,0,0);
00105   virtual iCamera *Clone () const = 0;
00106 
00112   virtual iSceneNode* QuerySceneNode () = 0;
00113 
00115   virtual int GetFOV () const = 0;
00117   virtual float GetInvFOV () const = 0;
00119   virtual float GetFOVAngle () const = 0;
00120 
00125   virtual void SetFOV (int fov, int width) = 0;
00130   virtual void SetFOVAngle (float fov, int width) = 0;
00131 
00136   virtual float GetShiftX () const = 0;
00141   virtual float GetShiftY () const = 0;
00146   virtual void SetPerspectiveCenter (float x, float y) = 0;
00147 
00156   virtual csOrthoTransform& GetTransform () = 0;
00157 
00159   virtual const csOrthoTransform& GetTransform () const = 0;
00160 
00165   virtual void SetTransform (const csOrthoTransform& tr) = 0;
00166 
00173   virtual void MoveWorld (const csVector3& v, bool cd = true) = 0;
00177   virtual void Move (const csVector3& v, bool cd = true) = 0;
00185   virtual void MoveWorldUnrestricted (const csVector3& v) = 0;
00193   virtual void MoveUnrestricted (const csVector3& v) = 0;
00194 
00196   virtual iSector* GetSector () const = 0;
00198   virtual void SetSector (iSector*) = 0;
00199 
00204   virtual void Correct (int n) = 0;
00205 
00207   virtual bool IsMirrored () const = 0;
00209   virtual void SetMirrored (bool m) = 0;
00210 
00217   virtual csPlane3* GetFarPlane () const = 0;
00218 
00227   virtual void SetFarPlane (csPlane3* fp) = 0;
00228 
00235   virtual long GetCameraNumber () const = 0;
00236 
00241   CS_DEPRECATED_METHOD virtual void Perspective (const csVector3& v,
00242         csVector2& p) const = 0;
00247   CS_DEPRECATED_METHOD virtual void InvPerspective (const csVector2& p, float z,
00248         csVector3& v) const = 0;
00250   virtual csVector2 Perspective (const csVector3& v) const = 0;
00252   virtual csVector3 InvPerspective (const csVector2& p, float z) const = 0;
00253 
00261   virtual void OnlyPortals (bool hop) = 0;
00262 
00264   virtual bool GetOnlyPortals () = 0;
00265 
00267   virtual void AddCameraSectorListener (iCameraSectorListener* listener) = 0;
00269   virtual void RemoveCameraSectorListener (iCameraSectorListener* listener) = 0;
00270 };
00271 
00274 #endif // __CS_IENGINE_CAMERA_H__
00275 

Generated for Crystal Space by doxygen 1.4.6