Changeset 7983 for code/branches/kicklib/src/external/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
- Timestamp:
- Feb 27, 2011, 7:43:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/src/external/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
r5781 r7983 1 1 /* 2 2 Bullet Continuous Collision Detection and Physics Library 3 Copyright (c) 2003-200 6 Erwin Coumans http://continuousphysics.com/Bullet/3 Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 4 5 5 This software is provided 'as-is', without any express or implied warranty. … … 16 16 #include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h" 17 17 18 btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape(), 19 m_localAabbMin(1,1,1), 20 m_localAabbMax(-1,-1,-1), 21 m_isLocalAabbValid(false), 22 m_optionalHull(0) 18 btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape() 23 19 { 24 20 … … 28 24 btVector3 btPolyhedralConvexShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const 29 25 { 26 27 28 btVector3 supVec(0,0,0); 29 #ifndef __SPU__ 30 30 int i; 31 btVector3 supVec(0,0,0); 32 33 btScalar maxDot(btScalar(-1e30)); 31 btScalar maxDot(btScalar(-BT_LARGE_FLOAT)); 34 32 35 33 btVector3 vec = vec0; … … 58 56 } 59 57 58 59 #endif //__SPU__ 60 60 return supVec; 61 } 61 62 62 } 63 63 64 64 65 void btPolyhedralConvexShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const 65 66 { 67 #ifndef __SPU__ 66 68 int i; 67 69 … … 71 73 for (i=0;i<numVectors;i++) 72 74 { 73 supportVerticesOut[i][3] = btScalar(- 1e30);75 supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT); 74 76 } 75 77 … … 91 93 } 92 94 } 95 #endif //__SPU__ 93 96 } 94 97 … … 97 100 void btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const 98 101 { 102 #ifndef __SPU__ 99 103 //not yet, return box inertia 100 104 … … 116 120 117 121 inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2)); 118 122 #endif //__SPU__ 119 123 } 120 124 121 125 122 126 123 void btPolyhedralConvexShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const 124 { 125 getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin()); 126 } 127 128 129 130 void btPolyhedralConvexShape::setLocalScaling(const btVector3& scaling) 127 void btPolyhedralConvexAabbCachingShape::setLocalScaling(const btVector3& scaling) 131 128 { 132 129 btConvexInternalShape::setLocalScaling(scaling); … … 134 131 } 135 132 136 void btPolyhedralConvexShape::recalcLocalAabb() 133 btPolyhedralConvexAabbCachingShape::btPolyhedralConvexAabbCachingShape() 134 :btPolyhedralConvexShape(), 135 m_localAabbMin(1,1,1), 136 m_localAabbMax(-1,-1,-1), 137 m_isLocalAabbValid(false) 138 { 139 } 140 141 void btPolyhedralConvexAabbCachingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const 142 { 143 getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin()); 144 } 145 146 void btPolyhedralConvexAabbCachingShape::recalcLocalAabb() 137 147 { 138 148 m_isLocalAabbValid = true; … … 182 192 } 183 193 184 185
Note: See TracChangeset
for help on using the changeset viewer.