Blender  V3.3
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 
32 ATTRIBUTE_ALIGNED16(struct)
34 {
35  //12 bytes
36  unsigned short int m_quantizedAabbMin[3];
37  unsigned short int m_quantizedAabbMax[3];
38  //4 bytes
40 
42  {
44  }
45 
47  {
48  //skipindex is negative (internal node), triangleindex >=0 (leafnode)
49  return (m_escapeIndexOrDataIndex >= 0);
50  }
51 
53  {
54  //btAssert(m_escapeIndexOrDataIndex < 0);
56  }
57 
59  {
60  m_escapeIndexOrDataIndex = -index;
61  }
62 
64  {
65  //btAssert(m_escapeIndexOrDataIndex >= 0);
66 
68  }
69 
71  {
73  }
74 
76  unsigned short* quantizedMin, unsigned short* quantizedMax) const
77  {
78  if (m_quantizedAabbMin[0] > quantizedMax[0] ||
79  m_quantizedAabbMax[0] < quantizedMin[0] ||
80  m_quantizedAabbMin[1] > quantizedMax[1] ||
81  m_quantizedAabbMax[1] < quantizedMin[1] ||
82  m_quantizedAabbMin[2] > quantizedMax[2] ||
83  m_quantizedAabbMax[2] < quantizedMin[2])
84  {
85  return false;
86  }
87  return true;
88  }
89 };
90 
91 #endif // GIM_QUANTIZED_SET_STRUCTS_H_INCLUDED
SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(unsigned short *quantizedMin, unsigned short *quantizedMax) const
SIMD_FORCE_INLINE void setDataIndex(int index)
SIMD_FORCE_INLINE bool isLeafNode() const
SIMD_FORCE_INLINE int getDataIndex() const
SIMD_FORCE_INLINE void setEscapeIndex(int index)
SIMD_FORCE_INLINE int getEscapeIndex() const
int m_escapeIndexOrDataIndex
unsigned short int m_quantizedAabbMax[3]
unsigned short int m_quantizedAabbMin[3]
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:285
#define SIMD_FORCE_INLINE
Definition: btScalar.h:280