CrystalSpace

Public API Reference

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

collider.h

00001 /*
00002     Crystal Space 3D engine
00003     Copyright (C) 2000 by Jorrit Tyberghein
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 
00020 #ifndef __CS_IVARIA_COLLIDER_H__
00021 #define __CS_IVARIA_COLLIDER_H__
00022 
00023 #include "csutil/scf.h"
00024 #include "csgeom/vector3.h"
00025 #include "csutil/array.h"
00026 
00027 struct iPolygonMesh;
00028 struct iMeshObject;
00029 class csReversibleTransform;
00030 
00035 struct csCollisionPair
00036 {
00037   csVector3 a1, b1, c1; // First triangle
00038   csVector3 a2, b2, c2; // Second triangle
00039 };
00040 
00044 struct csIntersectingTriangle
00045 {
00046   csVector3 a, b, c;
00047 };
00048 
00049 SCF_VERSION (iCollider, 0, 2, 0);
00050 
00067 struct iCollider : public iBase
00068 {
00069 };
00070 
00071 SCF_VERSION (iCollideSystem, 0, 0, 4);
00072 
00094 struct iCollideSystem : public iBase
00095 {
00105   virtual csPtr<iCollider> CreateCollider (iPolygonMesh* mesh) = 0;
00106   
00128   virtual bool Collide (
00129         iCollider* collider1, const csReversibleTransform* trans1,
00130         iCollider* collider2, const csReversibleTransform* trans2) = 0;
00131 
00140   virtual csCollisionPair* GetCollisionPairs () = 0;
00141 
00146   virtual size_t GetCollisionPairCount () = 0;
00147 
00153   virtual void ResetCollisionPairs () = 0;
00154 
00166   virtual bool CollideRay (
00167         iCollider* collider, const csReversibleTransform* trans,
00168         const csVector3& start, const csVector3& end) = 0;
00169 
00175   virtual const csArray<csIntersectingTriangle>& GetIntersectingTriangles ()
00176         const = 0;
00177 
00186   virtual void SetOneHitOnly (bool o) = 0;
00187 
00196   virtual bool GetOneHitOnly () = 0;
00197 };
00198 
00199 #endif // __CS_IVARIA_COLLIDER_H__
00200 

Generated for Crystal Space by doxygen 1.3.9.1