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 iLight; 00033 struct iMaterialWrapper; 00034 struct iMeshWrapper; 00035 struct iMeshFactoryWrapper; 00036 struct iMeshObject; 00037 struct iMeshObjectFactory; 00038 struct iMeshObjectType; 00039 struct iMovable; 00040 struct iObjectModel; 00041 struct iPortal; 00042 struct iRenderView; 00043 00044 struct csRenderMesh; 00045 00046 class csColor; 00047 class csFlags; 00048 class csReversibleTransform; 00049 class csVector3; 00050 00058 #define CS_MESH_STATICPOS 1 00059 00065 #define CS_MESH_STATICSHAPE 2 00066 00075 #define CS_FACTORY_STATICSHAPE 2 00076 00078 SCF_VERSION (iMeshObjectDrawCallback, 0, 0, 1); 00079 00083 struct iMeshObjectDrawCallback : public iBase 00084 { 00086 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0; 00087 }; 00088 00089 00108 struct iMeshObject : public virtual iBase 00109 { 00110 SCF_INTERFACE(iMeshObject, 2,0,0); 00114 virtual iMeshObjectFactory* GetFactory () const = 0; 00115 00124 virtual csFlags& GetFlags () = 0; 00125 00129 virtual csPtr<iMeshObject> Clone () = 0; 00130 00137 virtual csRenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 00138 iMovable* movable, uint32 frustum_mask) = 0; 00139 00147 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0; 00148 00152 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0; 00153 00157 virtual void NextFrame (csTicks current_time,const csVector3& pos) = 0; 00158 00168 virtual void HardTransform (const csReversibleTransform& t) = 0; 00169 00173 virtual bool SupportsHardTransform () const = 0; 00174 00182 virtual bool HitBeamOutline (const csVector3& start, 00183 const csVector3& end, csVector3& isect, float* pr) = 0; 00184 00202 virtual bool HitBeamObject (const csVector3& start, const csVector3& end, 00203 csVector3& isect, float* pr, int* polygon_idx = 0, 00204 iMaterialWrapper** material = 0) = 0; 00205 00212 virtual void SetMeshWrapper (iMeshWrapper* logparent) = 0; 00213 00218 virtual iMeshWrapper* GetMeshWrapper () const = 0; 00219 00225 virtual iObjectModel* GetObjectModel () = 0; 00226 00232 virtual bool SetColor (const csColor& color) = 0; 00233 00237 virtual bool GetColor (csColor& color) const = 0; 00238 00243 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00244 00249 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00250 00252 virtual void SetMixMode (uint mode) = 0; 00254 virtual uint GetMixMode () const = 0; 00255 00263 virtual void InvalidateMaterialHandles () = 0; 00264 00271 virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0; 00272 }; 00273 00296 struct iMeshObjectFactory : public virtual iBase 00297 { 00298 SCF_INTERFACE(iMeshObjectFactory, 2, 0, 0); 00299 00307 virtual csFlags& GetFlags () = 0; 00308 00310 virtual csPtr<iMeshObject> NewInstance () = 0; 00311 00315 virtual csPtr<iMeshObjectFactory> Clone () = 0; 00316 00326 virtual void HardTransform (const csReversibleTransform& t) = 0; 00327 00331 virtual bool SupportsHardTransform () const = 0; 00332 00340 virtual void SetMeshFactoryWrapper (iMeshFactoryWrapper* logparent) = 0; 00341 00346 virtual iMeshFactoryWrapper* GetMeshFactoryWrapper () const = 0; 00347 00351 virtual iMeshObjectType* GetMeshObjectType () const = 0; 00352 00361 virtual iObjectModel* GetObjectModel () = 0; 00362 }; 00363 00364 00381 struct iMeshObjectType : public virtual iBase 00382 { 00383 SCF_INTERFACE(iMeshObjectType, 2,0,0); 00385 virtual csPtr<iMeshObjectFactory> NewFactory () = 0; 00386 }; 00387 00390 #endif // __CS_IMESH_OBJECT_H__
Generated for Crystal Space by doxygen 1.4.6