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 class csColor;
00035 class csReversibleTransform;
00036
00037 SCF_VERSION (iMeshObjectDrawCallback, 0, 0, 1);
00038
00042 struct iMeshObjectDrawCallback : public iBase
00043 {
00045 virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0;
00046 };
00047
00048
00049 SCF_VERSION (iMeshObject, 0, 1, 1);
00050
00058 struct iMeshObject : public iBase
00059 {
00063 virtual iMeshObjectFactory* GetFactory () const = 0;
00064
00072 virtual bool DrawTest (iRenderView* rview, iMovable* movable) = 0;
00073
00074 #ifdef CS_USE_NEW_RENDERER
00075
00076
00077
00078 #endif
00079
00083 virtual void UpdateLighting (iLight** lights, int num_lights,
00084 iMovable* movable) = 0;
00085
00093 virtual bool Draw (iRenderView* rview, iMovable* movable,
00094 csZBufMode zbufMode) = 0;
00095
00096 #ifdef CS_USE_NEW_RENDERER
00097 virtual csRenderMesh *GetRenderMesh (iRenderView* rview, iMovable* movable,
00098 csZBufMode zbufMode) = 0;
00099
00100
00101
00102
00103
00104
00105
00106
00107 #endif // CS_USE_NEW_RENDERER
00108
00116 virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0;
00117
00121 virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0;
00122
00126 virtual void NextFrame (csTicks current_time,const csVector3& pos) = 0;
00127
00137 virtual void HardTransform (const csReversibleTransform& t) = 0;
00138
00142 virtual bool SupportsHardTransform () const = 0;
00143
00151 virtual bool HitBeamOutline (const csVector3& start,
00152 const csVector3& end, csVector3& isect, float* pr) = 0;
00153
00161 virtual bool HitBeamObject (const csVector3& start, const csVector3& end,
00162 csVector3& isect, float* pr) = 0;
00163
00173 virtual void SetLogicalParent (iBase* logparent) = 0;
00174
00179 virtual iBase* GetLogicalParent () const = 0;
00180
00186 virtual iObjectModel* GetObjectModel () = 0;
00187
00193 virtual bool SetColor (const csColor& color) = 0;
00194
00198 virtual bool GetColor (csColor& color) const = 0;
00199
00204 virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00205
00210 virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00211 };
00212
00213 SCF_VERSION (iMeshObjectFactory, 0, 0, 6);
00214
00225 struct iMeshObjectFactory : public iBase
00226 {
00228 virtual csPtr<iMeshObject> NewInstance () = 0;
00229
00239 virtual void HardTransform (const csReversibleTransform& t) = 0;
00240
00244 virtual bool SupportsHardTransform () const = 0;
00245
00255 virtual void SetLogicalParent (iBase* logparent) = 0;
00256
00261 virtual iBase* GetLogicalParent () const = 0;
00262
00271 virtual iObjectModel* GetObjectModel () = 0;
00272 };
00273
00274 SCF_VERSION (iMeshObjectType, 0, 0, 2);
00275
00281 struct iMeshObjectType : public iBase
00282 {
00284 virtual csPtr<iMeshObjectFactory> NewFactory () = 0;
00285 };
00286
00287 #endif // __CS_IMESH_OBJECT_H__
00288