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 00063 virtual iObject* QueryObject () = 0; 00064 00070 virtual float GetTimeToLive () const = 0; 00071 00076 virtual iMaterialWrapper* GetMaterialWrapper () = 0; 00077 00082 virtual CS::Graphics::RenderPriority GetRenderPriority () const = 0; 00083 00088 virtual csZBufMode GetZBufMode () const = 0; 00089 00102 virtual float GetPolygonNormalThreshold() const = 0; 00103 00113 virtual float GetDecalOffset () const = 0; 00114 00120 virtual bool HasTopClipping () const = 0; 00121 00127 virtual float GetTopClippingScale () const = 0; 00128 00134 virtual bool HasBottomClipping () const = 0; 00135 00141 virtual float GetBottomClippingScale () const = 0; 00142 00148 virtual const csVector2& GetMinTexCoord () const = 0; 00149 00154 virtual const csColor4& GetMainColor () const = 0; 00155 00162 virtual const csColor4& GetTopColor () const = 0; 00163 00170 virtual const csColor4& GetBottomColor () const = 0; 00171 00177 virtual const csVector2& GetMaxTexCoord () const = 0; 00178 00183 virtual const uint GetMixMode () const = 0; 00184 00191 virtual float GetPerpendicularFaceThreshold () const = 0; 00192 00200 virtual float GetPerpendicularFaceOffset () const = 0; 00201 00207 virtual void SetTimeToLive (float timeToLive) = 0; 00208 00213 virtual void SetMaterialWrapper (iMaterialWrapper* material) = 0; 00214 00219 virtual void SetRenderPriority (CS::Graphics::RenderPriority renderPriority) = 0; 00220 00225 virtual void SetZBufMode (csZBufMode mode) = 0; 00226 00239 virtual void SetPolygonNormalThreshold (float polygonNormalThreshold) = 0; 00240 00250 virtual void SetDecalOffset (float decalOffset) = 0; 00251 00258 virtual void SetTopClipping (bool enabled, float topPlaneScale = 0.0f) = 0; 00259 00266 virtual void SetBottomClipping (bool enabled, float bottomPlaneScale) = 0; 00267 00274 virtual void SetTexCoords (const csVector2& min, const csVector2& max) = 0; 00275 00280 virtual void SetMixMode (uint mixMode) = 0; 00281 00288 virtual void SetPerpendicularFaceThreshold (float threshold) = 0; 00289 00297 virtual void SetPerpendicularFaceOffset (float offset) = 0; 00298 00303 virtual void SetMainColor (const csColor4& color) = 0; 00304 00311 virtual void SetTopColor (const csColor4& color) = 0; 00312 00319 virtual void SetBottomColor (const csColor4& color) = 0; 00320 00325 virtual void SetClipping (bool enabled) = 0; 00326 00330 virtual bool HasClipping () const = 0; 00331 }; 00332 00337 struct iDecalAnimationControl 00338 { 00339 00340 virtual ~iDecalAnimationControl () {} 00352 virtual void UpdateDecal (iDecalTemplate* decalTemplate, 00353 size_t baseIndex, 00354 csArray<size_t>& indices, 00355 csRenderBuffer& vertices, 00356 csRenderBuffer& normals) = 0; 00357 }; 00358 00363 struct iDecalBuilder 00364 { 00365 virtual ~iDecalBuilder () {} 00366 00376 virtual void AddStaticPoly (const csPoly3D& polygon, csArray<size_t>* indices = 0) = 0; 00377 00381 virtual void SetDecalAnimationControl (iDecalAnimationControl* animationControl) = 0; 00382 00383 }; 00384 00394 struct iDecalManager : public virtual iBase 00395 { 00396 SCF_INTERFACE (iDecalManager, 2, 0, 0); 00397 00411 virtual iDecal* CreateDecal (iDecalTemplate* decalTemplate, 00412 iSector* sector, const csVector3& pos, const csVector3& up, 00413 const csVector3& normal, float width = 1.0f, float height = 1.0f, 00414 iDecal* oldDecal = 0) = 0; 00415 00421 virtual csRef<iDecalTemplate> CreateDecalTemplate ( 00422 iMaterialWrapper* material) = 0; 00423 00428 virtual void DeleteDecal (const iDecal* decal) = 0; 00429 00434 virtual size_t GetDecalCount () const = 0; 00435 00441 virtual iDecal* GetDecal (size_t idx) const = 0; 00442 00456 virtual iDecal* CreateDecal (iDecalTemplate* decalTemplate, 00457 iMeshWrapper* mesh, const csVector3& pos, const csVector3& up, 00458 const csVector3& normal, float width = 1.0f, float height = 1.0f, 00459 iDecal* oldDecal = 0) = 0; 00460 }; 00465 #endif // __CS_IGEOM_DECAL_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
