CrystalSpace

Public API Reference

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

object.h

00001 /*
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 __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   // virtual void EnableShadowCaps () = 0;
00077   // virtual void DisableShadowCaps () = 0;
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   virtual bool DrawShadow (iRenderView* rview, iMovable* movable,
00102         csZBufMode zbufMode, iLight *light) = 0;
00103 
00104   virtual bool DrawLight (iRenderView* rview, iMovable* movable,
00105         csZBufMode zbufMode, iLight *light) = 0;
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 

Generated for Crystal Space by doxygen 1.2.14