CrystalSpace

Public API Reference

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

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 class csColor;
00036 class csReversibleTransform;
00037 class csRenderMesh;
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, 0);
00052 
00060 struct iMeshObject : public iBase
00061 {
00065   virtual iMeshObjectFactory* GetFactory () const = 0;
00066 
00074   virtual bool DrawTest (iRenderView* rview, iMovable* movable) = 0;
00075 
00076   // For NR:
00078   // virtual void EnableShadowCaps () = 0;
00079   // virtual void DisableShadowCaps () = 0;
00080 
00084   virtual void UpdateLighting (iLight** lights, int num_lights,
00085         iMovable* movable) = 0;
00086 
00094   virtual bool Draw (iRenderView* rview, iMovable* movable,
00095         csZBufMode zbufMode) = 0;
00096 
00100   virtual csRenderMesh** GetRenderMeshes (int& num) = 0;
00101 
00102   /* For NR: @@@ document me!!!
00103   virtual bool DrawShadow (iRenderView* rview, iMovable* movable,
00104         csZBufMode zbufMode, iLight *light) = 0;
00105 
00106   virtual bool DrawLight (iRenderView* rview, iMovable* movable,
00107         csZBufMode zbufMode, iLight *light) = 0;
00108   */
00109 
00117   virtual void SetVisibleCallback (iMeshObjectDrawCallback* cb) = 0;
00118 
00122   virtual iMeshObjectDrawCallback* GetVisibleCallback () const = 0;
00123 
00127   virtual void NextFrame (csTicks current_time,const csVector3& pos) = 0;
00128 
00138   virtual void HardTransform (const csReversibleTransform& t) = 0;
00139 
00143   virtual bool SupportsHardTransform () const = 0;
00144 
00152   virtual bool HitBeamOutline (const csVector3& start,
00153         const csVector3& end, csVector3& isect, float* pr) = 0;
00154 
00162   virtual bool HitBeamObject (const csVector3& start, const csVector3& end,
00163         csVector3& isect, float* pr) = 0;
00164 
00174   virtual void SetLogicalParent (iBase* logparent) = 0;
00175 
00180   virtual iBase* GetLogicalParent () const = 0;
00181 
00187   virtual iObjectModel* GetObjectModel () = 0;
00188 
00194   virtual bool SetColor (const csColor& color) = 0;
00195 
00199   virtual bool GetColor (csColor& color) const = 0;
00200 
00205   virtual bool SetMaterialWrapper (iMaterialWrapper* material) = 0;
00206 
00211   virtual iMaterialWrapper* GetMaterialWrapper () const = 0;
00212 
00220   virtual void InvalidateMaterialHandles () = 0;
00221 
00225   virtual int GetPortalCount () const = 0;
00227   virtual iPortal* GetPortal (int idx) const = 0;
00228 };
00229 
00230 SCF_VERSION (iMeshObjectFactory, 0, 0, 6);
00231 
00242 struct iMeshObjectFactory : public iBase
00243 {
00245   virtual csPtr<iMeshObject> NewInstance () = 0;
00246 
00256   virtual void HardTransform (const csReversibleTransform& t) = 0;
00257 
00261   virtual bool SupportsHardTransform () const = 0;
00262 
00272   virtual void SetLogicalParent (iBase* logparent) = 0;
00273 
00278   virtual iBase* GetLogicalParent () const = 0;
00279 
00288   virtual iObjectModel* GetObjectModel () = 0;
00289 };
00290 
00291 SCF_VERSION (iMeshObjectType, 0, 0, 2);
00292 
00298 struct iMeshObjectType : public iBase
00299 {
00301   virtual csPtr<iMeshObjectFactory> NewFactory () = 0;
00302 };
00303 
00304 #endif // __CS_IMESH_OBJECT_H__
00305 

Generated for Crystal Space by doxygen 1.2.14