imesh/object.h
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 "csgeom/box.h" 00024 #include "ivideo/graph3d.h" 00025 #include "igeom/polymesh.h" 00026 #include "csutil/flags.h" 00027 00028 struct iMeshObject; 00029 struct iMeshObjectFactory; 00030 struct iRenderView; 00031 struct iMovable; 00032 struct iLight; 00033 struct iObjectModel; 00034 struct iMaterialWrapper; 00035 struct iPortal; 00036 struct csRenderMesh; 00037 class csColor; 00038 class csReversibleTransform; 00039 00047 #define CS_MESH_STATICPOS 1 00048 00054 #define CS_MESH_STATICSHAPE 2 00055 00064 #define CS_FACTORY_STATICSHAPE 2 00065 00067 SCF_VERSION (iMeshObjectDrawCallback, 0, 0, 1); 00068 00072 struct iMeshObjectDrawCallback : public iBase 00073 { 00075 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0; 00076 }; 00077 00078 00079 SCF_VERSION (iMeshObject, 0, 3, 0); 00080 00102 struct iMeshObject : public iBase 00103 { 00107 virtual iMeshObjectFactory* GetFactory () const = 0; 00108 00118 virtual csFlags& GetFlags () = 0; 00119 00123 virtual csPtr<iMeshObject> Clone () = 0; 00124 00131 virtual bool DrawTest (iRenderView* rview, iMovable* movable, 00132 uint32 frustum_mask) = 0; 00133 00141 virtual bool Draw (iRenderView* rview, iMovable* movable, 00142 csZBufMode zbufMode) = 0; 00143 00150 virtual csRenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 00151 iMovable* movable, uint32 frustum_mask) = 0; 00152 00160 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0; 00161 00165 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0; 00166 00170 virtual void NextFrame (csTicks current_time,const csVector3& pos) = 0; 00171 00181 virtual void HardTransform (const csReversibleTransform& t) = 0; 00182 00186 virtual bool SupportsHardTransform () const = 0; 00187 00195 virtual bool HitBeamOutline (const csVector3& start, 00196 const csVector3& end, csVector3& isect, float* pr) = 0; 00197 00206 virtual bool HitBeamObject (const csVector3& start, const csVector3& end, 00207 csVector3& isect, float* pr, int* polygon_idx = 0) = 0; 00208 00218 virtual void SetLogicalParent (iBase* logparent) = 0; 00219 00224 virtual iBase* GetLogicalParent () const = 0; 00225 00231 virtual iObjectModel* GetObjectModel () = 0; 00232 00238 virtual bool SetColor (const csColor& color) = 0; 00239 00243 virtual bool GetColor (csColor& color) const = 0; 00244 00249 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0; 00250 00255 virtual iMaterialWrapper* GetMaterialWrapper () const = 0; 00256 00264 virtual void InvalidateMaterialHandles () = 0; 00265 00272 virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0; 00273 }; 00274 00275 SCF_VERSION (iMeshObjectFactory, 0, 0, 6); 00276 00302 struct iMeshObjectFactory : public iBase 00303 { 00312 virtual csFlags& GetFlags () = 0; 00313 00315 virtual csPtr<iMeshObject> NewInstance () = 0; 00316 00320 virtual csPtr<iMeshObjectFactory> Clone () = 0; 00321 00331 virtual void HardTransform (const csReversibleTransform& t) = 0; 00332 00336 virtual bool SupportsHardTransform () const = 0; 00337 00347 virtual void SetLogicalParent (iBase* logparent) = 0; 00348 00353 virtual iBase* GetLogicalParent () const = 0; 00354 00363 virtual iObjectModel* GetObjectModel () = 0; 00364 }; 00365 00366 SCF_VERSION (iMeshObjectType, 0, 0, 2); 00367 00387 struct iMeshObjectType : public iBase 00388 { 00390 virtual csPtr<iMeshObjectFactory> NewFactory () = 0; 00391 }; 00392 00393 #endif // __CS_IMESH_OBJECT_H__
Generated for Crystal Space by doxygen 1.2.18