Main Page   Class Hierarchy   Compound List   File List   Compound Members  

terrfunc.h

00001 /*
00002     Copyright (C) 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 __IMESH_TERRFUNC_H_
00020 #define __IMESH_TERRFUNC_H_
00021 
00022 #include "csutil/scf.h"
00023 
00024 struct iEngine;
00025 struct iImage;
00026 struct iMaterialWrapper;
00027 class csVector3;
00028 class csColor;
00029 class csTransform;
00030 
00031 SCF_VERSION (iTerrainHeightFunction, 0, 0, 1);
00032 
00037 struct iTerrainHeightFunction : public iBase
00038 {
00040   virtual float GetHeight (float dx, float dy) = 0;
00041 };
00042 
00043 SCF_VERSION (iTerrainNormalFunction, 0, 0, 1);
00044 
00049 struct iTerrainNormalFunction : public iBase
00050 {
00052   virtual csVector3 GetNormal (float dx, float dy) = 0;
00053 };
00054 
00055 SCF_VERSION (iTerrFuncState, 0, 0, 8);
00056 
00060 struct iTerrFuncState : public iBase
00061 {
00063   virtual void LoadMaterialGroup (iEngine* engine, const char *pName,
00064         int iStart, int iEnd) = 0;
00066   virtual void SetTopLeftCorner (const csVector3& topleft) = 0;
00067   // Get the top-left corner.
00068   virtual csVector3 GetTopLeftCorner () = 0;
00070   virtual void SetScale (const csVector3& scale) = 0;
00072   virtual csVector3 GetScale () = 0;
00074   virtual void SetResolution (int x, int y) = 0;
00076   virtual int GetXResolution () = 0;
00078   virtual int GetYResolution () = 0;
00082   virtual void SetGridResolution (int x, int y) = 0;
00084   virtual int GetXGridResolution () = 0;
00086   virtual int GetYGridResolution () = 0;
00088   virtual void SetColor (const csColor& col) = 0;
00090   virtual csColor GetColor () const = 0;
00092   virtual void SetHeightFunction (iTerrainHeightFunction* func) = 0;
00094   virtual void SetNormalFunction (iTerrainNormalFunction* func) = 0;
00096   virtual void SetHeightMap (iImage* im, float hscale, float hshift) = 0;
00097 
00102   virtual void SetLODDistance (int lod, float dist) = 0;
00106   virtual float GetLODDistance (int lod) = 0;
00110   virtual void SetMaximumLODCost (int lod, float maxcost) = 0;
00114   virtual float GetMaximumLODCost (int lod) = 0;
00115 
00120   virtual void CorrectSeams (int tw, int th) = 0;
00124   virtual void GetCorrectSeams (int& tw, int& th) const = 0;
00128   virtual void SetQuadDepth (int qd) = 0;
00132   virtual int GetQuadDepth () const = 0;
00133 
00137   virtual void SetVisTesting (bool en) = 0;
00141   virtual bool IsVisTestingEnabled () = 0;
00142 
00143   virtual void SetDirLight (const csVector3& pos, const csColor& col) = 0;
00144   virtual csVector3 GetDirLightPosition () const = 0;
00145   virtual csColor GetDirLightColor () const = 0;
00146   virtual void DisableDirLight () = 0;
00147   virtual bool IsDirLightEnabled () const = 0;
00148   virtual void SetMaterial (int i, iMaterialWrapper* mat) = 0;
00149   virtual int GetMaterialCount () const = 0;
00150 
00151   virtual int CollisionDetect (csTransform *p) = 0;
00152 };
00153 
00154 #endif // __IMESH_TERRFUNC_H_
00155 

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