Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 27, 2011, 7:43:24 AM (14 years ago)
Author:
rgrieder
Message:

Updated Bullet Physics Engine from v2.74 to v2.77

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/src/external/bullet/BulletCollision/CollisionShapes/btCollisionShape.cpp

    r5781 r7983  
    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.
     
    13133. This notice may not be removed or altered from any source distribution.
    1414*/
    15 
    1615#include "BulletCollision/CollisionShapes/btCollisionShape.h"
    17 
    18 
    19 btScalar gContactThresholdFactor=btScalar(0.02);
    20 
     16#include "LinearMath/btSerializer.h"
    2117
    2218/*
     
    4642}
    4743
    48 btScalar        btCollisionShape::getContactBreakingThreshold() const
     44
     45btScalar        btCollisionShape::getContactBreakingThreshold(btScalar defaultContactThreshold) const
    4946{
    50         return getAngularMotionDisc() * gContactThresholdFactor;
     47        return getAngularMotionDisc() * defaultContactThreshold;
    5148}
     49
    5250btScalar        btCollisionShape::getAngularMotionDisc() const
    5351{
     
    9795        temporalAabbMax += angularMotion3d;
    9896}
     97
     98///fills the dataBuffer and returns the struct name (and 0 on failure)
     99const 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
     113void    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.