ivaria/decal.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

ivaria/decal.h
Go to the documentation of this file.

    00001 /*
    00002     Crystal Space 3D engine
    00003     Copyright (C) 2000 by Jorrit Tyberghein
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public
    00016     License along with this library; if not, write to the Free
    00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00018 */
    00019 #ifndef __CS_IGEOM_DECAL_H__
    00020 #define __CS_IGEOM_DECAL_H__
    00021
    00022 #include "csutil/scf.h"
    00023 #include "csutil/array.h"
    00024 #include "ivideo/graph3d.h"
    00025 #include "ivideo/rendermesh.h"
    00026
    00027 struct iSector;
    00028 struct iMaterialWrapper;
    00029 struct iMeshWrapper;
    00030 class csVector3;
    00031 class csVector2;
    00032 class csPoly3D;
    00033 class csColor4;
    00034 class csRenderBuffer;
    00035
    00051 struct iDecal
    00052 {
    00053 };
    00054
    00059 struct iDecalTemplate : public virtual iBase
    00060 {
    00061   SCF_INTERFACE(iDecalTemplate, 2, 0, 0);
    00062
    00068   virtual float GetTimeToLive () const = 0;
    00069
    00074   virtual iMaterialWrapper* GetMaterialWrapper () = 0;
    00075
    00080   virtual CS::Graphics::RenderPriority GetRenderPriority () const = 0;
    00081
    00086   virtual csZBufMode GetZBufMode () const = 0;
    00087
    00100   virtual float GetPolygonNormalThreshold() const = 0;
    00101
    00111   virtual float GetDecalOffset () const = 0;
    00112
    00118   virtual bool HasTopClipping () const = 0;
    00119
    00125   virtual float GetTopClippingScale () const = 0;
    00126
    00132   virtual bool HasBottomClipping () const = 0;
    00133
    00139   virtual float GetBottomClippingScale () const = 0;
    00140
    00146   virtual const csVector2& GetMinTexCoord () const = 0;
    00147
    00152   virtual const csColor4& GetMainColor () const = 0;
    00153
    00160   virtual const csColor4& GetTopColor () const = 0;
    00161
    00168   virtual const csColor4& GetBottomColor () const = 0;
    00169
    00175   virtual const csVector2& GetMaxTexCoord () const = 0;
    00176
    00181   virtual const uint GetMixMode () const = 0;
    00182
    00189   virtual float GetPerpendicularFaceThreshold () const = 0;
    00190
    00198   virtual float GetPerpendicularFaceOffset () const = 0;
    00199
    00205   virtual void SetTimeToLive (float timeToLive) = 0;
    00206
    00211   virtual void SetMaterialWrapper (iMaterialWrapper* material) = 0;
    00212
    00217   virtual void SetRenderPriority (CS::Graphics::RenderPriority renderPriority) = 0;
    00218
    00223   virtual void SetZBufMode (csZBufMode mode) = 0;
    00224
    00237   virtual void SetPolygonNormalThreshold (float polygonNormalThreshold) = 0;
    00238
    00248   virtual void SetDecalOffset (float decalOffset) = 0;
    00249
    00256   virtual void SetTopClipping (bool enabled, float topPlaneScale = 0.0f) = 0;
    00257
    00264   virtual void SetBottomClipping (bool enabled, float bottomPlaneScale) = 0;
    00265
    00272   virtual void SetTexCoords (const csVector2& min, const csVector2& max) = 0;
    00273
    00278   virtual void SetMixMode (uint mixMode) = 0;
    00279
    00286   virtual void SetPerpendicularFaceThreshold (float threshold) = 0;
    00287
    00295   virtual void SetPerpendicularFaceOffset (float offset) = 0;
    00296
    00301   virtual void SetMainColor (const csColor4& color) = 0;
    00302
    00309   virtual void SetTopColor (const csColor4& color) = 0;
    00310
    00317   virtual void SetBottomColor (const csColor4& color) = 0;
    00318
    00323   virtual void SetClipping (bool enabled) = 0;
    00324
    00328   virtual bool HasClipping () const = 0;
    00329 };
    00330
    00335 struct iDecalAnimationControl
    00336 {
    00337
    00338   virtual ~iDecalAnimationControl () {}
    00350   virtual void UpdateDecal (iDecalTemplate* decalTemplate,
    00351                             size_t baseIndex,
    00352                             csArray<size_t>& indices,
    00353                             csRenderBuffer& vertices,
    00354                             csRenderBuffer& normals) = 0;
    00355 };
    00356
    00361 struct iDecalBuilder
    00362 {
    00363   virtual ~iDecalBuilder () {}
    00364
    00374   virtual void AddStaticPoly (const csPoly3D& polygon, csArray<size_t>* indices = 0) = 0;
    00375
    00379   virtual void SetDecalAnimationControl (iDecalAnimationControl* animationControl) = 0;
    00380
    00381 };
    00382
    00392 struct iDecalManager : public virtual iBase
    00393 {
    00394   SCF_INTERFACE (iDecalManager, 2, 0, 0);
    00395
    00409   virtual iDecal* CreateDecal (iDecalTemplate* decalTemplate,
    00410     iSector* sector, const csVector3& pos, const csVector3& up,
    00411     const csVector3& normal, float width = 1.0f, float height = 1.0f,
    00412     iDecal* oldDecal = 0) = 0;
    00413
    00419   virtual csRef<iDecalTemplate> CreateDecalTemplate (
    00420     iMaterialWrapper* material) = 0;
    00421
    00426   virtual void DeleteDecal (const iDecal* decal) = 0;
    00427
    00432   virtual size_t GetDecalCount () const = 0;
    00433
    00439   virtual iDecal* GetDecal (size_t idx) const = 0;
    00440
    00454   virtual iDecal* CreateDecal (iDecalTemplate* decalTemplate,
    00455     iMeshWrapper* mesh, const csVector3& pos, const csVector3& up,
    00456     const csVector3& normal, float width = 1.0f, float height = 1.0f,
    00457     iDecal* oldDecal = 0) = 0;
    00458 };
    00463 #endif // __CS_IGEOM_DECAL_H__