CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 
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 struct csRenderMesh;
00036 class csColor;
00037 class csReversibleTransform;
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, 1);
00052 
00060 struct iMeshObject : public iBase
00061 {
00065   virtual iMeshObjectFactory* GetFactory () const = 0;
00066 
00073   virtual bool DrawTest (iRenderView* rview, iMovable* movable) = 0;
00074 
00082   virtual bool Draw (iRenderView* rview, iMovable* movable,
00083         csZBufMode zbufMode) = 0;
00084 
00088   virtual csRenderMesh** GetRenderMeshes (int& num) = 0;
00089 
00090   /* For NR: @@@ document me!!!
00091   virtual bool DrawShadow (iRenderView* rview, iMovable* movable,
00092         csZBufMode zbufMode, iLight *light) = 0;
00093 
00094   virtual bool DrawLight (iRenderView* rview, iMovable* movable,
00095         csZBufMode zbufMode, iLight *light) = 0;
00096   */
00097 
00105   virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0;
00106 
00110   virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0;
00111 
00115   virtual void NextFrame (csTicks current_time,const csVector3& pos) = 0;
00116 
00126   virtual void HardTransform (const csReversibleTransform& t) = 0;
00127 
00131   virtual bool SupportsHardTransform () const = 0;
00132 
00140   virtual bool HitBeamOutline (const csVector3& start,
00141         const csVector3& end, csVector3& isect, float* pr) = 0;
00142 
00151   virtual bool HitBeamObject (const csVector3& start, const csVector3& end,
00152         csVector3& isect, float* pr, int* polygon_idx = 0) = 0;
00153 
00163   virtual void SetLogicalParent (iBase* logparent) = 0;
00164 
00169   virtual iBase* GetLogicalParent () const = 0;
00170 
00176   virtual iObjectModel* GetObjectModel () = 0;
00177 
00183   virtual bool SetColor (const csColor& color) = 0;
00184 
00188   virtual bool GetColor (csColor& color) const = 0;
00189 
00194   virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00195 
00200   virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00201 
00209   virtual void InvalidateMaterialHandles () = 0;
00210 
00217   virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0;
00218 };
00219 
00220 SCF_VERSION (iMeshObjectFactory, 0, 0, 6);
00221 
00232 struct iMeshObjectFactory : public iBase
00233 {
00235   virtual csPtr<iMeshObject> NewInstance () = 0;
00236 
00246   virtual void HardTransform (const csReversibleTransform& t) = 0;
00247 
00251   virtual bool SupportsHardTransform () const = 0;
00252 
00262   virtual void SetLogicalParent (iBase* logparent) = 0;
00263 
00268   virtual iBase* GetLogicalParent () const = 0;
00269 
00278   virtual iObjectModel* GetObjectModel () = 0;
00279 };
00280 
00281 SCF_VERSION (iMeshObjectType, 0, 0, 2);
00282 
00288 struct iMeshObjectType : public iBase
00289 {
00291   virtual csPtr<iMeshObjectFactory> NewFactory () = 0;
00292 };
00293 
00294 #endif // __CS_IMESH_OBJECT_H__
00295 

Generated for Crystal Space by doxygen 1.2.18