## Public API Reference

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

- File List
- File Members

# imesh/instmesh.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_IMESH_INSTMESH_H__
    00020 #define __CS_IMESH_INSTMESH_H__
    00021
    00026 #include "csutil/scf.h"
    00027
    00028 struct iDocumentNode;
    00029 struct iMaterialWrapper;
    00030 struct iRenderBuffer;
    00031 struct iMeshObject;
    00032
    00036 class csBox3;
    00037 class csColor;
    00038 class csColor4;
    00039 struct csTriangle;
    00040 class csVector2;
    00041 class csVector3;
    00042
    00048 struct iInstancingMeshCommonState : public virtual iBase
    00049 {
    00050   SCF_INTERFACE (iInstancingMeshCommonState, 1, 0, 0);
    00051
    00053   virtual void SetLighting (bool l) = 0;
    00055   virtual bool IsLighting () const = 0;
    00061   virtual void SetManualColors (bool m) = 0;
    00063   virtual bool IsManualColors () const = 0;
    00068   virtual void SetShadowCasting (bool m) = 0;
    00070   virtual bool IsShadowCasting () const = 0;
    00079   virtual void SetShadowReceiving (bool m) = 0;
    00081   virtual bool IsShadowReceiving () const = 0;
    00082 };
    00083
    00098 struct iInstancingMeshState : public virtual iInstancingMeshCommonState
    00099 {
    00100   SCF_INTERFACE (iInstancingMeshState, 1, 0, 0);
    00101
    00105   virtual size_t AddInstance (const csReversibleTransform& trans) = 0;
    00106
    00110   virtual void RemoveInstance (size_t id) = 0;
    00111
    00115   virtual void RemoveAllInstances () = 0;
    00116
    00120   virtual void MoveInstance (size_t id,
    00121       const csReversibleTransform& trans) = 0;
    00122
    00126   virtual const csReversibleTransform& GetInstanceTransform (size_t id) = 0;
    00127 };
    00128
    00129 class csSphere;
    00130
    00153 struct iInstancingFactoryState : public virtual iInstancingMeshCommonState
    00154 {
    00155   SCF_INTERFACE (iInstancingFactoryState, 1, 0, 0);
    00156
    00158   virtual void SetColor (const csColor& col) = 0;
    00160   virtual const csColor& GetColor () const = 0;
    00161
    00165   virtual void AddVertex (const csVector3& v,
    00166       const csVector2& uv, const csVector3& normal,
    00167       const csColor4& color) = 0;
    00168
    00170   virtual size_t GetVertexCount () const = 0;
    00174   virtual const csVector3* GetVertices () = 0;
    00178   virtual const csVector2* GetTexels () = 0;
    00182   virtual const csVector3* GetNormals () = 0;
    00186   virtual const csColor4* GetColors () = 0;
    00187
    00191   virtual void AddTriangle (const csTriangle& tri) = 0;
    00192
    00194   virtual size_t GetTriangleCount () const = 0;
    00198   virtual const csTriangle* GetTriangles () = 0;
    00199
    00205   virtual void CalculateNormals (bool compress = true) = 0;
    00206
    00211   virtual void Compress () = 0;
    00212
    00216   virtual void GenerateQuad (const csVector3& v1, const csVector3& v2,
    00217     const csVector3& v3, const csVector3& v4) = 0;
    00218
    00224   virtual void GenerateBox (const csBox3& box) = 0;
    00225
    00237   virtual void GenerateSphere (const csEllipsoid& sphere, int rim_vertices,
    00238       bool cyl_mapping = false,
    00239       bool toponly = false,
    00240       bool reversed = false) = 0;
    00241
    00245   virtual bool IsAutoNormals () const = 0;
    00246 };
    00247
    00250 #endif // __CS_IMESH_INSTMESH_H__
    00251