cstool/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 00051 class csColliderWrapper : public csObject 00052 { 00053 private: 00054 csRef<iCollideSystem> collide_system; 00055 csRef<iCollider> collider; 00056 00057 public: 00059 csColliderWrapper (csObject& parent, iCollideSystem* collide_system, 00060 iPolygonMesh* mesh); 00061 00063 csColliderWrapper (iObject* parent, iCollideSystem* collide_system, 00064 iPolygonMesh* mesh); 00065 00071 csColliderWrapper (iObject* parent, iCollideSystem* collide_system, 00072 iCollider* collider); 00073 00075 virtual ~csColliderWrapper (); 00076 00078 iCollider* GetCollider () { return collider; } 00079 00081 iCollideSystem* GetCollideSystem () { return collide_system; } 00082 00090 bool Collide (csColliderWrapper& pOtherCollider, 00091 csReversibleTransform* pThisTransform = 0, 00092 csReversibleTransform* pOtherTransform = 0); 00097 bool Collide (csObject& otherObject, 00098 csReversibleTransform* pThisTransform = 0, 00099 csReversibleTransform* pOtherTransform = 0); 00104 bool Collide (iObject* otherObject, 00105 csReversibleTransform* pThisTransform = 0, 00106 csReversibleTransform* pOtherTransform = 0); 00107 00112 static csColliderWrapper* GetColliderWrapper (csObject& object); 00113 00118 static csColliderWrapper* GetColliderWrapper (iObject* object); 00119 00120 SCF_DECLARE_IBASE_EXT (csObject); 00121 }; 00122 00127 class csColliderHelper 00128 { 00129 public: 00140 static void InitializeCollisionWrapper (iCollideSystem* colsys, 00141 iMeshWrapper* mesh); 00142 00148 static void InitializeCollisionWrappers (iCollideSystem* colsys, 00149 iEngine* engine, iRegion* region = 0); 00150 }; 00151 00152 #endif // __CS_COLLIDER_H__
Generated for Crystal Space by doxygen 1.2.18