Bullet Collision Detection & Physics Library: btGImpactBvhStructs.h Source File

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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/*
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 "LinearMath/btAlignedObjectArray.h"
28
29#include "btBoxCollision.h"
30#include "btTriangleShapeEx.h"
31#include "gim_pair.h" //for GIM_PAIR
32
34 struct GIM_BVH_DATA
35{
36 btAABB m_bound;
37 int m_data;
38};
39
41 class GIM_BVH_TREE_NODE
42{
43public:
44 btAABB m_bound;
45
46protected:
47 int m_escapeIndexOrDataIndex;
48
49public:
50 GIM_BVH_TREE_NODE()
51 {
52 m_escapeIndexOrDataIndex = 0;
53 }
54
55 SIMD_FORCE_INLINE bool isLeafNode() const
56 {
57 //skipindex is negative (internal node), triangleindex >=0 (leafnode)
58 return (m_escapeIndexOrDataIndex >= 0);
59 }
60
61 SIMD_FORCE_INLINE int getEscapeIndex() const
62 {
63 //btAssert(m_escapeIndexOrDataIndex < 0);
64 return -m_escapeIndexOrDataIndex;
65 }
66
67 SIMD_FORCE_INLINE void setEscapeIndex(int index)
68 {
69 m_escapeIndexOrDataIndex = -index;
70 }
71
72 SIMD_FORCE_INLINE int getDataIndex() const
73 {
74 //btAssert(m_escapeIndexOrDataIndex >= 0);
75
76 return m_escapeIndexOrDataIndex;
77 }
78
79 SIMD_FORCE_INLINE void setDataIndex(int index)
80 {
81 m_escapeIndexOrDataIndex = index;
82 }
83};
84
85#endif // GIM_BOXPRUNING_H_INCLUDED
btAlignedObjectArray.h
btBoxCollision.h
SIMD_FORCE_INLINE
#define SIMD_FORCE_INLINE
Definition: btScalar.h:98
btTriangleShapeEx.h
GIM_BVH_TREE_NODE
Node Structure for trees.
Definition: btGImpactBvhStructs.h:42
GIM_BVH_TREE_NODE::isLeafNode
bool isLeafNode() const
Definition: btGImpactBvhStructs.h:55
GIM_BVH_TREE_NODE::m_bound
btAABB m_bound
Definition: btGImpactBvhStructs.h:44
GIM_BVH_TREE_NODE::setEscapeIndex
void setEscapeIndex(int index)
Definition: btGImpactBvhStructs.h:67
GIM_BVH_TREE_NODE::setDataIndex
void setDataIndex(int index)
Definition: btGImpactBvhStructs.h:79
GIM_BVH_TREE_NODE::GIM_BVH_TREE_NODE
GIM_BVH_TREE_NODE()
Definition: btGImpactBvhStructs.h:50
GIM_BVH_TREE_NODE::getDataIndex
int getDataIndex() const
Definition: btGImpactBvhStructs.h:72
GIM_BVH_TREE_NODE::getEscapeIndex
int getEscapeIndex() const
Definition: btGImpactBvhStructs.h:61
GIM_BVH_TREE_NODE::m_escapeIndexOrDataIndex
int m_escapeIndexOrDataIndex
Definition: btGImpactBvhStructs.h:47
btAABB
Axis aligned box.
Definition: btBoxCollision.h:216
gim_pair.h
GIM_BVH_DATA
GIM_BVH_DATA is an internal GIMPACT collision structure to contain axis aligned bounding box.
Definition: btGImpactBvhStructs.h:35
GIM_BVH_DATA::m_data
int m_data
Definition: btGImpactBvhStructs.h:37
GIM_BVH_DATA::m_bound
btAABB m_bound
Definition: btGImpactBvhStructs.h:36