CrystalSpace

Public API Reference

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

ivaria/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 
00026 struct iPolygonMesh;
00027 struct iMeshObject;
00028 class csReversibleTransform;
00029 
00033 struct csCollisionPair
00034 {
00035   csVector3 a1, b1, c1; // First triangle
00036   csVector3 a2, b2, c2; // Second triangle
00037 };
00038 
00039 SCF_VERSION (iCollider, 0, 2, 0);
00040 
00044 struct iCollider : public iBase
00045 {
00046 };
00047 
00048 SCF_VERSION (iCollideSystem, 0, 0, 3);
00049 
00056 struct iCollideSystem : public iBase
00057 {
00059   virtual csPtr<iCollider> CreateCollider (iPolygonMesh* mesh) = 0;
00060   
00062   virtual csPtr<iCollider> CreateSphereCollider (iMeshObject* sphere) = 0;
00063 
00065   virtual csPtr<iCollider> CreateBoxCollider (iMeshObject* box) = 0;
00066  
00076   virtual bool Collide (
00077         iCollider* collider1, const csReversibleTransform* trans1,
00078         iCollider* collider2, const csReversibleTransform* trans2) = 0;
00084   virtual csCollisionPair* GetCollisionPairs () = 0;
00085 
00089   virtual int GetCollisionPairCount () = 0;
00090 
00096   virtual void ResetCollisionPairs () = 0;
00097 
00103   virtual void SetOneHitOnly (bool o) = 0;
00104 
00111   virtual bool GetOneHitOnly () = 0;
00112 
00133   virtual int CollidePath (
00134         iCollider* collider, const csReversibleTransform* trans,
00135         csVector3& newpos,
00136         int num_colliders,
00137         iCollider** colliders,
00138         csReversibleTransform** transforms) = 0;
00139 };
00140 
00141 #endif // __CS_IVARIA_COLLIDER_H__
00142 

Generated for Crystal Space by doxygen 1.2.18