CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

thing.h

00001 /*
00002     Copyright (C) 1998-2003 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_IMESH_THING_H__
00020 #define __CS_IMESH_THING_H__
00021 
00022 #include "csutil/scf.h"
00023 #include "csutil/flags.h"
00024 
00025 class csVector2;
00026 class csVector3;
00027 class csMatrix3;
00028 struct iSector;
00029 struct iPolygon3D;
00030 struct iPolygon3DStatic;
00031 struct iPortal;
00032 struct iGraphics3D;
00033 struct iFrustumView;
00034 struct iMaterialWrapper;
00035 struct iMaterialList;
00036 struct iMovable;
00037 
00042 #define CS_THING_FASTMESH 2
00043 
00050 #define CS_THING_NOCOMPRESS 4
00051 
00056 #define CS_THING_MOVE_NEVER 0
00057 #define CS_THING_MOVE_OCCASIONAL 2
00058 
00059 
00060 SCF_VERSION (iThingFactoryState, 0, 1, 0);
00061 
00066 struct iThingFactoryState : public iBase
00067 {
00069   virtual void* GetPrivateObject () = 0;
00070 
00081   virtual void CompressVertices () = 0;
00082 
00084   virtual int GetPolygonCount () = 0;
00086   virtual iPolygon3DStatic *GetPolygon (int idx) = 0;
00088   virtual iPolygon3DStatic *GetPolygon (const char* name) = 0;
00090   virtual iPolygon3DStatic *CreatePolygon (const char *iName = 0) = 0;
00092   virtual int FindPolygonIndex (iPolygon3DStatic* polygon) const = 0;
00094   virtual void RemovePolygon (int idx) = 0;
00096   virtual void RemovePolygons () = 0;
00097 
00099   virtual int GetPortalCount () const = 0;
00101   virtual iPortal* GetPortal (int idx) const = 0;
00103   virtual iPolygon3DStatic* GetPortalPolygon (int idx) const = 0;
00104 
00106   virtual int GetVertexCount () const = 0;
00108   virtual const csVector3 &GetVertex (int idx) const = 0;
00110   virtual const csVector3* GetVertices () const = 0;
00112   virtual int CreateVertex (const csVector3& vt) = 0;
00114   virtual void SetVertex (int idx, const csVector3& vt) = 0;
00120   virtual void DeleteVertex (int idx) = 0;
00128   virtual void DeleteVertices (int from, int to) = 0;
00129 
00131   virtual csFlags& GetFlags () = 0;
00132 
00138   virtual iPolygon3DStatic* IntersectSegment (const csVector3& start,
00139         const csVector3& end, csVector3& isect,
00140         float* pr = 0, bool only_portals = false) = 0;
00141 
00145   virtual void SetSmoothingFlag (bool smoothing) = 0;
00146 
00150   virtual bool GetSmoothingFlag () = 0;
00151   
00155   virtual csVector3* GetNormals () = 0;
00156 
00160   virtual float GetCosinusFactor () const = 0;
00166   virtual void SetCosinusFactor (float cosfact) = 0;
00167 };
00168 
00169 SCF_VERSION (iThingState, 0, 6, 1);
00170 
00175 struct iThingState : public iBase
00176 {
00178   virtual void* GetPrivateObject () = 0;
00179 
00181   virtual iThingFactoryState* GetFactory () = 0;
00182 
00184   virtual iPolygon3D *GetPolygon (int idx) = 0;
00186   virtual iPolygon3D *GetPolygon (const char* name) = 0;
00188   virtual int FindPolygonIndex (iPolygon3D* polygon) const = 0;
00190   virtual iPolygon3D* GetPortalPolygon (int idx) const = 0;
00191 
00193   virtual const csVector3 &GetVertexW (int idx) const = 0;
00195   virtual const csVector3* GetVerticesW () const = 0;
00197   virtual const csVector3 &GetVertexC (int idx) const = 0;
00199   virtual const csVector3* GetVerticesC () const = 0;
00200 
00204   virtual int GetMovingOption () const = 0;
00205 
00233   virtual void SetMovingOption (int opt) = 0;
00234 
00240   virtual iPolygon3D* IntersectSegment (const csVector3& start,
00241         const csVector3& end, csVector3& isect,
00242         float* pr = 0, bool only_portals = false) = 0;
00243 
00252   virtual void Prepare () = 0;
00253 
00258   virtual void Unprepare () = 0;
00259 
00267   virtual void ReplaceMaterial (iMaterialWrapper* oldmat,
00268         iMaterialWrapper* newmat) = 0;
00269 
00274   virtual void ClearReplacedMaterials () = 0;
00275 };
00276 
00277 SCF_VERSION (iThingEnvironment, 0, 3, 0);
00278 
00283 struct iThingEnvironment : public iBase
00284 {
00288   virtual void Clear () = 0;
00289 
00291   virtual int GetLightmapCellSize () const = 0;
00293   virtual void SetLightmapCellSize (int Size) = 0;
00295   virtual int GetDefaultLightmapCellSize () const = 0;
00296 };
00297 
00298 #endif // __CS_IMESH_THING_H__

Generated for Crystal Space by doxygen 1.2.14