## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# imesh/terrain.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2003 by Jorrit Tyberghein, Daniel Duhprey
    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_TERRAIN_H__
    00020 #define __CS_IMESH_TERRAIN_H__
    00021
    00026 #include "csutil/scf.h"
    00027
    00028 #include "csutil/array.h"
    00029
    00033 struct iImage;
    00034 struct iMaterialWrapper;
    00035 struct iMovable;
    00036 struct iTerraFormer;
    00037
    00038 class csBox2;
    00039 class csTransform;
    00040
    00041 SCF_VERSION (iTerrainObjectState, 0, 1, 0);
    00042
    00046 struct iTerrainObjectState : public iBase
    00047 {
    00052   virtual bool SetMaterialPalette (const csArray<iMaterialWrapper*>& pal) = 0;
    00053   virtual const csArray<iMaterialWrapper*>& GetMaterialPalette () const = 0;
    00054
    00064   virtual bool SetMaterialMap (const csArray<char>& data, int x, int y) = 0;
    00065   virtual bool SetMaterialMap (iImage* map) = 0;
    00066
    00081   virtual bool SetMaterialAlphaMaps (const csArray<csArray<char> >& data,
    00082         int x, int y) = 0;
    00083   virtual bool SetMaterialAlphaMaps (const csArray<iImage*>& maps) = 0;
    00084
    00097   virtual bool SetLODValue (const char* parameter, float value) = 0;
    00101   virtual float GetLODValue (const char* parameter) const = 0;
    00102
    00110   virtual bool SaveState (const char *filename) = 0;
    00111   virtual bool RestoreState (const char *filename) = 0;
    00112
    00114   virtual int CollisionDetect (iMovable *m, csTransform *p) = 0;
    00115
    00119   virtual void SetStaticLighting (bool enable) = 0;
    00123   virtual bool GetStaticLighting () = 0;
    00124
    00128   virtual void SetCastShadows (bool enable) = 0;
    00132   virtual bool GetCastShadows () = 0;
    00133 };
    00134
    00135 SCF_VERSION (iTerrainFactoryState, 0, 0, 1);
    00136
    00142 struct iTerrainFactoryState : public iBase
    00143 {
    00144
    00153   virtual void SetTerraFormer (iTerraFormer *form) = 0;
    00154   virtual iTerraFormer *GetTerraFormer () = 0;
    00155
    00161   virtual void SetSamplerRegion (const csBox2& region) = 0;
    00162   virtual const csBox2& GetSamplerRegion () = 0;
    00163
    00171   virtual bool SaveState (const char *filename) = 0;
    00172   virtual bool RestoreState (const char *filename) = 0;
    00173 };
    00174
    00177 #endif // __CS_IMESH_TERRAIN_H__