imesh/object.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2000-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_OBJECT_H__ 00020 #define __CS_IMESH_OBJECT_H__ 00021 00022 #include "csutil/scf.h" 00023 #include "iutil/array.h" 00024 00033 struct iDecalBuilder; 00034 struct iLight; 00035 struct iMaterialWrapper; 00036 struct iMeshWrapper; 00037 struct iMeshFactoryWrapper; 00038 struct iMeshObject; 00039 struct iMeshObjectFactory; 00040 struct iMeshObjectType; 00041 struct iMovable; 00042 struct iObjectModel; 00043 struct iPortal; 00044 struct iRenderView; 00045 00046 namespace CS 00047 { 00048 namespace Graphics 00049 { 00050 struct RenderMesh; 00051 } 00052 } 00053 00054 class csColor; 00055 class csFlags; 00056 class csReversibleTransform; 00057 class csVector3; 00058 00066 #define CS_MESH_STATICPOS 1 00067 00073 #define CS_MESH_STATICSHAPE 2 00074 00083 #define CS_FACTORY_STATICSHAPE 2 00084 00089 struct iMaterialArray : public iArrayChangeAll<iMaterialWrapper*> 00090 { 00091 SCF_IARRAYCHANGEALL_INTERFACE (iMaterialArray); 00092 }; 00093 00094 00098 struct iMeshObjectDrawCallback : virtual public iBase 00099 { 00100 SCF_INTERFACE (iMeshObjectDrawCallback, 0, 0, 1); 00101 00103 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0; 00104 }; 00105 00106 00125 struct iMeshObject : public virtual iBase 00126 { 00127 SCF_INTERFACE(iMeshObject, 4,0,0); 00131 virtual iMeshObjectFactory* GetFactory () const = 0; 00132 00141 virtual csFlags& GetFlags () = 0; 00142 00146 virtual csPtr<iMeshObject> Clone () = 0; 00147 00154 virtual CS::Graphics::RenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 00155 iMovable* movable, uint32 frustum_mask) = 0; 00156 00164 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0; 00165 00169 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0; 00170 00174 virtual void NextFrame (csTicks current_time,const csVector3& pos, 00175 uint currentFrame) = 0; 00176 00186 virtual void HardTransform (const csReversibleTransform& t) = 0; 00187 00191 virtual bool SupportsHardTransform () const = 0; 00192 00205 virtual bool HitBeamOutline (const csVector3& start, 00206 const csVector3& end, csVector3& isect, float* pr) = 0; 00207 00226 virtual bool HitBeamObject (const csVector3& start, const csVector3& end, 00227 csVector3& isect, float* pr, int* polygon_idx = 0, 00228 iMaterialWrapper** material = 0, bool bf = false) = 0; 00229 00236 virtual void SetMeshWrapper (iMeshWrapper* logparent) = 0; 00237 00242 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00243 00249 virtual iObjectModel* GetObjectModel () = 0; 00250 00256 virtual bool SetColor (const csColor& color) = 0; 00257 00261 virtual bool GetColor (csColor& color) const = 0; 00262 00267 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00268 00273 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00274 00276 virtual void SetMixMode (uint mode) = 0; 00278 virtual uint GetMixMode () const = 0; 00279 00286 virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0; 00287 00293 virtual void BuildDecal(const csVector3* pos, float decalRadius, 00294 iDecalBuilder* decalBuilder) = 0; 00295 }; 00296 00319 struct iMeshObjectFactory : public virtual iBase 00320 { 00321 SCF_INTERFACE(iMeshObjectFactory, 2, 0, 0); 00322 00330 virtual csFlags& GetFlags () = 0; 00331 00333 virtual csPtr<iMeshObject> NewInstance () = 0; 00334 00338 virtual csPtr<iMeshObjectFactory> Clone () = 0; 00339 00349 virtual void HardTransform (const csReversibleTransform& t) = 0; 00350 00354 virtual bool SupportsHardTransform () const = 0; 00355 00363 virtual void SetMeshFactoryWrapper (iMeshFactoryWrapper* logparent) = 0; 00364 00369 virtual iMeshFactoryWrapper* GetMeshFactoryWrapper () const = 0; 00370 00374 virtual iMeshObjectType* GetMeshObjectType () const = 0; 00375 00384 virtual iObjectModel* GetObjectModel () = 0; 00385 00390 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00391 00396 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00397 00399 virtual void SetMixMode (uint mode) = 0; 00401 virtual uint GetMixMode () const = 0; 00402 }; 00403 00404 00421 struct iMeshObjectType : public virtual iBase 00422 { 00423 SCF_INTERFACE(iMeshObjectType, 2,0,0); 00425 virtual csPtr<iMeshObjectFactory> NewFactory () = 0; 00426 }; 00427 00430 #endif // __CS_IMESH_OBJECT_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
