imesh/thing.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 1998-2003 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_THING_H__ 00020 #define __CS_IMESH_THING_H__ 00021 00022 #include "csutil/scf.h" 00023 #include "igraphic/image.h" 00024 00033 struct iMaterialWrapper; 00034 struct iMeshObject; 00035 struct iMeshObjectFactory; 00036 struct iRenderBuffer; 00037 struct iThingState; 00038 struct iThingFactoryState; 00039 00040 class csFlags; 00041 class csMatrix3; 00042 class csPlane3; 00043 class csVector2; 00044 class csVector3; 00045 00046 #include "csutil/deprecated_warn_off.h" 00047 00052 struct 00053 CS_DEPRECATED_TYPE_MSG ("csPolygonRange is deprecated") 00054 csPolygonRange 00055 { 00056 int start, end; 00057 csPolygonRange (int start, int end) 00058 { 00059 csPolygonRange::start = start; 00060 csPolygonRange::end = end; 00061 } 00062 void Set (int start, int end) 00063 { 00064 csPolygonRange::start = start; 00065 csPolygonRange::end = end; 00066 } 00067 void Set (int idx) 00068 { 00069 csPolygonRange::start = idx; 00070 csPolygonRange::end = idx; 00071 } 00072 }; 00073 00080 #define CS_POLY_LIGHTING 0x00000001 00081 00085 #define CS_POLY_COLLDET 0x00000002 00086 00090 #define CS_POLY_VISCULL 0x00000004 00091 00099 #define CS_POLYRANGE(s1,s2) csPolygonRange (s1, s2) 00100 00103 #define CS_POLYRANGE_SINGLE(idx) csPolygonRange (idx, idx) 00104 00107 #define CS_POLYRANGE_LAST csPolygonRange (-1, -1) 00108 00111 #define CS_POLYRANGE_ALL csPolygonRange (0, 2000000000) 00112 00117 #define CS_POLYINDEX_LAST -1 00118 00127 #define CS_THING_NOCOMPRESS 0x00010000 00128 00136 #define CS_THING_MOVE_NEVER 0 00137 #define CS_THING_MOVE_OCCASIONAL 2 00138 00158 struct 00159 CS_DEPRECATED_TYPE_MSG ("iPolygonHandle is deprecated") 00160 iPolygonHandle : public virtual iBase 00161 { 00162 SCF_INTERFACE (iPolygonHandle, 1, 0, 0); 00163 00168 virtual iThingFactoryState* GetThingFactoryState () const = 0; 00169 00174 virtual iMeshObjectFactory* GetMeshObjectFactory () const = 0; 00175 00180 virtual iThingState* GetThingState () const = 0; 00181 00186 virtual iMeshObject* GetMeshObject () const = 0; 00187 00191 virtual int GetIndex () const = 0; 00192 }; 00193 00194 00213 struct 00214 CS_DEPRECATED_TYPE_MSG ("iThingFactoryState is deprecated. Use genmesh instead (iGeneralFactoryState)") 00215 iThingFactoryState : public virtual iBase 00216 { 00217 SCF_INTERFACE(iThingFactoryState, 2, 0, 1); 00218 00227 virtual void CompressVertices () = 0; 00228 00230 virtual int GetPolygonCount () = 0; 00232 virtual void RemovePolygon (int idx) = 0; 00234 virtual void RemovePolygons () = 0; 00235 00237 virtual int FindPolygonByName (const char* name) = 0; 00238 00243 virtual int AddEmptyPolygon () = 0; 00244 00255 virtual int AddTriangle (const csVector3& v1, const csVector3& v2, 00256 const csVector3& v3) = 0; 00268 virtual int AddQuad (const csVector3& v1, const csVector3& v2, 00269 const csVector3& v3, const csVector3& v4) = 0; 00270 00281 virtual int AddPolygon (csVector3* vertices, int num) = 0; 00282 00293 virtual int AddPolygon (int num, ...) = 0; 00294 00305 virtual int AddOutsideBox (const csVector3& bmin, const csVector3& bmax) = 0; 00306 00317 virtual int AddInsideBox (const csVector3& bmin, const csVector3& bmax) = 0; 00318 00325 virtual void SetPolygonName (const csPolygonRange& range, 00326 const char* name) = 0; 00327 00333 virtual const char* GetPolygonName (int polygon_idx) = 0; 00334 00345 virtual csPtr<iPolygonHandle> CreatePolygonHandle (int polygon_idx) = 0; 00346 00353 virtual void SetPolygonMaterial (const csPolygonRange& range, 00354 iMaterialWrapper* material) = 0; 00355 00361 virtual iMaterialWrapper* GetPolygonMaterial (int polygon_idx) = 0; 00362 00369 virtual void AddPolygonVertex (const csPolygonRange& range, 00370 const csVector3& vt) = 0; 00371 00378 virtual void AddPolygonVertex (const csPolygonRange& range, int vt) = 0; 00379 00389 virtual void SetPolygonVertexIndices (const csPolygonRange& range, 00390 int num, int* indices) = 0; 00391 00397 virtual int GetPolygonVertexCount (int polygon_idx) = 0; 00398 00405 virtual const csVector3& GetPolygonVertex (int polygon_idx, 00406 int vertex_idx) = 0; 00407 00413 virtual int* GetPolygonVertexIndices (int polygon_idx) = 0; 00414 00428 virtual bool SetPolygonTextureMapping (const csPolygonRange& range, 00429 const csMatrix3& m, const csVector3& v) = 0; 00430 00442 virtual bool SetPolygonTextureMapping (const csPolygonRange& range, 00443 const csVector2& uv1, const csVector2& uv2, const csVector2& uv3) = 0; 00444 00461 virtual bool SetPolygonTextureMapping (const csPolygonRange& range, 00462 const csVector3& p1, const csVector2& uv1, 00463 const csVector3& p2, const csVector2& uv2, 00464 const csVector3& p3, const csVector2& uv3) = 0; 00465 00484 virtual bool SetPolygonTextureMapping (const csPolygonRange& range, 00485 const csVector3& v_orig, const csVector3& v, float len) = 0; 00486 00507 virtual bool SetPolygonTextureMapping (const csPolygonRange& range, 00508 const csVector3& v_orig, 00509 const csVector3& v1, float len1, 00510 const csVector3& v2, float len2) = 0; 00511 00529 virtual bool SetPolygonTextureMapping (const csPolygonRange& range, 00530 float len) = 0; 00531 00539 virtual void GetPolygonTextureMapping (int polygon_idx, 00540 csMatrix3& m, csVector3& v) = 0; 00541 00549 virtual void SetPolygonTextureMappingEnabled (const csPolygonRange& range, 00550 bool enabled) = 0; 00551 00557 virtual bool IsPolygonTextureMappingEnabled (int polygon_idx) const = 0; 00558 00566 virtual void SetPolygonFlags (const csPolygonRange& range, uint32 flags) = 0; 00567 00578 virtual void SetPolygonFlags (const csPolygonRange& range, uint32 mask, 00579 uint32 flags) = 0; 00580 00588 virtual void ResetPolygonFlags (const csPolygonRange& range, 00589 uint32 flags) = 0; 00590 00596 virtual csFlags& GetPolygonFlags (int polygon_idx) = 0; 00597 00603 virtual const csPlane3& GetPolygonObjectPlane (int polygon_idx) = 0; 00604 00610 virtual bool IsPolygonTransparent (int polygon_idx) = 0; 00611 00619 virtual bool PointOnPolygon (int polygon_idx, const csVector3& v) = 0; 00620 00622 virtual int GetVertexCount () const = 0; 00624 virtual const csVector3 &GetVertex (int idx) const = 0; 00626 virtual const csVector3* GetVertices () const = 0; 00628 virtual int CreateVertex (const csVector3& vt) = 0; 00630 virtual void SetVertex (int idx, const csVector3& vt) = 0; 00636 virtual void DeleteVertex (int idx) = 0; 00644 virtual void DeleteVertices (int from, int to) = 0; 00645 00649 virtual void SetSmoothingFlag (bool smoothing) = 0; 00650 00654 virtual bool GetSmoothingFlag () = 0; 00655 00659 virtual csVector3* GetNormals () = 0; 00660 00664 virtual float GetCosinusFactor () const = 0; 00670 virtual void SetCosinusFactor (float cosfact) = 0; 00671 00672 virtual bool AddPolygonRenderBuffer (int polygon_idx, const char* name, 00673 iRenderBuffer* buffer) = 0; 00674 00686 virtual bool GetLightmapLayout (int polygon_idx, size_t& slm, 00687 csRect& slmSubRect, float* slmCoord) = 0; 00689 }; 00690 00708 struct 00709 CS_DEPRECATED_TYPE_MSG ("iThingState is deprecated. Use genmesh instead (iGeneralMeshState)") 00710 iThingState : public virtual iBase 00711 { 00712 SCF_INTERFACE (iThingState, 1, 0, 2); 00713 00715 virtual const csVector3 &GetVertexW (int idx) const = 0; 00717 virtual const csVector3* GetVerticesW () const = 0; 00718 00722 virtual int GetMovingOption () const = 0; 00723 00749 virtual void SetMovingOption (int opt) = 0; 00750 00759 virtual void Prepare () = 0; 00760 00765 virtual void Unprepare () = 0; 00766 00774 virtual void ReplaceMaterial (iMaterialWrapper* oldmat, 00775 iMaterialWrapper* newmat) = 0; 00776 00781 virtual void ClearReplacedMaterials () = 0; 00782 00784 virtual void SetMixMode (uint mode) = 0; 00786 virtual uint GetMixMode () const = 0; 00787 00797 virtual csPtr<iPolygonHandle> CreatePolygonHandle (int polygon_idx) = 0; 00798 00804 virtual const csPlane3& GetPolygonWorldPlane (int polygon_idx) = 0; 00805 00808 00809 virtual csPtr<iImage> GetPolygonLightmap (int polygon_idx) = 0; 00811 virtual bool GetPolygonPDLight (int polygon_idx, size_t pdlight_index, 00812 csRef<iImage>& map, iLight*& light) = 0; 00818 virtual iMaterialWrapper* GetReplacedMaterial (iMaterialWrapper* oldMat) = 0; 00819 }; 00820 00834 struct 00835 CS_DEPRECATED_TYPE_MSG ("iThingEnvironment is deprecated. Use genmesh instead") 00836 iThingEnvironment : public virtual iBase 00837 { 00838 SCF_INTERFACE (iThingEnvironment, 1, 0, 0); 00839 00843 virtual void Clear () = 0; 00844 00846 virtual int GetLightmapCellSize () const = 0; 00848 virtual void SetLightmapCellSize (int Size) = 0; 00850 virtual int GetDefaultLightmapCellSize () const = 0; 00851 }; 00852 00855 #include "csutil/deprecated_warn_on.h" 00856 00857 #endif // __CS_IMESH_THING_H__
Generated for Crystal Space 1.4.1 by doxygen 1.7.1