Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OPC_LSSCollider.h
Go to the documentation of this file.
1 /*
3  * OPCODE - Optimized Collision Detection
4  * Copyright (C) 2001 Pierre Terdiman
5  * Homepage: http://www.codercorner.com/Opcode.htm
6  */
8 
10 
16 
19 // Include Guard
20 #ifndef __OPC_LSSCOLLIDER_H__
21 #define __OPC_LSSCOLLIDER_H__
22 
24  {
26  {
27  Previous.mP0 = Point(0.0f, 0.0f, 0.0f);
28  Previous.mP1 = Point(0.0f, 0.0f, 0.0f);
29  Previous.mRadius = 0.0f;
30  FatCoeff = 1.1f;
31  }
32 
33  // Cached faces signature
35  // User settings
36  float FatCoeff;
37  };
38 
40  {
41  public:
42  // Constructor / Destructor
43  LSSCollider();
44  virtual ~LSSCollider();
45 
47 
61  bool Collide(LSSCache& cache, const LSS& lss, const Model& model, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null);
63  //
64  bool Collide(LSSCache& cache, const LSS& lss, const AABBTree* tree);
65  protected:
66  // LSS in model space
68  float mRadius2;
69  // Internal methods
70  void _Collide(const AABBCollisionNode* node);
71  void _Collide(const AABBNoLeafNode* node);
72  void _Collide(const AABBQuantizedNode* node);
73  void _Collide(const AABBQuantizedNoLeafNode* node);
74  void _Collide(const AABBTreeNode* node);
75  void _CollideNoPrimitiveTest(const AABBCollisionNode* node);
76  void _CollideNoPrimitiveTest(const AABBNoLeafNode* node);
77  void _CollideNoPrimitiveTest(const AABBQuantizedNode* node);
78  void _CollideNoPrimitiveTest(const AABBQuantizedNoLeafNode* node);
79  // Overlap tests
80  inline_ bool LSSContainsBox(const Point& bc, const Point& be);
81  inline_ bool LSSAABBOverlap(const Point& center, const Point& extents);
82  inline_ bool LSSTriOverlap(const Point& vert0, const Point& vert1, const Point& vert2);
83  // Init methods
84  bool InitQuery(LSSCache& cache, const LSS& lss, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null);
85  };
86 
88  {
89  public:
90  // Constructor / Destructor
92  virtual ~HybridLSSCollider();
93 
94  bool Collide(LSSCache& cache, const LSS& lss, const HybridModel& model, const Matrix4x4* worldl=null, const Matrix4x4* worldm=null);
95  protected:
97  };
98 
99 #endif // __OPC_LSSCOLLIDER_H__