imesh/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 __CS_IMESH_TERRFUNC_H__ 00020 #define __CS_IMESH_TERRFUNC_H__ 00021 00022 #include "csutil/scf.h" 00023 00024 struct iEngine; 00025 struct iImage; 00026 struct iMaterialWrapper; 00027 struct iMaterialList; 00028 struct iLoaderContext; 00029 class csVector3; 00030 class csColor; 00031 class csTransform; 00032 00033 SCF_VERSION (iTerrainHeightFunction, 0, 0, 1); 00034 00039 struct iTerrainHeightFunction : public iBase 00040 { 00042 virtual float GetHeight (float dx, float dy) = 0; 00043 }; 00044 00045 SCF_VERSION (iTerrainNormalFunction, 0, 0, 1); 00046 00051 struct iTerrainNormalFunction : public iBase 00052 { 00054 virtual csVector3 GetNormal (float dx, float dy) = 0; 00055 }; 00056 00057 SCF_VERSION (iTerrFuncState, 0, 0, 11); 00058 00062 struct iTerrFuncState : public iBase 00063 { 00065 virtual void LoadMaterialGroup (iLoaderContext* ldr_context, 00066 const char *pName, int iStart, int iEnd) = 0; 00068 virtual void SetTopLeftCorner (const csVector3& topleft) = 0; 00069 // Get the top-left corner. 00070 virtual csVector3 GetTopLeftCorner () = 0; 00072 virtual void SetScale (const csVector3& scale) = 0; 00074 virtual csVector3 GetScale () = 0; 00076 virtual void SetResolution (int x, int y) = 0; 00078 virtual int GetXResolution () = 0; 00080 virtual int GetYResolution () = 0; 00084 virtual void SetGridResolution (int x, int y) = 0; 00086 virtual int GetXGridResolution () = 0; 00088 virtual int GetYGridResolution () = 0; 00090 virtual void SetColor (const csColor& col) = 0; 00092 virtual csColor GetColor () const = 0; 00094 virtual void SetHeightFunction (iTerrainHeightFunction* func) = 0; 00096 virtual void SetNormalFunction (iTerrainNormalFunction* func) = 0; 00098 virtual void SetHeightMap (iImage* im, float hscale, float hshift, 00099 bool flipx=false, bool flipy=false) = 0; 00101 virtual iTerrainHeightFunction* GetHeightFunction () const = 0; 00103 virtual iTerrainNormalFunction* GetNormalFunction () const = 0; 00104 00109 virtual void SetLODDistance (int lod, float dist) = 0; 00113 virtual float GetLODDistance (int lod) = 0; 00117 virtual void SetMaximumLODCost (int lod, float maxcost) = 0; 00121 virtual float GetMaximumLODCost (int lod) = 0; 00122 00127 virtual void CorrectSeams (int tw, int th) = 0; 00131 virtual void GetCorrectSeams (int& tw, int& th) const = 0; 00135 virtual void SetQuadDepth (int qd) = 0; 00139 virtual int GetQuadDepth () const = 0; 00140 00144 virtual void SetVisTesting (bool en) = 0; 00148 virtual bool IsVisTestingEnabled () = 0; 00149 00150 virtual void SetDirLight (const csVector3& pos, const csColor& col) = 0; 00151 virtual csVector3 GetDirLightPosition () const = 0; 00152 virtual csColor GetDirLightColor () const = 0; 00153 virtual void DisableDirLight () = 0; 00154 virtual bool IsDirLightEnabled () const = 0; 00155 virtual void SetMaterial (int i, iMaterialWrapper* mat) = 0; 00156 virtual int GetMaterialCount () const = 0; 00157 00158 virtual int CollisionDetect (csTransform *p) = 0; 00159 }; 00160 00161 #endif // __CS_IMESH_TERRFUNC_H__ 00162
Generated for Crystal Space by doxygen 1.2.18