00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
00026 struct iMeshObject;
00027 struct iMeshObjectFactory;
00028 struct iRenderView;
00029 struct iMovable;
00030 struct iLight;
00031 struct iPolygonMesh;
00032 struct iObjectModel;
00033 struct iMaterialWrapper;
00034 struct iPortal;
00035 class csColor;
00036 class csReversibleTransform;
00037 class csRenderMesh;
00038
00039 SCF_VERSION (iMeshObjectDrawCallback, 0, 0, 1);
00040
00044 struct iMeshObjectDrawCallback : public iBase
00045 {
00047 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0;
00048 };
00049
00050
00051 SCF_VERSION (iMeshObject, 0, 2, 0);
00052
00060 struct iMeshObject : public iBase
00061 {
00065 virtual iMeshObjectFactory* GetFactory () const = 0;
00066
00074 virtual bool DrawTest (iRenderView* rview, iMovable* movable) = 0;
00075
00076
00078
00079
00080
00084 virtual void UpdateLighting (iLight** lights, int num_lights,
00085 iMovable* movable) = 0;
00086
00094 virtual bool Draw (iRenderView* rview, iMovable* movable,
00095 csZBufMode zbufMode) = 0;
00096
00100 virtual csRenderMesh** GetRenderMeshes (int& num) = 0;
00101
00102
00103
00104
00105
00106
00107
00108
00109
00117 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0;
00118
00122 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0;
00123
00127 virtual void NextFrame (csTicks current_time,const csVector3& pos) = 0;
00128
00138 virtual void HardTransform (const csReversibleTransform& t) = 0;
00139
00143 virtual bool SupportsHardTransform () const = 0;
00144
00152 virtual bool HitBeamOutline (const csVector3& start,
00153 const csVector3& end, csVector3& isect, float* pr) = 0;
00154
00162 virtual bool HitBeamObject (const csVector3& start, const csVector3& end,
00163 csVector3& isect, float* pr) = 0;
00164
00174 virtual void SetLogicalParent (iBase* logparent) = 0;
00175
00180 virtual iBase* GetLogicalParent () const = 0;
00181
00187 virtual iObjectModel* GetObjectModel () = 0;
00188
00194 virtual bool SetColor (const csColor& color) = 0;
00195
00199 virtual bool GetColor (csColor& color) const = 0;
00200
00205 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00206
00211 virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00212
00220 virtual void InvalidateMaterialHandles () = 0;
00221
00225 virtual int GetPortalCount () const = 0;
00227 virtual iPortal* GetPortal (int idx) const = 0;
00228 };
00229
00230 SCF_VERSION (iMeshObjectFactory, 0, 0, 6);
00231
00242 struct iMeshObjectFactory : public iBase
00243 {
00245 virtual csPtr<iMeshObject> NewInstance () = 0;
00246
00256 virtual void HardTransform (const csReversibleTransform& t) = 0;
00257
00261 virtual bool SupportsHardTransform () const = 0;
00262
00272 virtual void SetLogicalParent (iBase* logparent) = 0;
00273
00278 virtual iBase* GetLogicalParent () const = 0;
00279
00288 virtual iObjectModel* GetObjectModel () = 0;
00289 };
00290
00291 SCF_VERSION (iMeshObjectType, 0, 0, 2);
00292
00298 struct iMeshObjectType : public iBase
00299 {
00301 virtual csPtr<iMeshObjectFactory> NewFactory () = 0;
00302 };
00303
00304 #endif // __CS_IMESH_OBJECT_H__
00305