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/*
8This source file is part of GIMPACT Library.
9
10For the latest info, see http://gimpact.sourceforge.net/
11
12Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
13email: projectileman@yahoo.com
14
15
16This software is provided 'as-is', without any express or implied warranty.
17In no event will the authors be held liable for any damages arising from the use of this software.
18Permission is granted to anyone to use this software for any purpose,
19including commercial applications, and to alter it and redistribute it freely,
20subject to the following restrictions:
21
221. 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.
232. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
243. This notice may not be removed or altered from any source distribution.
25*/
26
27#include "btGImpactBvh.h"
28#include "btQuantization.h"
29
34{
35 //12 bytes
36 unsigned short int m_quantizedAabbMin[3];
37 unsigned short int m_quantizedAabbMax[3];
38 //4 bytes
40
42 {
43 m_escapeIndexOrDataIndex = 0;
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);
55 return -m_escapeIndexOrDataIndex;
56 }
57
59 {
60 m_escapeIndexOrDataIndex = -index;
61 }
62
64 {
65 //btAssert(m_escapeIndexOrDataIndex >= 0);
66
67 return m_escapeIndexOrDataIndex;
68 }
69
71 {
72 m_escapeIndexOrDataIndex = index;
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
#define ATTRIBUTE_ALIGNED16(a)
Definition: btScalar.h:99
#define SIMD_FORCE_INLINE
Definition: btScalar.h:98
btQuantizedBvhNode is a compressed aabb node, 16 bytes.
bool testQuantizedBoxOverlapp(unsigned short *quantizedMin, unsigned short *quantizedMax) const