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 00032 struct iDecalBuilder; 00033 struct iLight; 00034 struct iMaterialWrapper; 00035 struct iMeshWrapper; 00036 struct iMeshFactoryWrapper; 00037 struct iMeshObject; 00038 struct iMeshObjectFactory; 00039 struct iMeshObjectType; 00040 struct iMovable; 00041 struct iObjectModel; 00042 struct iPortal; 00043 struct iRenderView; 00044 00045 namespace CS 00046 { 00047 namespace Graphics 00048 { 00049 struct RenderMesh; 00050 } 00051 } 00052 00053 class csColor; 00054 class csFlags; 00055 class csReversibleTransform; 00056 class csVector3; 00057 00065 #define CS_MESH_STATICPOS 1 00066 00072 #define CS_MESH_STATICSHAPE 2 00073 00082 #define CS_FACTORY_STATICSHAPE 2 00083 00088 struct iMeshObjectDrawCallback : virtual public iBase 00089 { 00090 SCF_INTERFACE (iMeshObjectDrawCallback, 0, 0, 1); 00091 00093 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0; 00094 }; 00095 00096 00115 struct iMeshObject : public virtual iBase 00116 { 00117 SCF_INTERFACE(iMeshObject, 2,1,0); 00121 virtual iMeshObjectFactory* GetFactory () const = 0; 00122 00131 virtual csFlags& GetFlags () = 0; 00132 00136 virtual csPtr<iMeshObject> Clone () = 0; 00137 00144 virtual CS::Graphics::RenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 00145 iMovable* movable, uint32 frustum_mask) = 0; 00146 00154 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0; 00155 00159 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0; 00160 00164 virtual void NextFrame (csTicks current_time,const csVector3& pos, 00165 uint currentFrame) = 0; 00166 00176 virtual void HardTransform (const csReversibleTransform& t) = 0; 00177 00181 virtual bool SupportsHardTransform () const = 0; 00182 00190 virtual bool HitBeamOutline (const csVector3& start, 00191 const csVector3& end, csVector3& isect, float* pr) = 0; 00192 00210 virtual bool HitBeamObject (const csVector3& start, const csVector3& end, 00211 csVector3& isect, float* pr, int* polygon_idx = 0, 00212 iMaterialWrapper** material = 0) = 0; 00213 00220 virtual void SetMeshWrapper (iMeshWrapper* logparent) = 0; 00221 00226 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00227 00233 virtual iObjectModel* GetObjectModel () = 0; 00234 00240 virtual bool SetColor (const csColor& color) = 0; 00241 00245 virtual bool GetColor (csColor& color) const = 0; 00246 00251 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00252 00257 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00258 00260 virtual void SetMixMode (uint mode) = 0; 00262 virtual uint GetMixMode () const = 0; 00263 00272 CS_DEPRECATED_METHOD_MSG("Obsolete and unused.") 00273 virtual void InvalidateMaterialHandles () = 0; 00274 00281 virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0; 00282 00288 virtual void BuildDecal(const csVector3* pos, float decalRadius, 00289 iDecalBuilder* decalBuilder) = 0; 00290 }; 00291 00314 struct iMeshObjectFactory : public virtual iBase 00315 { 00316 SCF_INTERFACE(iMeshObjectFactory, 2, 0, 0); 00317 00325 virtual csFlags& GetFlags () = 0; 00326 00328 virtual csPtr<iMeshObject> NewInstance () = 0; 00329 00333 virtual csPtr<iMeshObjectFactory> Clone () = 0; 00334 00344 virtual void HardTransform (const csReversibleTransform& t) = 0; 00345 00349 virtual bool SupportsHardTransform () const = 0; 00350 00358 virtual void SetMeshFactoryWrapper (iMeshFactoryWrapper* logparent) = 0; 00359 00364 virtual iMeshFactoryWrapper* GetMeshFactoryWrapper () const = 0; 00365 00369 virtual iMeshObjectType* GetMeshObjectType () const = 0; 00370 00379 virtual iObjectModel* GetObjectModel () = 0; 00380 00385 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00386 00391 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00392 00394 virtual void SetMixMode (uint mode) = 0; 00396 virtual uint GetMixMode () const = 0; 00397 }; 00398 00399 00416 struct iMeshObjectType : public virtual iBase 00417 { 00418 SCF_INTERFACE(iMeshObjectType, 2,0,0); 00420 virtual csPtr<iMeshObjectFactory> NewFactory () = 0; 00421 }; 00422 00425 #endif // __CS_IMESH_OBJECT_H__
Generated for Crystal Space 1.4.1 by doxygen 1.7.1