Changeset 7983 for code/branches/kicklib/src/external/bullet/BulletCollision/CollisionShapes/btCollisionShape.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/btCollisionShape.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. … … 13 13 3. This notice may not be removed or altered from any source distribution. 14 14 */ 15 16 15 #include "BulletCollision/CollisionShapes/btCollisionShape.h" 17 18 19 btScalar gContactThresholdFactor=btScalar(0.02); 20 16 #include "LinearMath/btSerializer.h" 21 17 22 18 /* … … 46 42 } 47 43 48 btScalar btCollisionShape::getContactBreakingThreshold() const 44 45 btScalar btCollisionShape::getContactBreakingThreshold(btScalar defaultContactThreshold) const 49 46 { 50 return getAngularMotionDisc() * gContactThresholdFactor;47 return getAngularMotionDisc() * defaultContactThreshold; 51 48 } 49 52 50 btScalar btCollisionShape::getAngularMotionDisc() const 53 51 { … … 97 95 temporalAabbMax += angularMotion3d; 98 96 } 97 98 ///fills the dataBuffer and returns the struct name (and 0 on failure) 99 const char* btCollisionShape::serialize(void* dataBuffer, btSerializer* serializer) const 100 { 101 btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer; 102 char* name = (char*) serializer->findNameForPointer(this); 103 shapeData->m_name = (char*)serializer->getUniquePointer(name); 104 if (shapeData->m_name) 105 { 106 serializer->serializeName(name); 107 } 108 shapeData->m_shapeType = m_shapeType; 109 //shapeData->m_padding//?? 110 return "btCollisionShapeData"; 111 } 112 113 void btCollisionShape::serializeSingleShape(btSerializer* serializer) const 114 { 115 int len = calculateSerializeBufferSize(); 116 btChunk* chunk = serializer->allocate(len,1); 117 const char* structType = serialize(chunk->m_oldPtr, serializer); 118 serializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,(void*)this); 119 }
Note: See TracChangeset
for help on using the changeset viewer.