imesh/watermesh.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

imesh/watermesh.h
Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2008 by Pavel Krajcevski
    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_WATERMESH_H__
    00020 #define __CS_IMESH_WATERMESH_H__
    00021
    00026 #include "csutil/scf.h"
    00027 #include "csutil/scf_implementation.h"
    00028
    00054 struct iWaterFactoryState : public virtual iBase
    00055 {
    00056   SCF_INTERFACE (iWaterFactoryState, 2, 0, 0);
    00057
    00064   enum waterMeshType {
    00066     WATER_TYPE_LOCAL,
    00068     WATER_TYPE_OCEAN
    00069   };
    00070
    00076   virtual void Invalidate () = 0;
    00077
    00079   virtual void SetLength(uint length) = 0;
    00081   virtual uint GetLength() = 0;
    00082
    00084   virtual void SetWidth(uint width) = 0;
    00086   virtual uint GetWidth() = 0;
    00087
    00095   virtual void SetGranularity(uint granularity) = 0;
    00097   virtual uint GetGranularity() = 0;
    00098
    00100   virtual void SetMurkiness(float murk) = 0;
    00102   virtual float GetMurkiness() = 0;
    00103
    00105   virtual void SetWaterType(waterMeshType type) = 0;
    00106
    00108   virtual bool isOcean() = 0;
    00109
    00110   // TODO: Implement a way to "add" a wave function instead of having three hardcoded.
    00111
    00113   virtual void SetAmplitudes(float amp1, float amp2, float amp3) = 0;
    00114
    00116   virtual void SetFrequencies(float freq1, float freq2, float freq3) = 0;
    00117
    00119   virtual void SetPhases(float phase1, float phase2, float phase3) = 0;
    00120
    00122   virtual void SetDirections(csVector2 dir1, csVector2 dir2, csVector2 dir3) = 0;
    00123
    00124   // Size must be a power of two. Not yet implemented.
    00125   virtual csRef<iTextureWrapper> MakeFresnelTex(int size) = 0;
    00126 };
    00127
    00131 struct iWaterMeshState : public virtual iBase
    00132 {
    00133   SCF_INTERFACE (iWaterMeshState, 1, 0, 0);
    00134
    00136   virtual void SetNormalMap(iTextureWrapper *map) = 0;
    00137
    00139   virtual iTextureWrapper *GetNormalMap() = 0;
    00140 };
    00141
    00144 #endif // __CS_IMESH_WATERMESH_H__