![]()
|
object.h00001 /* 00002 Copyright (C) 2000-2001 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 __IMESH_OBJECT_H__ 00020 #define __IMESH_OBJECT_H__ 00021 00022 #include "csutil/scf.h" 00023 #include "csgeom/box.h" 00024 #include "ivideo/graph3d.h" 00025 00026 struct iMeshObject; 00027 struct iMeshObjectFactory; 00028 struct iRenderView; 00029 struct iMovable; 00030 struct iLight; 00031 class csReversibleTransform; 00032 00038 #define CS_BBOX_NORMAL 0 00039 00044 #define CS_BBOX_ACCURATE 1 00045 00051 #define CS_BBOX_MAX 2 00052 00053 SCF_VERSION (iMeshObjectDrawCallback, 0, 0, 1); 00054 00058 struct iMeshObjectDrawCallback : public iBase 00059 { 00061 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0; 00062 }; 00063 00064 00065 SCF_VERSION (iMeshObject, 0, 0, 21); 00066 00074 struct iMeshObject : public iBase 00075 { 00079 virtual iMeshObjectFactory* GetFactory () const = 0; 00080 00088 virtual bool DrawTest (iRenderView* rview, iMovable* movable) = 0; 00089 00093 virtual void UpdateLighting (iLight** lights, int num_lights, 00094 iMovable* movable) = 0; 00095 00103 virtual bool Draw (iRenderView* rview, iMovable* movable, 00104 csZBufMode zbufMode) = 0; 00105 00113 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0; 00114 00118 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0; 00119 00136 virtual void GetObjectBoundingBox (csBox3& bbox, int type = CS_BBOX_NORMAL)=0; 00137 00141 virtual void GetRadius ( csVector3& radius, csVector3& center) = 0; 00142 00146 virtual void NextFrame (csTicks current_time) = 0; 00147 00154 virtual bool WantToDie () const = 0; 00155 00165 virtual void HardTransform (const csReversibleTransform& t) = 0; 00166 00170 virtual bool SupportsHardTransform () const = 0; 00171 00179 virtual bool HitBeamOutline (const csVector3& start, 00180 const csVector3& end, csVector3& isect, float* pr) = 0; 00181 00189 virtual bool HitBeamObject (const csVector3& start, const csVector3& end, 00190 csVector3& isect, float* pr) = 0; 00191 00198 virtual long GetShapeNumber () const = 0; 00199 00209 virtual void SetLogicalParent (iBase* logparent) = 0; 00210 00215 virtual iBase* GetLogicalParent () const = 0; 00216 }; 00217 00218 SCF_VERSION (iMeshObjectFactory, 0, 0, 5); 00219 00230 struct iMeshObjectFactory : public iBase 00231 { 00233 virtual iMeshObject* NewInstance () = 0; 00234 00244 virtual void HardTransform (const csReversibleTransform& t) = 0; 00245 00249 virtual bool SupportsHardTransform () const = 0; 00250 00260 virtual void SetLogicalParent (iBase* logparent) = 0; 00261 00266 virtual iBase* GetLogicalParent () const = 0; 00267 }; 00268 00269 SCF_VERSION (iMeshObjectType, 0, 0, 2); 00270 00276 struct iMeshObjectType : public iBase 00277 { 00279 virtual iMeshObjectFactory* NewFactory () = 0; 00280 }; 00281 00282 #endif // __IMESH_OBJECT_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |