- Timestamp:
- Apr 28, 2011, 7:15:14 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/bullet/BulletDynamics/Dynamics/Bullet-C-API.cpp
r5781 r8351 44 44 #include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h" 45 45 #include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h" 46 #include "LinearMath/btStackAlloc.h" 46 47 47 48 48 /* … … 182 182 { 183 183 //capsule is convex hull of 2 spheres, so use btMultiSphereShape 184 btVector3 inertiaHalfExtents(radius,height,radius);184 185 185 const int numSpheres = 2; 186 186 btVector3 positions[numSpheres] = {btVector3(0,height,0),btVector3(0,-height,0)}; 187 187 btScalar radi[numSpheres] = {radius,radius}; 188 188 void* mem = btAlignedAlloc(sizeof(btMultiSphereShape),16); 189 return (plCollisionShapeHandle) new (mem)btMultiSphereShape( inertiaHalfExtents,positions,radi,numSpheres);189 return (plCollisionShapeHandle) new (mem)btMultiSphereShape(positions,radi,numSpheres); 190 190 } 191 191 plCollisionShapeHandle plNewConeShape(plReal radius, plReal height) … … 294 294 worldTrans.setRotation(orn); 295 295 body->setWorldTransform(worldTrans); 296 } 297 298 void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix) 299 { 300 btRigidBody* body = reinterpret_cast< btRigidBody* >(object); 301 btAssert(body); 302 btTransform& worldTrans = body->getWorldTransform(); 303 worldTrans.setFromOpenGLMatrix(matrix); 296 304 } 297 305 … … 366 374 btGjkPairDetector::ClosestPointInput input; 367 375 368 btStackAlloc gStackAlloc(1024*1024*2); 369 370 input.m_stackAlloc = &gStackAlloc; 371 376 372 377 btTransform tr; 373 378 tr.setIdentity();
Note: See TracChangeset
for help on using the changeset viewer.