CrystalSpace

Public API Reference

imesh/object.h
Go to the documentation of this file.
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 "iutil/array.h"
00024 
00033 struct iDecalBuilder;
00034 struct iLight;
00035 struct iMaterialWrapper;
00036 struct iMeshWrapper;
00037 struct iMeshFactoryWrapper;
00038 struct iMeshObject;
00039 struct iMeshObjectFactory;
00040 struct iMeshObjectType;
00041 struct iMovable;
00042 struct iObjectModel;
00043 struct iPortal;
00044 struct iRenderView;
00045 
00046 namespace CS
00047 {
00048   namespace Graphics
00049   {
00050     struct RenderMesh;
00051   }
00052 }
00053 
00054 class csColor;
00055 class csFlags;
00056 class csReversibleTransform;
00057 class csVector3;
00058 
00066 #define CS_MESH_STATICPOS 1
00067 
00073 #define CS_MESH_STATICSHAPE 2
00074 
00083 #define CS_FACTORY_STATICSHAPE 2
00084 
00089 struct iMaterialArray : public iArrayChangeAll<iMaterialWrapper*>
00090 {
00091   SCF_IARRAYCHANGEALL_INTERFACE (iMaterialArray);
00092 };
00093 
00094 
00098 struct iMeshObjectDrawCallback : virtual public iBase
00099 {
00100   SCF_INTERFACE (iMeshObjectDrawCallback, 0, 0, 1);
00101 
00103   virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0;
00104 };
00105 
00106 
00125 struct iMeshObject : public virtual iBase
00126 {
00127   SCF_INTERFACE(iMeshObject, 4,0,0);
00131   virtual iMeshObjectFactory* GetFactory () const = 0;
00132 
00141   virtual csFlags& GetFlags () = 0;
00142 
00146   virtual csPtr<iMeshObject> Clone () = 0;
00147 
00154   virtual CS::Graphics::RenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 
00155     iMovable* movable, uint32 frustum_mask) = 0;
00156 
00164   virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0;
00165 
00169   virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0;
00170 
00174   virtual void NextFrame (csTicks current_time,const csVector3& pos,
00175     uint currentFrame) = 0;
00176 
00186   virtual void HardTransform (const csReversibleTransform& t) = 0;
00187 
00191   virtual bool SupportsHardTransform () const = 0;
00192 
00205   virtual bool HitBeamOutline (const csVector3& start,
00206         const csVector3& end, csVector3& isect, float* pr) = 0;
00207 
00225   virtual bool HitBeamObject (const csVector3& start, const csVector3& end,
00226         csVector3& isect, float* pr, int* polygon_idx = 0,
00227         iMaterialWrapper** material = 0) = 0;
00228 
00235   virtual void SetMeshWrapper (iMeshWrapper* logparent) = 0;
00236 
00241   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00242 
00248   virtual iObjectModel* GetObjectModel () = 0;
00249 
00255   virtual bool SetColor (const csColor& color) = 0;
00256 
00260   virtual bool GetColor (csColor& color) const = 0;
00261 
00266   virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00267 
00272   virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00273 
00275   virtual void SetMixMode (uint mode) = 0;
00277   virtual uint GetMixMode () const = 0;
00278 
00285   virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0;
00286 
00292   virtual void BuildDecal(const csVector3* pos, float decalRadius,
00293         iDecalBuilder* decalBuilder) = 0;
00294 };
00295 
00318 struct iMeshObjectFactory : public virtual iBase
00319 {
00320   SCF_INTERFACE(iMeshObjectFactory, 2, 0, 0);
00321 
00329   virtual csFlags& GetFlags () = 0;
00330 
00332   virtual csPtr<iMeshObject> NewInstance () = 0;
00333 
00337   virtual csPtr<iMeshObjectFactory> Clone () = 0;
00338 
00348   virtual void HardTransform (const csReversibleTransform& t) = 0;
00349 
00353   virtual bool SupportsHardTransform () const = 0;
00354 
00362   virtual void SetMeshFactoryWrapper (iMeshFactoryWrapper* logparent) = 0;
00363 
00368   virtual iMeshFactoryWrapper* GetMeshFactoryWrapper () const = 0;
00369 
00373   virtual iMeshObjectType* GetMeshObjectType () const = 0;
00374 
00383   virtual iObjectModel* GetObjectModel () = 0;
00384 
00389   virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00390 
00395   virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00396 
00398   virtual void SetMixMode (uint mode) = 0;
00400   virtual uint GetMixMode () const = 0;
00401 };
00402 
00403 
00420 struct iMeshObjectType : public virtual iBase
00421 {
00422   SCF_INTERFACE(iMeshObjectType, 2,0,0);
00424   virtual csPtr<iMeshObjectFactory> NewFactory () = 0;
00425 };
00426 
00429 #endif // __CS_IMESH_OBJECT_H__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1