Changeset 7983 for code/branches/kicklib/src/external/bullet/BulletCollision/CollisionShapes/btCapsuleShape.h
- 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/btCapsuleShape.h
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. … … 44 44 virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; 45 45 46 virtual void setMargin(btScalar collisionMargin) 47 { 48 //correct the m_implicitShapeDimensions for the margin 49 btVector3 oldMargin(getMargin(),getMargin(),getMargin()); 50 btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin; 51 52 btConvexInternalShape::setMargin(collisionMargin); 53 btVector3 newMargin(getMargin(),getMargin(),getMargin()); 54 m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin; 55 56 } 57 46 58 virtual void getAabb (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const 47 59 { … … 77 89 return m_implicitShapeDimensions[m_upAxis]; 78 90 } 91 92 virtual void setLocalScaling(const btVector3& scaling) 93 { 94 btVector3 oldMargin(getMargin(),getMargin(),getMargin()); 95 btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin; 96 btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling; 97 98 btConvexInternalShape::setLocalScaling(scaling); 99 100 m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin; 101 102 } 103 104 virtual int calculateSerializeBufferSize() const; 105 106 ///fills the dataBuffer and returns the struct name (and 0 on failure) 107 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const; 108 79 109 80 110 }; … … 114 144 }; 115 145 146 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 147 struct btCapsuleShapeData 148 { 149 btConvexInternalShapeData m_convexInternalShapeData; 116 150 151 int m_upAxis; 152 153 char m_padding[4]; 154 }; 155 156 SIMD_FORCE_INLINE int btCapsuleShape::calculateSerializeBufferSize() const 157 { 158 return sizeof(btCapsuleShapeData); 159 } 160 161 ///fills the dataBuffer and returns the struct name (and 0 on failure) 162 SIMD_FORCE_INLINE const char* btCapsuleShape::serialize(void* dataBuffer, btSerializer* serializer) const 163 { 164 btCapsuleShapeData* shapeData = (btCapsuleShapeData*) dataBuffer; 165 166 btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer); 167 168 shapeData->m_upAxis = m_upAxis; 169 170 return "btCapsuleShapeData"; 171 } 117 172 118 173 #endif //BT_CAPSULE_SHAPE_H
Note: See TracChangeset
for help on using the changeset viewer.