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 
00032 struct iLight;
00033 struct iMaterialWrapper;
00034 struct iMeshWrapper;
00035 struct iMeshFactoryWrapper;
00036 struct iMeshObject;
00037 struct iMeshObjectFactory;
00038 struct iMeshObjectType;
00039 struct iMovable;
00040 struct iObjectModel;
00041 struct iPortal;
00042 struct iRenderView;
00043 
00044 struct csRenderMesh;
00045 
00046 class csColor;
00047 class csFlags;
00048 class csReversibleTransform;
00049 class csVector3;
00050 
00058 #define CS_MESH_STATICPOS 1
00059 
00065 #define CS_MESH_STATICSHAPE 2
00066 
00075 #define CS_FACTORY_STATICSHAPE 2
00076 
00078 SCF_VERSION (iMeshObjectDrawCallback, 0, 0, 1);
00079 
00083 struct iMeshObjectDrawCallback : public iBase
00084 {
00086   virtual bool BeforeDrawing (iMeshObject* spr, iRenderView* rview) = 0;
00087 };
00088 
00089 
00108 struct iMeshObject : public virtual iBase
00109 {
00110   SCF_INTERFACE(iMeshObject, 2,0,0);
00114   virtual iMeshObjectFactory* GetFactory () const = 0;
00115 
00124   virtual csFlags& GetFlags () = 0;
00125 
00129   virtual csPtr<iMeshObject> Clone () = 0;
00130 
00137   virtual csRenderMesh** GetRenderMeshes (int& num, iRenderView* rview, 
00138     iMovable* movable, uint32 frustum_mask) = 0;
00139 
00147   virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0;
00148 
00152   virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0;
00153 
00157   virtual void NextFrame (csTicks current_time,const csVector3& pos,
00158     uint currentFrame) = 0;
00159 
00169   virtual void HardTransform (const csReversibleTransform& t) = 0;
00170 
00174   virtual bool SupportsHardTransform () const = 0;
00175 
00183   virtual bool HitBeamOutline (const csVector3& start,
00184         const csVector3& end, csVector3& isect, float* pr) = 0;
00185 
00203   virtual bool HitBeamObject (const csVector3& start, const csVector3& end,
00204         csVector3& isect, float* pr, int* polygon_idx = 0,
00205         iMaterialWrapper** material = 0) = 0;
00206 
00213   virtual void SetMeshWrapper (iMeshWrapper* logparent) = 0;
00214 
00219   virtual iMeshWrapper* GetMeshWrapper () const = 0;
00220 
00226   virtual iObjectModel* GetObjectModel () = 0;
00227 
00233   virtual bool SetColor (const csColor& color) = 0;
00234 
00238   virtual bool GetColor (csColor& color) const = 0;
00239 
00244   virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00245 
00250   virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00251 
00253   virtual void SetMixMode (uint mode) = 0;
00255   virtual uint GetMixMode () const = 0;
00256 
00264   virtual void InvalidateMaterialHandles () = 0;
00265 
00272   virtual void PositionChild (iMeshObject* child,csTicks current_time) = 0;
00273 };
00274 
00297 struct iMeshObjectFactory : public virtual iBase
00298 {
00299   SCF_INTERFACE(iMeshObjectFactory, 2, 0, 0);
00300 
00308   virtual csFlags& GetFlags () = 0;
00309 
00311   virtual csPtr<iMeshObject> NewInstance () = 0;
00312 
00316   virtual csPtr<iMeshObjectFactory> Clone () = 0;
00317 
00327   virtual void HardTransform (const csReversibleTransform& t) = 0;
00328 
00332   virtual bool SupportsHardTransform () const = 0;
00333 
00341   virtual void SetMeshFactoryWrapper (iMeshFactoryWrapper* logparent) = 0;
00342 
00347   virtual iMeshFactoryWrapper* GetMeshFactoryWrapper () const = 0;
00348 
00352   virtual iMeshObjectType* GetMeshObjectType () const = 0;
00353 
00362   virtual iObjectModel* GetObjectModel () = 0;
00363 
00368   virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00369 
00374   virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00375 
00377   virtual void SetMixMode (uint mode) = 0;
00379   virtual uint GetMixMode () const = 0;
00380 };
00381 
00382 
00399 struct iMeshObjectType : public virtual iBase
00400 {
00401   SCF_INTERFACE(iMeshObjectType, 2,0,0);
00403   virtual csPtr<iMeshObjectFactory> NewFactory () = 0;
00404 };
00405 
00408 #endif // __CS_IMESH_OBJECT_H__

Generated for Crystal Space by doxygen 1.4.7