iengine/meshgen.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- File List
- File Members

iengine/meshgen.h
Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005 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_IENGINE_MESHGEN_H__
    00020 #define __CS_IENGINE_MESHGEN_H__
    00021
    00022
    00030 #include "csutil/scf.h"
    00031
    00032 struct iMeshFactoryWrapper;
    00033 struct iMeshWrapper;
    00034 class csBox3;
    00035 struct iTerraFormer;
    00036
    00050 struct iMeshGeneratorGeometry : public virtual iBase
    00051 {
    00052   SCF_INTERFACE(iMeshGeneratorGeometry, 1, 1, 3);
    00053
    00060   virtual void AddFactory (iMeshFactoryWrapper* factory, float maxdist) = 0;
    00061
    00065   virtual size_t GetFactoryCount () const = 0;
    00066
    00070   virtual void RemoveFactory (size_t idx) = 0;
    00071
    00075   virtual iMeshFactoryWrapper* GetFactory (size_t idx) = 0;
    00076
    00080   virtual float GetMaximumDistance (size_t idx) = 0;
    00081
    00089   virtual void SetRadius (float radius) = 0;
    00090
    00094   virtual float GetRadius () const = 0;
    00095
    00101   virtual void SetDensity (float density) = 0;
    00102
    00112   virtual void AddDensityMaterialFactor (iMaterialWrapper* material,
    00113         float factor) = 0;
    00114
    00122   virtual void SetDensityMap (iTerraFormer* map, float factor,
    00123     const csStringID & type) = 0;
    00124
    00134   virtual void SetDefaultDensityMaterialFactor (float factor) = 0;
    00135
    00139   virtual float GetDensity () const = 0;
    00140
    00144   virtual void AddPosition (const csVector2 &pos) = 0;
    00145
    00146   virtual void AddPositionsFromMap (iTerraFormer* map, const csBox2 &region,
    00147     uint resx, uint resy, float value, const csStringID & type) = 0;
    00148
    00154   virtual void SetWindDirection (float x, float z) = 0;
    00155
    00162   virtual void SetWindBias (float bias) = 0;
    00163
    00169   virtual void SetWindSpeed (float speed) = 0;
    00170
    00181   virtual bool UseDensityFactorMap (const char* factorMapID,
    00182                                     float factor) = 0;
    00183
    00188   virtual void SetMinimumDrawDistance (float dist) = 0;
    00190   virtual float GetMinimumDrawDistance () = 0;
    00191
    00198   virtual void SetMinimumOpaqueDistance (float dist) = 0;
    00200   virtual float GetMinimumOpaqueDistance () = 0;
    00201
    00212   virtual void SetMaximumOpaqueDistance (float dist) = 0;
    00214   virtual float GetMaximumOpaqueDistance () = 0;
    00215 };
    00216
    00229 struct iMeshGenerator : public virtual iBase
    00230 {
    00231   SCF_INTERFACE(iMeshGenerator, 1, 0, 4);
    00232
    00236   virtual iObject *QueryObject () = 0;
    00237
    00243   CS_DEPRECATED_METHOD_MSG("Feature removed in 2.1. "
    00244     "Similar functionality can be achieved by using multiple geometries with "
    00245    "different densities.")
    00246   virtual void SetDensityScale (float mindist, float maxdist,
    00247         float maxdensityfactor) = 0;
    00248
    00257   virtual void SetAlphaScale (float mindist, float maxdist) = 0;
    00258
    00265   virtual void SetSampleBox (const csBox3& box) = 0;
    00266
    00270   virtual const csBox3& GetSampleBox () const = 0;
    00271
    00280   virtual void SetCellCount (int number) = 0;
    00281
    00285   virtual int GetCellCount () const = 0;
    00286
    00294   virtual void SetBlockCount (int number) = 0;
    00295
    00299   virtual int GetBlockCount () const = 0;
    00300
    00304   virtual iMeshGeneratorGeometry* CreateGeometry () = 0;
    00305
    00309   virtual size_t GetGeometryCount () const = 0;
    00310
    00314   virtual iMeshGeneratorGeometry* GetGeometry (size_t idx) = 0;
    00315
    00319   virtual void RemoveGeometry (size_t idx) = 0;
    00320
    00324   virtual void AddMesh (iMeshWrapper* mesh) = 0;
    00325
    00329   virtual size_t GetMeshCount () const = 0;
    00330
    00334   virtual iMeshWrapper* GetMesh (size_t idx) = 0;
    00335
    00339   virtual void RemoveMesh (size_t idx) = 0;
    00340
    00345   virtual void ClearPosition (const csVector3& pos) = 0;
    00346
    00360   virtual void AddDensityFactorMap (const char* factorMapID,
    00361                                     iImage* mapImage,
    00362                                     const CS::Math::Matrix4& worldToMap) = 0;
    00363
    00368   virtual void UpdateDensityFactorMap (const char* factorMapID, iImage* mapImage) = 0;
    00369
    00373   virtual bool IsValidDensityFactorMap (const char* factorMapID) const = 0;
    00374
    00380   virtual const CS::Math::Matrix4& GetWorldToMapTransform (const char* factorMapID) const = 0;
    00381
    00386   virtual int GetDensityFactorMapWidth (const char* factorMapID) const = 0;
    00391   virtual int GetDensityFactorMapHeight (const char* factorMapID) const = 0;
    00392
    00398   virtual void SetDefaultDensityFactor (float factor) = 0;
    00399
    00403   virtual float GetDefaultDensityFactor () const = 0;
    00404 };
    00405
    00408 #endif // __CS_IENGINE_MESHGEN_H__