Main Page   Class Hierarchy   Compound List   File List   Compound Members  

campos.h

00001 /*
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 
00038 class csCameraPosition : public csObject
00039 {
00040 private:
00042   virtual ~csCameraPosition ();
00043 
00044 public:
00046   char *Sector;
00048   csVector3 Position;
00050   csVector3 Forward;
00052   csVector3 Upward;
00053 
00055   csCameraPosition (const char *iName, const char *iSector,
00056     const csVector3 &iPosition,
00057     const csVector3 &iForward, const csVector3 &iUpward);
00058 
00060   void Set (const char *iSector, const csVector3 &iPosition,
00061     const csVector3 &iForward, const csVector3 &iUpward);
00062 
00064   bool Load (iCamera*, iEngine*);
00065 
00066   SCF_DECLARE_IBASE_EXT (csObject);
00067 
00068   //--------------------- iCameraPosition implementation ----------------------
00069   struct CameraPosition : public iCameraPosition
00070   {
00071     SCF_DECLARE_EMBEDDED_IBASE(csCameraPosition);
00072 
00073     virtual iObject *QueryObject()
00074     { return scfParent; }
00075     virtual const char *GetSector()
00076     { return scfParent->Sector; }
00077     virtual csVector3 GetPosition()
00078     { return scfParent->Position; }
00079     virtual csVector3 GetUpwardVector()
00080     { return scfParent->Upward; }
00081     virtual csVector3 GetForwardVector()
00082     { return scfParent->Forward; }
00083     virtual bool Load (iCamera *c, iEngine *e)
00084     { return scfParent->Load (c, e); }
00085     virtual void Set (const char *sector, const csVector3 &pos,
00086       const csVector3 &forward, const csVector3 &upward)
00087     {
00088       scfParent->Set (sector, pos, forward, upward);
00089     }
00090   } scfiCameraPosition;
00091   friend struct CameraPosition;
00092 };
00093 
00094 #endif // __CS_CAMPOS_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000