|
campos.h00001 /* 00002 Copyright (C) 2000 by Andrew Zabolotny 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_CAMPOS_H__ 00020 #define __CS_CAMPOS_H__ 00021 00022 #include "csutil/csobject.h" 00023 #include "csutil/nobjvec.h" 00024 #include "csgeom/vector3.h" 00025 #include "csengine/camera.h" 00026 #include "iengine/campos.h" 00027 00028 struct iEngine; 00029 struct iCamera; 00030 class csPlane3; 00031 00036 class csCameraPosition : public csObject 00037 { 00038 private: 00040 virtual ~csCameraPosition (); 00041 00042 private: 00044 char* sector; 00046 csVector3 position; 00048 csVector3 forward; 00050 csVector3 upward; 00056 csPlane3* far_plane; 00057 00058 public: 00060 csCameraPosition (const char *name, const char *sector, 00061 const csVector3 &position, 00062 const csVector3 &forward, const csVector3 &upward); 00063 00065 void Set (const char *sector, const csVector3 &position, 00066 const csVector3 &forward, const csVector3 &upward); 00067 00069 bool Load (iCamera*, iEngine*); 00070 00071 void SetFarPlane (csPlane3* pl); 00072 void ClearFarPlane (); 00073 00074 SCF_DECLARE_IBASE_EXT (csObject); 00075 00076 //--------------------- iCameraPosition implementation ---------------------- 00077 struct CameraPosition : public iCameraPosition 00078 { 00079 SCF_DECLARE_EMBEDDED_IBASE(csCameraPosition); 00080 00081 virtual iObject *QueryObject(); 00082 virtual iCameraPosition *Clone () const; 00083 virtual const char *GetSector(); 00084 virtual void SetSector(const char *Name); 00085 virtual const csVector3 &GetPosition(); 00086 virtual void SetPosition (const csVector3 &v); 00087 virtual const csVector3 &GetUpwardVector(); 00088 virtual void SetUpwardVector (const csVector3 &v); 00089 virtual const csVector3 &GetForwardVector(); 00090 virtual void SetForwardVector (const csVector3 &v); 00091 virtual void Set (const char *sector, const csVector3 &pos, 00092 const csVector3 &forward, const csVector3 &upward); 00093 virtual bool Load (iCamera *c, iEngine *e); 00094 virtual void SetFarPlane (csPlane3* pl) 00095 { 00096 scfParent->SetFarPlane (pl); 00097 } 00098 virtual void ClearFarPlane () 00099 { 00100 scfParent->ClearFarPlane (); 00101 } 00102 virtual csPlane3* GetFarPlane () const 00103 { 00104 return scfParent->far_plane; 00105 } 00106 } scfiCameraPosition; 00107 friend struct CameraPosition; 00108 }; 00109 00110 #endif // __CS_CAMPOS_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |