Bullet Collision Detection & Physics Library
btGImpactQuantizedBvhStructs.h
Go to the documentation of this file.
1 #ifndef GIM_QUANTIZED_SET_STRUCTS_H_INCLUDED
2 #define GIM_QUANTIZED_SET_STRUCTS_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 #include "btGImpactBvh.h"
28 #include "btQuantization.h"
29 
33 {
34  //12 bytes
35  unsigned short int m_quantizedAabbMin[3];
36  unsigned short int m_quantizedAabbMax[3];
37  //4 bytes
39 
41  {
42  m_escapeIndexOrDataIndex = 0;
43  }
44 
46  {
47  //skipindex is negative (internal node), triangleindex >=0 (leafnode)
48  return (m_escapeIndexOrDataIndex>=0);
49  }
50 
52  {
53  //btAssert(m_escapeIndexOrDataIndex < 0);
54  return -m_escapeIndexOrDataIndex;
55  }
56 
58  {
59  m_escapeIndexOrDataIndex = -index;
60  }
61 
63  {
64  //btAssert(m_escapeIndexOrDataIndex >= 0);
65 
66  return m_escapeIndexOrDataIndex;
67  }
68 
70  {
71  m_escapeIndexOrDataIndex = index;
72  }
73 
75  unsigned short * quantizedMin,unsigned short * quantizedMax) const
76  {
77  if(m_quantizedAabbMin[0] > quantizedMax[0] ||
78  m_quantizedAabbMax[0] < quantizedMin[0] ||
79  m_quantizedAabbMin[1] > quantizedMax[1] ||
80  m_quantizedAabbMax[1] < quantizedMin[1] ||
81  m_quantizedAabbMin[2] > quantizedMax[2] ||
82  m_quantizedAabbMax[2] < quantizedMin[2])
83  {
84  return false;
85  }
86  return true;
87  }
88 
89 };
90 
91 #endif // GIM_QUANTIZED_SET_STRUCTS_H_INCLUDED
bool testQuantizedBoxOverlapp(unsigned short *quantizedMin, unsigned short *quantizedMax) const
#define SIMD_FORCE_INLINE
Definition: btScalar.h:81
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:82
btQuantizedBvhNode is a compressed aabb node, 16 bytes.