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 struct csRenderMesh; 00046 00047 class csColor; 00048 class csFlags; 00049 class csReversibleTransform; 00050 class csVector3; 00051 00059 #define CS_MESH_STATICPOS 1 00060 00066 #define CS_MESH_STATICSHAPE 2 00067 00076 #define CS_FACTORY_STATICSHAPE 2 00077 00082 struct iMeshObjectDrawCallback : virtual public iBase 00083 { 00084 SCF_INTERFACE (iMeshObjectDrawCallback, 0, 0, 1); 00085 00087 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0; 00088 }; 00089 00090 00109 struct iMeshObject : public virtual iBase 00110 { 00111 SCF_INTERFACE(iMeshObject, 2,1,0); 00115 virtual iMeshObjectFactory* GetFactory () const = 0; 00116 00125 virtual csFlags& GetFlags () = 0; 00126 00130 virtual csPtr<iMeshObject> Clone () = 0; 00131 00138 virtual csRenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 00139 iMovable* movable, uint32 frustum_mask) = 0; 00140 00148 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0; 00149 00153 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0; 00154 00158 virtual void NextFrame (csTicks current_time,const csVector3& pos, 00159 uint currentFrame) = 0; 00160 00170 virtual void HardTransform (const csReversibleTransform& t) = 0; 00171 00175 virtual bool SupportsHardTransform () const = 0; 00176 00184 virtual bool HitBeamOutline (const csVector3& start, 00185 const csVector3& end, csVector3& isect, float* pr) = 0; 00186 00204 virtual bool HitBeamObject (const csVector3& start, const csVector3& end, 00205 csVector3& isect, float* pr, int* polygon_idx = 0, 00206 iMaterialWrapper** material = 0) = 0; 00207 00214 virtual void SetMeshWrapper (iMeshWrapper* logparent) = 0; 00215 00220 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00221 00227 virtual iObjectModel* GetObjectModel () = 0; 00228 00234 virtual bool SetColor (const csColor& color) = 0; 00235 00239 virtual bool GetColor (csColor& color) const = 0; 00240 00245 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00246 00251 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00252 00254 virtual void SetMixMode (uint mode) = 0; 00256 virtual uint GetMixMode () const = 0; 00257 00265 virtual void InvalidateMaterialHandles () = 0; 00266 00273 virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0; 00274 00280 virtual void BuildDecal(const csVector3* pos, float decalRadius, 00281 iDecalBuilder* decalBuilder) = 0; 00282 }; 00283 00306 struct iMeshObjectFactory : public virtual iBase 00307 { 00308 SCF_INTERFACE(iMeshObjectFactory, 2, 0, 0); 00309 00317 virtual csFlags& GetFlags () = 0; 00318 00320 virtual csPtr<iMeshObject> NewInstance () = 0; 00321 00325 virtual csPtr<iMeshObjectFactory> Clone () = 0; 00326 00336 virtual void HardTransform (const csReversibleTransform& t) = 0; 00337 00341 virtual bool SupportsHardTransform () const = 0; 00342 00350 virtual void SetMeshFactoryWrapper (iMeshFactoryWrapper* logparent) = 0; 00351 00356 virtual iMeshFactoryWrapper* GetMeshFactoryWrapper () const = 0; 00357 00361 virtual iMeshObjectType* GetMeshObjectType () const = 0; 00362 00371 virtual iObjectModel* GetObjectModel () = 0; 00372 00377 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00378 00383 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00384 00386 virtual void SetMixMode (uint mode) = 0; 00388 virtual uint GetMixMode () const = 0; 00389 }; 00390 00391 00408 struct iMeshObjectType : public virtual iBase 00409 { 00410 SCF_INTERFACE(iMeshObjectType, 2,0,0); 00412 virtual csPtr<iMeshObjectFactory> NewFactory () = 0; 00413 }; 00414 00417 #endif // __CS_IMESH_OBJECT_H__
Generated for Crystal Space 1.2 by doxygen 1.4.7