CrystalSpace

Public API Reference

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

collider.h

00001 /*
00002     Copyright (C) 1998-2003 by Jorrit Tyberghein
00003     Written by Alex Pfaffe.
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 #ifndef __CS_COLLIDER_H__
00020 #define __CS_COLLIDER_H__
00021 
00022 #include "csutil/csobject.h"
00023 #include "csgeom/math3d.h"
00024 #include "csgeom/matrix3.h"
00025 #include "csgeom/vector3.h"
00026 
00027 class csReversibleTransform;
00028 struct iPolygonMesh;
00029 struct iCollideSystem;
00030 struct iCollider;
00031 struct iObject;
00032 struct iEngine;
00033 struct iRegion;
00034 struct iMeshWrapper;
00035 
00036 SCF_VERSION (csColliderWrapper, 0, 0, 3);
00037 
00046 class csColliderWrapper : public csObject
00047 {
00048 private:
00049   csRef<iCollideSystem> collide_system;
00050   csRef<iCollider> collider;
00051 
00052 public:
00054   csColliderWrapper (csObject& parent, iCollideSystem* collide_system,
00055         iPolygonMesh* mesh);
00056 
00058   csColliderWrapper (iObject* parent, iCollideSystem* collide_system,
00059         iPolygonMesh* mesh);
00060 
00062   csColliderWrapper (iObject* parent, iCollideSystem* collide_system,
00063         iCollider* collider);
00064 
00066   virtual ~csColliderWrapper ();
00067 
00069   iCollider* GetCollider () { return collider; }
00070 
00072   iCollideSystem* GetCollideSystem () { return collide_system; }
00073 
00081   bool Collide (csColliderWrapper& pOtherCollider,
00082                 csReversibleTransform* pThisTransform = NULL,
00083                 csReversibleTransform* pOtherTransform = NULL);
00088   bool Collide (csObject& otherObject,
00089                 csReversibleTransform* pThisTransform = NULL,
00090                 csReversibleTransform* pOtherTransform = NULL);
00095   bool Collide (iObject* otherObject,
00096                 csReversibleTransform* pThisTransform = NULL,
00097                 csReversibleTransform* pOtherTransform = NULL);
00098 
00103   static csColliderWrapper* GetColliderWrapper (csObject& object);
00104 
00109   static csColliderWrapper* GetColliderWrapper (iObject* object);
00110 
00111   SCF_DECLARE_IBASE_EXT (csObject);
00112 };
00113 
00118 class csColliderHelper
00119 {
00120 public:
00131   static void InitializeCollisionWrapper (iCollideSystem* colsys,
00132         iMeshWrapper* mesh);
00133 
00139   static void InitializeCollisionWrappers (iCollideSystem* colsys,
00140         iEngine* engine, iRegion* region = NULL);
00141 };
00142 
00143 #endif // __CS_COLLIDER_H__

Generated for Crystal Space by doxygen 1.2.14