2
Bullet Continuous Collision Detection and Physics Library
3
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
5
This software is provided 'as-is', without any express or implied warranty.
6
In no event will the authors be held liable for any damages arising from the use of this software.
7
Permission is granted to anyone to use this software for any purpose,
8
including commercial applications, and to alter it and redistribute it freely,
9
subject to the following restrictions:
11
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.
12
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13
3. This notice may not be removed or altered from any source distribution.
16
#include "btTetrahedronShape.h"
17
#include "LinearMath/btMatrix3x3.h"
19
btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexAabbCachingShape (),
22
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
25
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexAabbCachingShape (),
28
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
32
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexAabbCachingShape (),
35
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
40
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexAabbCachingShape (),
43
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
49
btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexAabbCachingShape (),
52
m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
60
void btBU_Simplex1to4::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
63
btPolyhedralConvexAabbCachingShape::getAabb(t,aabbMin,aabbMax);
65
aabbMin.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
66
aabbMax.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
68
//just transform the vertices in worldspace, and take their AABB
69
for (int i=0;i<m_numVertices;i++)
71
btVector3 worldVertex = t(m_vertices[i]);
72
aabbMin.setMin(worldVertex);
73
aabbMax.setMax(worldVertex);
82
void btBU_Simplex1to4::addVertex(const btVector3& pt)
84
m_vertices[m_numVertices++] = pt;
89
int btBU_Simplex1to4::getNumVertices() const
94
int btBU_Simplex1to4::getNumEdges() const
96
//euler formula, F-E+V = 2, so E = F+V-2
98
switch (m_numVertices)
113
void btBU_Simplex1to4::getEdge(int i,btVector3& pa,btVector3& pb) const
116
switch (m_numVertices)
177
void btBU_Simplex1to4::getVertex(int i,btVector3& vtx) const
182
int btBU_Simplex1to4::getNumPlanes() const
184
switch (m_numVertices)
204
void btBU_Simplex1to4::getPlane(btVector3&, btVector3& ,int ) const
209
int btBU_Simplex1to4::getIndex(int ) const
214
bool btBU_Simplex1to4::isInside(const btVector3& ,btScalar ) const