Changeset 8284 for code/branches/kicklib2/src/external/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
- Timestamp:
- Apr 21, 2011, 6:58:23 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
-
code/branches/kicklib2/src/external/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
r5781 r8284 1 2 1 /* 3 2 Bullet Continuous Collision Detection and Physics Library 4 Copyright (c) 2003-200 6 Erwin Coumans http://continuousphysics.com/Bullet/3 Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 5 4 6 5 This software is provided 'as-is', without any express or implied warranty. … … 14 13 3. This notice may not be removed or altered from any source distribution. 15 14 */ 15 16 16 #include "btTetrahedronShape.h" 17 17 #include "LinearMath/btMatrix3x3.h" 18 18 19 btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvex Shape (),20 m_numVertices(0) 21 { 22 m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE; 23 } 24 25 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvex Shape (),26 m_numVertices(0) 27 { 28 m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE; 29 addVertex(pt0); 30 } 31 32 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvex Shape (),19 btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexAabbCachingShape (), 20 m_numVertices(0) 21 { 22 m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE; 23 } 24 25 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexAabbCachingShape (), 26 m_numVertices(0) 27 { 28 m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE; 29 addVertex(pt0); 30 } 31 32 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexAabbCachingShape (), 33 33 m_numVertices(0) 34 34 { … … 38 38 } 39 39 40 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvex Shape (),40 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexAabbCachingShape (), 41 41 m_numVertices(0) 42 42 { … … 47 47 } 48 48 49 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvex Shape (),49 btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexAabbCachingShape (), 50 50 m_numVertices(0) 51 51 { … … 58 58 59 59 60 void btBU_Simplex1to4::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const 61 { 62 #if 1 63 btPolyhedralConvexAabbCachingShape::getAabb(t,aabbMin,aabbMax); 64 #else 65 aabbMin.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT); 66 aabbMax.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT); 67 68 //just transform the vertices in worldspace, and take their AABB 69 for (int i=0;i<m_numVertices;i++) 70 { 71 btVector3 worldVertex = t(m_vertices[i]); 72 aabbMin.setMin(worldVertex); 73 aabbMax.setMax(worldVertex); 74 } 75 #endif 76 } 77 78 60 79 61 80 … … 64 83 { 65 84 m_vertices[m_numVertices++] = pt; 66 67 85 recalcLocalAabb(); 68 86 }
Note: See TracChangeset
for help on using the changeset viewer.