Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:58:23 PM (13 years ago)
Author:
rgrieder
Message:

Merged revisions 7978 - 8096 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/src/external/bullet/BulletCollision/CollisionShapes/btCapsuleShape.h

    r5781 r8284  
    11/*
    22Bullet Continuous Collision Detection and Physics Library
    3 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
     3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
    44
    55This software is provided 'as-is', without any express or implied warranty.
     
    4444        virtual void    batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
    4545       
     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
    4658        virtual void getAabb (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
    4759        {
     
    7789                return m_implicitShapeDimensions[m_upAxis];
    7890        }
     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
    79109
    80110};
     
    114144};
    115145
     146///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     147struct  btCapsuleShapeData
     148{
     149        btConvexInternalShapeData       m_convexInternalShapeData;
    116150
     151        int     m_upAxis;
     152
     153        char    m_padding[4];
     154};
     155
     156SIMD_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)
     162SIMD_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}
    117172
    118173#endif //BT_CAPSULE_SHAPE_H
Note: See TracChangeset for help on using the changeset viewer.