Bullet Collision Detection & Physics Library
btGImpactBvhStructs.h
Go to the documentation of this file.
1 #ifndef GIM_BOX_SET_STRUCT_H_INCLUDED
2 #define GIM_BOX_SET_STRUCT_H_INCLUDED
3 
7 /*
8 This source file is part of GIMPACT Library.
9 
10 For the latest info, see http://gimpact.sourceforge.net/
11 
12 Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
13 email: projectileman@yahoo.com
14 
15 
16 This software is provided 'as-is', without any express or implied warranty.
17 In no event will the authors be held liable for any damages arising from the use of this software.
18 Permission is granted to anyone to use this software for any purpose,
19 including commercial applications, and to alter it and redistribute it freely,
20 subject to the following restrictions:
21 
22 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
23 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
24 3. This notice may not be removed or altered from any source distribution.
25 */
26 
27 
29 
30 #include "btBoxCollision.h"
31 #include "btTriangleShapeEx.h"
32 
34 struct GIM_PAIR
35 {
36  int m_index1;
37  int m_index2;
39  {}
40 
41  GIM_PAIR(const GIM_PAIR & p)
42  {
43  m_index1 = p.m_index1;
44  m_index2 = p.m_index2;
45  }
46 
47  GIM_PAIR(int index1, int index2)
48  {
49  m_index1 = index1;
50  m_index2 = index2;
51  }
52 };
53 
56 {
58  int m_data;
59 };
60 
63 {
64 public:
66 protected:
68 public:
70  {
71  m_escapeIndexOrDataIndex = 0;
72  }
73 
75  {
76  //skipindex is negative (internal node), triangleindex >=0 (leafnode)
77  return (m_escapeIndexOrDataIndex>=0);
78  }
79 
81  {
82  //btAssert(m_escapeIndexOrDataIndex < 0);
83  return -m_escapeIndexOrDataIndex;
84  }
85 
87  {
88  m_escapeIndexOrDataIndex = -index;
89  }
90 
92  {
93  //btAssert(m_escapeIndexOrDataIndex >= 0);
94 
95  return m_escapeIndexOrDataIndex;
96  }
97 
99  {
100  m_escapeIndexOrDataIndex = index;
101  }
102 
103 };
104 
105 #endif // GIM_BOXPRUNING_H_INCLUDED
GIM_PAIR(int index1, int index2)
int getDataIndex() const
GIM_BVH_DATA is an internal GIMPACT collision structure to contain axis aligned bounding box...
#define SIMD_FORCE_INLINE
Definition: btScalar.h:81
int getEscapeIndex() const
void setEscapeIndex(int index)
Axis aligned box.
bool isLeafNode() const
GIM_PAIR(const GIM_PAIR &p)
Node Structure for trees.
Overlapping pair.
void setDataIndex(int index)