Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8393


Ignore:
Timestamp:
May 3, 2011, 5:07:42 AM (13 years ago)
Author:
rgrieder
Message:

Updated Bullet from v2.77 to v2.78.
(I'm not going to make a branch for that since the update from 2.74 to 2.77 hasn't been tested that much either).

You will HAVE to do a complete RECOMPILE! I tested with MSVC and MinGW and they both threw linker errors at me.

Location:
code/trunk/src/external/bullet
Files:
6 added
161 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/external/bullet/Bullet-C-Api.h

    r8351 r8393  
    6666*/
    6767
    68         extern  plPhysicsSdkHandle      plNewBulletSdk(); //this could be also another sdk, like ODE, PhysX etc.
     68        extern  plPhysicsSdkHandle      plNewBulletSdk(void); //this could be also another sdk, like ODE, PhysX etc.
    6969        extern  void            plDeletePhysicsSdk(plPhysicsSdkHandle   physicsSdk);
    7070
     
    117117        extern  plCollisionShapeHandle plNewConeShape(plReal radius, plReal height);
    118118        extern  plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height);
    119         extern  plCollisionShapeHandle plNewCompoundShape();
     119        extern  plCollisionShapeHandle plNewCompoundShape(void);
    120120        extern  void    plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn);
    121121
     
    123123
    124124        /* Convex Meshes */
    125         extern  plCollisionShapeHandle plNewConvexHullShape();
     125        extern  plCollisionShapeHandle plNewConvexHullShape(void);
    126126        extern  void            plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z);
    127127/* Concave static triangle meshes */
    128         extern  plMeshInterfaceHandle              plNewMeshInterface();
     128        extern  plMeshInterfaceHandle              plNewMeshInterface(void);
    129129        extern  void            plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);
    130130        extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h

    r8351 r8393  
    1717// 3. This notice may not be removed or altered from any source distribution.
    1818
    19 #ifndef AXIS_SWEEP_3_H
    20 #define AXIS_SWEEP_3_H
     19#ifndef BT_AXIS_SWEEP_3_H
     20#define BT_AXIS_SWEEP_3_H
    2121
    2222#include "LinearMath/btVector3.h"
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef         BROADPHASE_INTERFACE_H
    17 #define         BROADPHASE_INTERFACE_H
     16#ifndef         BT_BROADPHASE_INTERFACE_H
     17#define         BT_BROADPHASE_INTERFACE_H
    1818
    1919
     
    8080};
    8181
    82 #endif //BROADPHASE_INTERFACE_H
     82#endif //BT_BROADPHASE_INTERFACE_H
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef BROADPHASE_PROXY_H
    17 #define BROADPHASE_PROXY_H
     16#ifndef BT_BROADPHASE_PROXY_H
     17#define BT_BROADPHASE_PROXY_H
    1818
    1919#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
     
    267267
    268268
    269 #endif //BROADPHASE_PROXY_H
    270 
     269#endif //BT_BROADPHASE_PROXY_H
     270
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef COLLISION_ALGORITHM_H
    17 #define COLLISION_ALGORITHM_H
     16#ifndef BT_COLLISION_ALGORITHM_H
     17#define BT_COLLISION_ALGORITHM_H
    1818
    1919#include "LinearMath/btScalar.h"
     
    4545        btPersistentManifold*   m_manifold;
    4646
    47         int     getDispatcherId();
     47//      int     getDispatcherId();
    4848
    4949};
     
    6060
    6161protected:
    62         int     getDispatcherId();
     62//      int     getDispatcherId();
    6363       
    6464public:
     
    7878
    7979
    80 #endif //COLLISION_ALGORITHM_H
     80#endif //BT_COLLISION_ALGORITHM_H
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDispatcher.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef _DISPATCHER_H
    17 #define _DISPATCHER_H
    18 
     16#ifndef BT_DISPATCHER_H
     17#define BT_DISPATCHER_H
    1918#include "LinearMath/btScalar.h"
    2019
     
    2827class btPersistentManifold;
    2928class btStackAlloc;
     29class btPoolAllocator;
    3030
    3131struct btDispatcherInfo
     
    4141                m_dispatchFunc(DISPATCH_DISCRETE),
    4242                m_timeOfImpact(btScalar(1.)),
    43                 m_useContinuous(false),
     43                m_useContinuous(true),
    4444                m_debugDraw(0),
    4545                m_enableSatConvex(false),
     
    4949                m_useConvexConservativeDistanceUtil(false),
    5050                m_convexConservativeDistanceThreshold(0.0f),
    51                 m_convexMaxDistanceUseCPT(false),
    5251                m_stackAllocator(0)
    5352        {
     
    6665        bool            m_useConvexConservativeDistanceUtil;
    6766        btScalar        m_convexConservativeDistanceThreshold;
    68         bool            m_convexMaxDistanceUseCPT;
    6967        btStackAlloc*   m_stackAllocator;
    7068};
     
    9997        virtual btPersistentManifold**  getInternalManifoldPointer() = 0;
    10098
     99        virtual btPoolAllocator*        getInternalManifoldPool() = 0;
     100
     101        virtual const btPoolAllocator*  getInternalManifoldPool() const = 0;
     102
    101103        virtual void* allocateCollisionAlgorithm(int size)  = 0;
    102104
     
    106108
    107109
    108 #endif //_DISPATCHER_H
     110#endif //BT_DISPATCHER_H
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef OVERLAPPING_PAIR_CACHE_H
    17 #define OVERLAPPING_PAIR_CACHE_H
     16#ifndef BT_OVERLAPPING_PAIR_CACHE_H
     17#define BT_OVERLAPPING_PAIR_CACHE_H
    1818
    1919
     
    465465
    466466
    467 #endif //OVERLAPPING_PAIR_CACHE_H
    468 
    469 
     467#endif //BT_OVERLAPPING_PAIR_CACHE_H
     468
     469
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef QUANTIZED_BVH_H
    17 #define QUANTIZED_BVH_H
     16#ifndef BT_QUANTIZED_BVH_H
     17#define BT_QUANTIZED_BVH_H
    1818
    1919class btSerializer;
     
    577577
    578578
    579 #endif //QUANTIZED_BVH_H
     579#endif //BT_QUANTIZED_BVH_H
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef SIMPLE_BROADPHASE_H
    17 #define SIMPLE_BROADPHASE_H
     16#ifndef BT_SIMPLE_BROADPHASE_H
     17#define BT_SIMPLE_BROADPHASE_H
    1818
    1919
     
    168168
    169169
    170 #endif //SIMPLE_BROADPHASE_H
     170#endif //BT_SIMPLE_BROADPHASE_H
    171171
  • code/trunk/src/external/bullet/BulletCollision/CMakeLists.txt

    r8351 r8393  
    5050        CollisionShapes/btConvexInternalShape.cpp
    5151        CollisionShapes/btConvexPointCloudShape.cpp
     52        CollisionShapes/btConvexPolyhedron.cpp
    5253        CollisionShapes/btConvexShape.cpp
    5354        CollisionShapes/btConvex2dShape.cpp
     
    8889
    8990COMPILATION_END
     91
     92    # Raises compiler errors when compiled inside the compilation
     93        NarrowPhaseCollision/btPolyhedralContactClipping.cpp
    9094
    9195        # Headers
     
    140144        CollisionShapes/btConvexInternalShape.h
    141145        CollisionShapes/btConvexPointCloudShape.h
     146        CollisionShapes/btConvexPolyhedron.h
    142147        CollisionShapes/btConvexShape.h
    143148        CollisionShapes/btConvex2dShape.h
     
    184189        NarrowPhaseCollision/btSubSimplexConvexCast.h
    185190        NarrowPhaseCollision/btVoronoiSimplexSolver.h
     191        NarrowPhaseCollision/btPolyhedralContactClipping.h
    186192)
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp

    r8351 r8393  
    5858}
    5959
    60 #define MAX_OVERLAP btScalar(0.)
    61 
    6260
    6361
     
    9492}
    9593
    96 ///combined discrete/continuous sphere-triangle
    9794bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold)
    9895{
    9996
    10097        const btVector3* vertices = &m_triangle->getVertexPtr(0);
    101         const btVector3& c = sphereCenter;
    102         btScalar r = m_sphere->getRadius();
    103 
    104         btVector3 delta (0,0,0);
     98       
     99        btScalar radius = m_sphere->getRadius();
     100        btScalar radiusWithThreshold = radius + contactBreakingThreshold;
    105101
    106102        btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
    107103        normal.normalize();
    108         btVector3 p1ToCentre = c - vertices[0];
     104        btVector3 p1ToCentre = sphereCenter - vertices[0];
    109105        btScalar distanceFromPlane = p1ToCentre.dot(normal);
    110106
     
    112108        {
    113109                //triangle facing the other way
    114        
    115110                distanceFromPlane *= btScalar(-1.);
    116111                normal *= btScalar(-1.);
    117112        }
    118113
    119         btScalar contactMargin = contactBreakingThreshold;
    120         bool isInsideContactPlane = distanceFromPlane < r + contactMargin;
    121         bool isInsideShellPlane = distanceFromPlane < r;
    122        
    123         btScalar deltaDotNormal = delta.dot(normal);
    124         if (!isInsideShellPlane && deltaDotNormal >= btScalar(0.0))
    125                 return false;
    126 
     114        bool isInsideContactPlane = distanceFromPlane < radiusWithThreshold;
     115       
    127116        // Check for contact / intersection
    128117        bool hasContact = false;
    129118        btVector3 contactPoint;
    130119        if (isInsideContactPlane) {
    131                 if (facecontains(c,vertices,normal)) {
     120                if (facecontains(sphereCenter,vertices,normal)) {
    132121                        // Inside the contact wedge - touches a point on the shell plane
    133122                        hasContact = true;
    134                         contactPoint = c - normal*distanceFromPlane;
     123                        contactPoint = sphereCenter - normal*distanceFromPlane;
    135124                } else {
    136125                        // Could be inside one of the contact capsules
    137                         btScalar contactCapsuleRadiusSqr = (r + contactMargin) * (r + contactMargin);
     126                        btScalar contactCapsuleRadiusSqr = radiusWithThreshold*radiusWithThreshold;
    138127                        btVector3 nearestOnEdge;
    139128                        for (int i = 0; i < m_triangle->getNumEdges(); i++) {
     
    144133                                m_triangle->getEdge(i,pa,pb);
    145134
    146                                 btScalar distanceSqr = SegmentSqrDistance(pa,pb,c, nearestOnEdge);
     135                                btScalar distanceSqr = SegmentSqrDistance(pa,pb,sphereCenter, nearestOnEdge);
    147136                                if (distanceSqr < contactCapsuleRadiusSqr) {
    148137                                        // Yep, we're inside a capsule
     
    156145
    157146        if (hasContact) {
    158                 btVector3 contactToCentre = c - contactPoint;
     147                btVector3 contactToCentre = sphereCenter - contactPoint;
    159148                btScalar distanceSqr = contactToCentre.length2();
    160                 if (distanceSqr < (r - MAX_OVERLAP)*(r - MAX_OVERLAP)) {
    161                         btScalar distance = btSqrt(distanceSqr);
    162                         resultNormal = contactToCentre;
    163                         resultNormal.normalize();
    164                         point = contactPoint;
    165                         depth = -(r-distance);
     149
     150                if (distanceSqr < radiusWithThreshold*radiusWithThreshold)
     151                {
     152                        if (distanceSqr>SIMD_EPSILON)
     153                        {
     154                                btScalar distance = btSqrt(distanceSqr);
     155                                resultNormal = contactToCentre;
     156                                resultNormal.normalize();
     157                                point = contactPoint;
     158                                depth = -(radius-distance);
     159                        } else
     160                        {
     161                                btScalar distance = 0.f;
     162                                resultNormal = normal;
     163                                point = contactPoint;
     164                                depth = -radius;
     165                        }
    166166                        return true;
    167167                }
    168 
    169                 if (delta.dot(contactToCentre) >= btScalar(0.0))
    170                         return false;
    171                
    172                 // Moving towards the contact point -> collision
    173                 point = contactPoint;
    174                 timeOfImpact = btScalar(0.0);
    175                 return true;
    176168        }
    177169       
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef SPHERE_TRIANGLE_DETECTOR_H
    17 #define SPHERE_TRIANGLE_DETECTOR_H
     16#ifndef BT_SPHERE_TRIANGLE_DETECTOR_H
     17#define BT_SPHERE_TRIANGLE_DETECTOR_H
    1818
    1919#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
     
    4848       
    4949};
    50 #endif //SPHERE_TRIANGLE_DETECTOR_H
     50#endif //BT_SPHERE_TRIANGLE_DETECTOR_H
    5151
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
    17 #define BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
     16#ifndef BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
     17#define BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
    1818
    1919#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
     
    6363};
    6464
    65 #endif //BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
     65#endif //BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
    6666
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef BOX_BOX__COLLISION_ALGORITHM_H
    17 #define BOX_BOX__COLLISION_ALGORITHM_H
     16#ifndef BT_BOX_BOX__COLLISION_ALGORITHM_H
     17#define BT_BOX_BOX__COLLISION_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    6363};
    6464
    65 #endif //BOX_BOX__COLLISION_ALGORITHM_H
     65#endif //BT_BOX_BOX__COLLISION_ALGORITHM_H
    6666
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.h

    r5781 r8393  
    17173. This notice may not be removed or altered from any source distribution.
    1818*/
    19 #ifndef BOX_BOX_DETECTOR_H
    20 #define BOX_BOX_DETECTOR_H
     19#ifndef BT_BOX_BOX_DETECTOR_H
     20#define BT_BOX_BOX_DETECTOR_H
    2121
    2222
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionConfiguration.h

    r5781 r8393  
    1616#ifndef BT_COLLISION_CONFIGURATION
    1717#define BT_COLLISION_CONFIGURATION
     18
    1819struct btCollisionAlgorithmCreateFunc;
    1920
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef COLLISION_CREATE_FUNC
    17 #define COLLISION_CREATE_FUNC
     16#ifndef BT_COLLISION_CREATE_FUNC
     17#define BT_COLLISION_CREATE_FUNC
    1818
    1919#include "LinearMath/btAlignedObjectArray.h"
     
    4242        }
    4343};
    44 #endif //COLLISION_CREATE_FUNC
     44#endif //BT_COLLISION_CREATE_FUNC
    4545
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp

    r8351 r8393  
    9393        } else
    9494        {
    95                 mem = btAlignedAlloc(sizeof(btPersistentManifold),16);
    96 
     95                //we got a pool memory overflow, by default we fallback to dynamically allocate memory. If we require a contiguous contact pool then assert.
     96                if ((m_dispatcherFlags&CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION)==0)
     97                {
     98                        mem = btAlignedAlloc(sizeof(btPersistentManifold),16);
     99                } else
     100                {
     101                        btAssert(0);
     102                        //make sure to increase the m_defaultMaxPersistentManifoldPoolSize in the btDefaultCollisionConstructionInfo/btDefaultCollisionConfiguration
     103                        return 0;
     104                }
    97105        }
    98106        btPersistentManifold* manifold = new(mem) btPersistentManifold (body0,body1,0,contactBreakingThreshold,contactProcessingThreshold);
     
    173181        {
    174182                //broadphase filtering already deals with this
    175                 if ((body0->isStaticObject() || body0->isKinematicObject()) &&
    176                         (body1->isStaticObject() || body1->isKinematicObject()))
     183                if (body0->isStaticOrKinematicObject() && body1->isStaticOrKinematicObject())
    177184                {
    178185                        m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED;
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef COLLISION__DISPATCHER_H
    17 #define COLLISION__DISPATCHER_H
     16#ifndef BT_COLLISION__DISPATCHER_H
     17#define BT_COLLISION__DISPATCHER_H
    1818
    1919#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
     
    4343class btCollisionDispatcher : public btDispatcher
    4444{
     45
     46protected:
     47
    4548        int             m_dispatcherFlags;
    46        
     49
    4750        btAlignedObjectArray<btPersistentManifold*>     m_manifoldsPtr;
    4851
     
    6568        {
    6669                CD_STATIC_STATIC_REPORTED = 1,
    67                 CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2
     70                CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2,
     71                CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION = 4
    6872        };
    6973
     
    7579        void    setDispatcherFlags(int flags)
    7680        {
    77         (void) flags;
    78                 m_dispatcherFlags = 0;
     81                m_dispatcherFlags = flags;
    7982        }
    8083
     
    154157        }
    155158
     159        virtual btPoolAllocator*        getInternalManifoldPool()
     160        {
     161                return m_persistentManifoldPoolAllocator;
     162        }
     163
     164        virtual const btPoolAllocator*  getInternalManifoldPool() const
     165        {
     166                return m_persistentManifoldPoolAllocator;
     167        }
     168
    156169};
    157170
    158 #endif //COLLISION__DISPATCHER_H
     171#endif //BT_COLLISION__DISPATCHER_H
    159172
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef COLLISION_OBJECT_H
    17 #define COLLISION_OBJECT_H
     16#ifndef BT_COLLISION_OBJECT_H
     17#define BT_COLLISION_OBJECT_H
    1818
    1919#include "LinearMath/btTransform.h"
     
    522522
    523523
    524 #endif //COLLISION_OBJECT_H
     524#endif //BT_COLLISION_OBJECT_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp

    r8351 r8393  
    2929#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
    3030#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
     31#include "BulletCollision/BroadphaseCollision/btDbvt.h"
    3132#include "LinearMath/btAabbUtil2.h"
    3233#include "LinearMath/btQuickprof.h"
    3334#include "LinearMath/btStackAlloc.h"
    3435#include "LinearMath/btSerializer.h"
     36#include "BulletCollision/CollisionShapes/btConvexPolyhedron.h"
     37
     38//#define DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
     39
    3540
    3641//#define USE_BRUTEFORCE_RAYBROADPHASE 1
     
    151156        maxAabb += contactThreshold;
    152157
     158        if(getDispatchInfo().m_useContinuous && colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
     159        {
     160                btVector3 minAabb2,maxAabb2;
     161                colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
     162                minAabb2 -= contactThreshold;
     163                maxAabb2 += contactThreshold;
     164                minAabb.setMin(minAabb2);
     165                maxAabb.setMax(maxAabb2);
     166        }
     167
    153168        btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache;
    154169
     
    421436                } else {
    422437                        //                      BT_PROFILE("rayTestCompound");
    423                         ///@todo: use AABB tree or other BVH acceleration structure, see btDbvt
    424438                        if (collisionShape->isCompound())
    425439                        {
     440                                struct LocalInfoAdder2 : public RayResultCallback
     441                                {
     442                                        RayResultCallback* m_userCallback;
     443                                        int m_i;
     444                                       
     445                                        LocalInfoAdder2 (int i, RayResultCallback *user)
     446                                                : m_userCallback(user), m_i(i)
     447                                        {
     448                                                m_closestHitFraction = m_userCallback->m_closestHitFraction;
     449                                        }
     450                                        virtual bool needsCollision(btBroadphaseProxy* p) const
     451                                        {
     452                                                return m_userCallback->needsCollision(p);
     453                                        }
     454
     455                                        virtual btScalar addSingleResult (btCollisionWorld::LocalRayResult &r, bool b)
     456                                        {
     457                                                btCollisionWorld::LocalShapeInfo shapeInfo;
     458                                                shapeInfo.m_shapePart = -1;
     459                                                shapeInfo.m_triangleIndex = m_i;
     460                                                if (r.m_localShapeInfo == NULL)
     461                                                        r.m_localShapeInfo = &shapeInfo;
     462
     463                                                const btScalar result = m_userCallback->addSingleResult(r, b);
     464                                                m_closestHitFraction = m_userCallback->m_closestHitFraction;
     465                                                return result;
     466                                        }
     467                                };
     468                               
     469                                struct RayTester : btDbvt::ICollide
     470                                {
     471                                        btCollisionObject* m_collisionObject;
     472                                        const btCompoundShape* m_compoundShape;
     473                                        const btTransform& m_colObjWorldTransform;
     474                                        const btTransform& m_rayFromTrans;
     475                                        const btTransform& m_rayToTrans;
     476                                        RayResultCallback& m_resultCallback;
     477                                       
     478                                        RayTester(btCollisionObject* collisionObject,
     479                                                        const btCompoundShape* compoundShape,
     480                                                        const btTransform& colObjWorldTransform,
     481                                                        const btTransform& rayFromTrans,
     482                                                        const btTransform& rayToTrans,
     483                                                        RayResultCallback& resultCallback):
     484                                                m_collisionObject(collisionObject),
     485                                                m_compoundShape(compoundShape),
     486                                                m_colObjWorldTransform(colObjWorldTransform),
     487                                                m_rayFromTrans(rayFromTrans),
     488                                                m_rayToTrans(rayToTrans),
     489                                                m_resultCallback(resultCallback)
     490                                        {
     491                                               
     492                                        }
     493                                       
     494                                        void Process(int i)
     495                                        {
     496                                                const btCollisionShape* childCollisionShape = m_compoundShape->getChildShape(i);
     497                                                const btTransform& childTrans = m_compoundShape->getChildTransform(i);
     498                                                btTransform childWorldTrans = m_colObjWorldTransform * childTrans;
     499                                               
     500                                                // replace collision shape so that callback can determine the triangle
     501                                                btCollisionShape* saveCollisionShape = m_collisionObject->getCollisionShape();
     502                                                m_collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
     503
     504                                                LocalInfoAdder2 my_cb(i, &m_resultCallback);
     505
     506                                                rayTestSingle(
     507                                                        m_rayFromTrans,
     508                                                        m_rayToTrans,
     509                                                        m_collisionObject,
     510                                                        childCollisionShape,
     511                                                        childWorldTrans,
     512                                                        my_cb);
     513                                               
     514                                                // restore
     515                                                m_collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
     516                                        }
     517                                       
     518                                        void Process(const btDbvtNode* leaf)
     519                                        {
     520                                                Process(leaf->dataAsInt);
     521                                        }
     522                                };
     523                               
    426524                                const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(collisionShape);
    427                                 int i=0;
    428                                 for (i=0;i<compoundShape->getNumChildShapes();i++)
    429                                 {
    430                                         btTransform childTrans = compoundShape->getChildTransform(i);
    431                                         const btCollisionShape* childCollisionShape = compoundShape->getChildShape(i);
    432                                         btTransform childWorldTrans = colObjWorldTransform * childTrans;
    433                                         // replace collision shape so that callback can determine the triangle
    434                                         btCollisionShape* saveCollisionShape = collisionObject->getCollisionShape();
    435                                         collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
    436                     struct LocalInfoAdder2 : public RayResultCallback {
    437                                                 RayResultCallback* m_userCallback;
    438                                                 int m_i;
    439                         LocalInfoAdder2 (int i, RayResultCallback *user)
    440                                                         : m_userCallback(user),
    441                                                         m_i(i)
    442                                                 {
    443                                                         m_closestHitFraction = m_userCallback->m_closestHitFraction;
    444                                                 }
    445                                                 virtual btScalar addSingleResult (btCollisionWorld::LocalRayResult &r, bool b)
    446                             {
    447                                     btCollisionWorld::LocalShapeInfo    shapeInfo;
    448                                     shapeInfo.m_shapePart = -1;
    449                                     shapeInfo.m_triangleIndex = m_i;
    450                                     if (r.m_localShapeInfo == NULL)
    451                                         r.m_localShapeInfo = &shapeInfo;
    452 
    453                                                                         const btScalar result = m_userCallback->addSingleResult(r, b);
    454                                                                         m_closestHitFraction = m_userCallback->m_closestHitFraction;
    455                                                                         return result;
    456                             }
    457                     };
    458 
    459                     LocalInfoAdder2 my_cb(i, &resultCallback);
    460 
    461                                         rayTestSingle(rayFromTrans,rayToTrans,
    462                                                 collisionObject,
    463                                                 childCollisionShape,
    464                                                 childWorldTrans,
    465                                                 my_cb);
    466                                         // restore
    467                                         collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
     525                                const btDbvt* dbvt = compoundShape->getDynamicAabbTree();
     526
     527
     528                                RayTester rayCB(
     529                                        collisionObject,
     530                                        compoundShape,
     531                                        colObjWorldTransform,
     532                                        rayFromTrans,
     533                                        rayToTrans,
     534                                        resultCallback);
     535#ifndef DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
     536                                if (dbvt)
     537                                {
     538                                        btVector3 localRayFrom = colObjWorldTransform.inverseTimes(rayFromTrans).getOrigin();
     539                                        btVector3 localRayTo = colObjWorldTransform.inverseTimes(rayToTrans).getOrigin();
     540                                        btDbvt::rayTest(dbvt->m_root, localRayFrom , localRayTo, rayCB);
     541                                }
     542                                else
     543#endif //DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
     544                                {
     545                                        for (int i = 0, n = compoundShape->getNumChildShapes(); i < n; ++i)
     546                                        {
     547                                                rayCB.Process(i);
     548                                        }       
    468549                                }
    469550                        }
     
    577658                                BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,triangleMesh, colObjWorldTransform);
    578659                                tccb.m_hitFraction = resultCallback.m_closestHitFraction;
     660                                tccb.m_allowedPenetration = allowedPenetration;
    579661                                btVector3 boxMinLocal, boxMaxLocal;
    580662                                castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
     
    582664                        } else
    583665                        {
    584                                 //BT_PROFILE("convexSweepConcave");
    585                                 btConcaveShape* concaveShape = (btConcaveShape*)collisionShape;
    586                                 btTransform worldTocollisionObject = colObjWorldTransform.inverse();
    587                                 btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin();
    588                                 btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin();
    589                                 // rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation
    590                                 btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis());
    591 
    592                                 //ConvexCast::CastResult
    593                                 struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback
    594                                 {
    595                                         btCollisionWorld::ConvexResultCallback* m_resultCallback;
    596                                         btCollisionObject*      m_collisionObject;
    597                                         btConcaveShape* m_triangleMesh;
    598 
    599                                         BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
    600                                                 btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*      triangleMesh, const btTransform& triangleToWorld):
    601                                         btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
    602                                                 m_resultCallback(resultCallback),
    603                                                 m_collisionObject(collisionObject),
    604                                                 m_triangleMesh(triangleMesh)
    605                                         {
     666                                if (collisionShape->getShapeType()==STATIC_PLANE_PROXYTYPE)
     667                                {
     668                                        btConvexCast::CastResult castResult;
     669                                        castResult.m_allowedPenetration = allowedPenetration;
     670                                        castResult.m_fraction = resultCallback.m_closestHitFraction;
     671                                        btStaticPlaneShape* planeShape = (btStaticPlaneShape*) collisionShape;
     672                                        btContinuousConvexCollision convexCaster1(castShape,planeShape);
     673                                        btConvexCast* castPtr = &convexCaster1;
     674
     675                                        if (castPtr->calcTimeOfImpact(convexFromTrans,convexToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
     676                                        {
     677                                                //add hit
     678                                                if (castResult.m_normal.length2() > btScalar(0.0001))
     679                                                {
     680                                                        if (castResult.m_fraction < resultCallback.m_closestHitFraction)
     681                                                        {
     682                                                                castResult.m_normal.normalize();
     683                                                                btCollisionWorld::LocalConvexResult localConvexResult
     684                                                                        (
     685                                                                        collisionObject,
     686                                                                        0,
     687                                                                        castResult.m_normal,
     688                                                                        castResult.m_hitPoint,
     689                                                                        castResult.m_fraction
     690                                                                        );
     691
     692                                                                bool normalInWorldSpace = true;
     693                                                                resultCallback.addSingleResult(localConvexResult, normalInWorldSpace);
     694                                                        }
     695                                                }
    606696                                        }
    607697
    608 
    609                                         virtual btScalar reportHit(const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex )
    610                                         {
    611                                                 btCollisionWorld::LocalShapeInfo        shapeInfo;
    612                                                 shapeInfo.m_shapePart = partId;
    613                                                 shapeInfo.m_triangleIndex = triangleIndex;
    614                                                 if (hitFraction <= m_resultCallback->m_closestHitFraction)
     698                                } else
     699                                {
     700                                        //BT_PROFILE("convexSweepConcave");
     701                                        btConcaveShape* concaveShape = (btConcaveShape*)collisionShape;
     702                                        btTransform worldTocollisionObject = colObjWorldTransform.inverse();
     703                                        btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin();
     704                                        btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin();
     705                                        // rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation
     706                                        btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis());
     707
     708                                        //ConvexCast::CastResult
     709                                        struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback
     710                                        {
     711                                                btCollisionWorld::ConvexResultCallback* m_resultCallback;
     712                                                btCollisionObject*      m_collisionObject;
     713                                                btConcaveShape* m_triangleMesh;
     714
     715                                                BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
     716                                                        btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*      triangleMesh, const btTransform& triangleToWorld):
     717                                                btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
     718                                                        m_resultCallback(resultCallback),
     719                                                        m_collisionObject(collisionObject),
     720                                                        m_triangleMesh(triangleMesh)
    615721                                                {
    616 
    617                                                         btCollisionWorld::LocalConvexResult convexResult
    618                                                                 (m_collisionObject,
    619                                                                 &shapeInfo,
    620                                                                 hitNormalLocal,
    621                                                                 hitPointLocal,
    622                                                                 hitFraction);
    623 
    624                                                         bool    normalInWorldSpace = false;
    625 
    626                                                         return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
    627722                                                }
    628                                                 return hitFraction;
    629                                         }
    630 
    631                                 };
    632 
    633                                 BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
    634                                 tccb.m_hitFraction = resultCallback.m_closestHitFraction;
    635                                 btVector3 boxMinLocal, boxMaxLocal;
    636                                 castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
    637 
    638                                 btVector3 rayAabbMinLocal = convexFromLocal;
    639                                 rayAabbMinLocal.setMin(convexToLocal);
    640                                 btVector3 rayAabbMaxLocal = convexFromLocal;
    641                                 rayAabbMaxLocal.setMax(convexToLocal);
    642                                 rayAabbMinLocal += boxMinLocal;
    643                                 rayAabbMaxLocal += boxMaxLocal;
    644                                 concaveShape->processAllTriangles(&tccb,rayAabbMinLocal,rayAabbMaxLocal);
     723
     724
     725                                                virtual btScalar reportHit(const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex )
     726                                                {
     727                                                        btCollisionWorld::LocalShapeInfo        shapeInfo;
     728                                                        shapeInfo.m_shapePart = partId;
     729                                                        shapeInfo.m_triangleIndex = triangleIndex;
     730                                                        if (hitFraction <= m_resultCallback->m_closestHitFraction)
     731                                                        {
     732
     733                                                                btCollisionWorld::LocalConvexResult convexResult
     734                                                                        (m_collisionObject,
     735                                                                        &shapeInfo,
     736                                                                        hitNormalLocal,
     737                                                                        hitPointLocal,
     738                                                                        hitFraction);
     739
     740                                                                bool    normalInWorldSpace = false;
     741
     742                                                                return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
     743                                                        }
     744                                                        return hitFraction;
     745                                                }
     746
     747                                        };
     748
     749                                        BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
     750                                        tccb.m_hitFraction = resultCallback.m_closestHitFraction;
     751                                        tccb.m_allowedPenetration = allowedPenetration;
     752                                        btVector3 boxMinLocal, boxMaxLocal;
     753                                        castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
     754
     755                                        btVector3 rayAabbMinLocal = convexFromLocal;
     756                                        rayAabbMinLocal.setMin(convexToLocal);
     757                                        btVector3 rayAabbMaxLocal = convexFromLocal;
     758                                        rayAabbMaxLocal.setMax(convexToLocal);
     759                                        rayAabbMinLocal += boxMinLocal;
     760                                        rayAabbMaxLocal += boxMaxLocal;
     761                                        concaveShape->processAllTriangles(&tccb,rayAabbMinLocal,rayAabbMaxLocal);
     762                                }
    645763                        }
    646764                } else {
     
    667785                                                        {
    668786                                                                m_closestHitFraction = m_userCallback->m_closestHitFraction;
     787                                                        }
     788                                                        virtual bool needsCollision(btBroadphaseProxy* p) const
     789                                                        {
     790                                                                return m_userCallback->needsCollision(p);
    669791                                                        }
    670792                            virtual btScalar addSingleResult (btCollisionWorld::LocalConvexResult&      r,      bool b)
     
    11521274
    11531275                                int upAxis = capsuleShape->getUpAxis();
    1154 
    1155 
    1156                                 btVector3 capStart(0.f,0.f,0.f);
    1157                                 capStart[upAxis] = -halfHeight;
    1158 
    1159                                 btVector3 capEnd(0.f,0.f,0.f);
    1160                                 capEnd[upAxis] = halfHeight;
    1161 
    1162                                 // Draw the ends
    1163                                 {
    1164 
    1165                                         btTransform childTransform = worldTransform;
    1166                                         childTransform.getOrigin() = worldTransform * capStart;
    1167                                         getDebugDrawer()->drawSphere(radius, childTransform, color);
    1168                                 }
    1169 
    1170                                 {
    1171                                         btTransform childTransform = worldTransform;
    1172                                         childTransform.getOrigin() = worldTransform * capEnd;
    1173                                         getDebugDrawer()->drawSphere(radius, childTransform, color);
    1174                                 }
    1175 
    1176                                 // Draw some additional lines
    1177                                 btVector3 start = worldTransform.getOrigin();
    1178 
    1179 
    1180                                 capStart[(upAxis+1)%3] = radius;
    1181                                 capEnd[(upAxis+1)%3] = radius;
    1182                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * capStart,start+worldTransform.getBasis() * capEnd, color);
    1183                                 capStart[(upAxis+1)%3] = -radius;
    1184                                 capEnd[(upAxis+1)%3] = -radius;
    1185                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * capStart,start+worldTransform.getBasis() * capEnd, color);
    1186 
    1187                                 capStart[(upAxis+1)%3] = 0.f;
    1188                                 capEnd[(upAxis+1)%3] = 0.f;
    1189 
    1190                                 capStart[(upAxis+2)%3] = radius;
    1191                                 capEnd[(upAxis+2)%3] = radius;
    1192                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * capStart,start+worldTransform.getBasis() * capEnd, color);
    1193                                 capStart[(upAxis+2)%3] = -radius;
    1194                                 capEnd[(upAxis+2)%3] = -radius;
    1195                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * capStart,start+worldTransform.getBasis() * capEnd, color);
    1196 
    1197 
     1276                                getDebugDrawer()->drawCapsule(radius, halfHeight, upAxis, worldTransform, color);
    11981277                                break;
    11991278                        }
     
    12031282                                btScalar radius = coneShape->getRadius();//+coneShape->getMargin();
    12041283                                btScalar height = coneShape->getHeight();//+coneShape->getMargin();
    1205                                 btVector3 start = worldTransform.getOrigin();
    12061284
    12071285                                int upAxis= coneShape->getConeUpIndex();
    1208 
    1209 
    1210                                 btVector3       offsetHeight(0,0,0);
    1211                                 offsetHeight[upAxis] = height * btScalar(0.5);
    1212                                 btVector3       offsetRadius(0,0,0);
    1213                                 offsetRadius[(upAxis+1)%3] = radius;
    1214                                 btVector3       offset2Radius(0,0,0);
    1215                                 offset2Radius[(upAxis+2)%3] = radius;
    1216 
    1217                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offsetRadius),color);
    1218                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offsetRadius),color);
    1219                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight+offset2Radius),color);
    1220                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight),start+worldTransform.getBasis() * (-offsetHeight-offset2Radius),color);
    1221 
    1222                                 // Drawing the base of the cone
    1223                                 btVector3 yaxis(0,0,0);
    1224                                 yaxis[upAxis] = btScalar(1.0);
    1225                                 btVector3 xaxis(0,0,0);
    1226                                 xaxis[(upAxis+1)%3] = btScalar(1.0);
    1227                                 getDebugDrawer()->drawArc(start-worldTransform.getBasis()*(offsetHeight),worldTransform.getBasis()*yaxis,worldTransform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,10.0);
    1228                 break;
     1286                                getDebugDrawer()->drawCone(radius, height, upAxis, worldTransform, color);
     1287                                break;
    12291288
    12301289                        }
     
    12351294                                btScalar radius = cylinder->getRadius();
    12361295                                btScalar halfHeight = cylinder->getHalfExtentsWithMargin()[upAxis];
    1237                                 btVector3 start = worldTransform.getOrigin();
    1238                                 btVector3       offsetHeight(0,0,0);
    1239                                 offsetHeight[upAxis] = halfHeight;
    1240                                 btVector3       offsetRadius(0,0,0);
    1241                                 offsetRadius[(upAxis+1)%3] = radius;
    1242                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight+offsetRadius),start+worldTransform.getBasis() * (-offsetHeight+offsetRadius),color);
    1243                                 getDebugDrawer()->drawLine(start+worldTransform.getBasis() * (offsetHeight-offsetRadius),start+worldTransform.getBasis() * (-offsetHeight-offsetRadius),color);
    1244 
    1245                                 // Drawing top and bottom caps of the cylinder
    1246                                 btVector3 yaxis(0,0,0);
    1247                                 yaxis[upAxis] = btScalar(1.0);
    1248                                 btVector3 xaxis(0,0,0);
    1249                                 xaxis[(upAxis+1)%3] = btScalar(1.0);
    1250                                 getDebugDrawer()->drawArc(start-worldTransform.getBasis()*(offsetHeight),worldTransform.getBasis()*yaxis,worldTransform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
    1251                                 getDebugDrawer()->drawArc(start+worldTransform.getBasis()*(offsetHeight),worldTransform.getBasis()*yaxis,worldTransform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
     1296                                getDebugDrawer()->drawCylinder(radius, halfHeight, upAxis, worldTransform, color);
    12521297                                break;
    12531298                        }
     
    12581303                                btScalar planeConst = staticPlaneShape->getPlaneConstant();
    12591304                                const btVector3& planeNormal = staticPlaneShape->getPlaneNormal();
    1260                                 btVector3 planeOrigin = planeNormal * planeConst;
    1261                                 btVector3 vec0,vec1;
    1262                                 btPlaneSpace1(planeNormal,vec0,vec1);
    1263                                 btScalar vecLen = 100.f;
    1264                                 btVector3 pt0 = planeOrigin + vec0*vecLen;
    1265                                 btVector3 pt1 = planeOrigin - vec0*vecLen;
    1266                                 btVector3 pt2 = planeOrigin + vec1*vecLen;
    1267                                 btVector3 pt3 = planeOrigin - vec1*vecLen;
    1268                                 getDebugDrawer()->drawLine(worldTransform*pt0,worldTransform*pt1,color);
    1269                                 getDebugDrawer()->drawLine(worldTransform*pt2,worldTransform*pt3,color);
     1305                                getDebugDrawer()->drawPlane(planeNormal, planeConst,worldTransform, color);
    12701306                                break;
    12711307
     
    13051341
    13061342                                        int i;
    1307                                         for (i=0;i<polyshape->getNumEdges();i++)
    1308                                         {
    1309                                                 btVector3 a,b;
    1310                                                 polyshape->getEdge(i,a,b);
    1311                                                 btVector3 wa = worldTransform * a;
    1312                                                 btVector3 wb = worldTransform * b;
    1313                                                 getDebugDrawer()->drawLine(wa,wb,color);
    1314 
     1343                                        if (polyshape->getConvexPolyhedron())
     1344                                        {
     1345                                                const btConvexPolyhedron* poly = polyshape->getConvexPolyhedron();
     1346                                                for (i=0;i<poly->m_faces.size();i++)
     1347                                                {
     1348                                                        btVector3 centroid(0,0,0);
     1349                                                        int numVerts = poly->m_faces[i].m_indices.size();
     1350                                                        if (numVerts)
     1351                                                        {
     1352                                                                int lastV = poly->m_faces[i].m_indices[numVerts-1];
     1353                                                                for (int v=0;v<poly->m_faces[i].m_indices.size();v++)
     1354                                                                {
     1355                                                                        int curVert = poly->m_faces[i].m_indices[v];
     1356                                                                        centroid+=poly->m_vertices[curVert];
     1357                                                                        getDebugDrawer()->drawLine(worldTransform*poly->m_vertices[lastV],worldTransform*poly->m_vertices[curVert],color);
     1358                                                                        lastV = curVert;
     1359                                                                }
     1360                                                        }
     1361                                                        centroid*= 1./btScalar(numVerts);
     1362
     1363                                                        btVector3 normalColor(1,1,0);
     1364                                                        btVector3 faceNormal(poly->m_faces[i].m_plane[0],poly->m_faces[i].m_plane[1],poly->m_faces[i].m_plane[2]);
     1365                                                        getDebugDrawer()->drawLine(worldTransform*centroid,worldTransform*(centroid+faceNormal),normalColor);
     1366                                                       
     1367                                                       
     1368                                                }
     1369
     1370                                               
     1371                                        } else
     1372                                        {
     1373                                                for (i=0;i<polyshape->getNumEdges();i++)
     1374                                                {
     1375                                                        btVector3 a,b;
     1376                                                        polyshape->getEdge(i,a,b);
     1377                                                        btVector3 wa = worldTransform * a;
     1378                                                        btVector3 wb = worldTransform * b;
     1379                                                        getDebugDrawer()->drawLine(wa,wb,color);
     1380                                                }
    13151381                                        }
    13161382
     
    13811447                                        btVector3 colorvec(1,0,0);
    13821448                                        colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
     1449                                        btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
     1450                                        minAabb -= contactThreshold;
     1451                                        maxAabb += contactThreshold;
     1452
     1453                                        btVector3 minAabb2,maxAabb2;
     1454
     1455                                        if(colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
     1456                                        {
     1457                                                colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
     1458                                                minAabb2 -= contactThreshold;
     1459                                                maxAabb2 += contactThreshold;
     1460                                                minAabb.setMin(minAabb2);
     1461                                                maxAabb.setMax(maxAabb2);
     1462                                        }
     1463
    13831464                                        m_debugDrawer->drawAabb(minAabb,maxAabb,colorvec);
    13841465                                }
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h

    r8351 r8393  
    6363 
    6464
    65 #ifndef COLLISION_WORLD_H
    66 #define COLLISION_WORLD_H
     65#ifndef BT_COLLISION_WORLD_H
     66#define BT_COLLISION_WORLD_H
    6767
    6868class btStackAlloc;
     
    507507
    508508
    509 #endif //COLLISION_WORLD_H
     509#endif //BT_COLLISION_WORLD_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp

    r8351 r8393  
    235235                                        }
    236236                                }
    237                                 manifoldArray.clear();
     237                                manifoldArray.resize(0);
    238238                        }
    239239                }
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef COMPOUND_COLLISION_ALGORITHM_H
    17 #define COMPOUND_COLLISION_ALGORITHM_H
     16#ifndef BT_COMPOUND_COLLISION_ALGORITHM_H
     17#define BT_COMPOUND_COLLISION_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    8484};
    8585
    86 #endif //COMPOUND_COLLISION_ALGORITHM_H
     86#endif //BT_COMPOUND_COLLISION_ALGORITHM_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONVEX_2D_CONVEX_2D_ALGORITHM_H
    17 #define CONVEX_2D_CONVEX_2D_ALGORITHM_H
     16#ifndef BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
     17#define BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
    1818
    1919#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
     
    9393};
    9494
    95 #endif //CONVEX_2D_CONVEX_2D_ALGORITHM_H
     95#endif //BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp

    r8351 r8393  
    9292
    9393
    94        
     94#if 0   
    9595        ///debug drawing of the overlapping triangles
    9696        if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe ))
     
    101101                m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(triangle[2]),color);
    102102                m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(triangle[0]),color);
    103 
    104                 //btVector3 center = triangle[0] + triangle[1]+triangle[2];
    105                 //center *= btScalar(0.333333);
    106                 //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(center),color);
    107                 //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(center),color);
    108                 //m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(center),color);
    109 
    110         }
    111 
    112 
    113         //btCollisionObject* colObj = static_cast<btCollisionObject*>(m_convexProxy->m_clientObject);
     103        }
     104#endif
    114105       
    115106        if (m_convexBody->getCollisionShape()->isConvex())
     
    120111                btCollisionShape* tmpShape = ob->getCollisionShape();
    121112                ob->internalSetTemporaryCollisionShape( &tm );
    122                
     113
    123114                btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr);
    124115
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef CONVEX_CONCAVE_COLLISION_ALGORITHM_H
    17 #define CONVEX_CONCAVE_COLLISION_ALGORITHM_H
     16#ifndef BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
     17#define BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    114114};
    115115
    116 #endif //CONVEX_CONCAVE_COLLISION_ALGORITHM_H
     116#endif //BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp

    r8351 r8393  
    2727#include "BulletCollision/CollisionShapes/btConvexShape.h"
    2828#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
     29#include "BulletCollision/CollisionShapes/btTriangleShape.h"
     30
    2931
    3032
     
    4951#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
    5052#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
    51 
     53#include "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h"
    5254
    5355
     
    332334
    333335
     336
     337
    334338#ifdef USE_SEPDISTANCE_UTIL2
    335339        if (dispatchInfo.m_useConvexConservativeDistanceUtil)
     
    358362#endif //USE_SEPDISTANCE_UTIL2
    359363        {
    360                 if (dispatchInfo.m_convexMaxDistanceUseCPT)
    361                 {
    362                         input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactProcessingThreshold();
    363                 } else
    364                 {
    365                         input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
    366                 }
     364                //if (dispatchInfo.m_convexMaxDistanceUseCPT)
     365                //{
     366                //      input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactProcessingThreshold();
     367                //} else
     368                //{
     369                input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
     370//              }
     371
    367372                input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
    368373        }
     
    372377        input.m_transformB = body1->getWorldTransform();
    373378
    374         gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
     379
    375380
    376381       
     
    389394        }
    390395#endif //USE_SEPDISTANCE_UTIL2
     396
     397        if (min0->isPolyhedral() && min1->isPolyhedral())
     398        {
     399
     400
     401                struct btDummyResult : public btDiscreteCollisionDetectorInterface::Result
     402                {
     403                        virtual void setShapeIdentifiersA(int partId0,int index0){}
     404                        virtual void setShapeIdentifiersB(int partId1,int index1){}
     405                        virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
     406                        {
     407                        }
     408                };
     409               
     410                btDummyResult dummy;
     411
     412
     413                btPolyhedralConvexShape* polyhedronA = (btPolyhedralConvexShape*) min0;
     414                btPolyhedralConvexShape* polyhedronB = (btPolyhedralConvexShape*) min1;
     415                if (polyhedronA->getConvexPolyhedron() && polyhedronB->getConvexPolyhedron())
     416                {
     417
     418
     419                        gjkPairDetector.getClosestPoints(input,dummy,dispatchInfo.m_debugDraw);
     420                       
     421
     422                        btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
     423
     424                        btScalar minDist = 0.f;
     425                        btVector3 sepNormalWorldSpace;
     426                        bool foundSepAxis  = true;
     427
     428                        if (dispatchInfo.m_enableSatConvex)
     429                        {
     430                                foundSepAxis = btPolyhedralContactClipping::findSeparatingAxis(
     431                                        *polyhedronA->getConvexPolyhedron(), *polyhedronB->getConvexPolyhedron(),
     432                                        body0->getWorldTransform(),
     433                                        body1->getWorldTransform(),
     434                                        sepNormalWorldSpace);
     435                        } else
     436                        {
     437                                sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
     438                                minDist = gjkPairDetector.getCachedSeparatingDistance();
     439                        }
     440                        if (foundSepAxis)
     441                        {
     442//                              printf("sepNormalWorldSpace=%f,%f,%f\n",sepNormalWorldSpace.getX(),sepNormalWorldSpace.getY(),sepNormalWorldSpace.getZ());
     443
     444                                btPolyhedralContactClipping::clipHullAgainstHull(sepNormalWorldSpace, *polyhedronA->getConvexPolyhedron(), *polyhedronB->getConvexPolyhedron(),
     445                                        body0->getWorldTransform(),
     446                                        body1->getWorldTransform(), minDist-threshold, threshold, *resultOut);
     447                               
     448                        }
     449                        if (m_ownManifold)
     450                        {
     451                                resultOut->refreshContactPoints();
     452                        }
     453                        return;
     454
     455                } else
     456                {
     457                        //we can also deal with convex versus triangle (without connectivity data)
     458                        if (polyhedronA->getConvexPolyhedron() && polyhedronB->getShapeType()==TRIANGLE_SHAPE_PROXYTYPE)
     459                        {
     460                                gjkPairDetector.getClosestPoints(input,dummy,dispatchInfo.m_debugDraw);
     461               
     462                                btVector3 sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
     463
     464                                btVertexArray vertices;
     465                                btTriangleShape* tri = (btTriangleShape*)polyhedronB;
     466                                vertices.push_back(     body1->getWorldTransform()*tri->m_vertices1[0]);
     467                                vertices.push_back(     body1->getWorldTransform()*tri->m_vertices1[1]);
     468                                vertices.push_back(     body1->getWorldTransform()*tri->m_vertices1[2]);
     469
     470                                btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
     471                                btScalar minDist = gjkPairDetector.getCachedSeparatingDistance();
     472                                btPolyhedralContactClipping::clipFaceAgainstHull(sepNormalWorldSpace, *polyhedronA->getConvexPolyhedron(),
     473                                        body0->getWorldTransform(), vertices, minDist-threshold, threshold, *resultOut);
     474                               
     475                               
     476                                if (m_ownManifold)
     477                                {
     478                                        resultOut->refreshContactPoints();
     479                                }
     480                               
     481                                return;
     482                        }
     483                       
     484                }
     485
     486
     487        }
     488       
     489        gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
    391490
    392491        //now perform 'm_numPerturbationIterations' collision queries with the perturbated collision objects
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONVEX_CONVEX_ALGORITHM_H
    17 #define CONVEX_CONVEX_ALGORITHM_H
     16#ifndef BT_CONVEX_CONVEX_ALGORITHM_H
     17#define BT_CONVEX_CONVEX_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    107107};
    108108
    109 #endif //CONVEX_CONVEX_ALGORITHM_H
     109#endif //BT_CONVEX_CONVEX_ALGORITHM_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONVEX_PLANE_COLLISION_ALGORITHM_H
    17 #define CONVEX_PLANE_COLLISION_ALGORITHM_H
     16#ifndef BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
     17#define BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
    1818
    1919#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
     
    8181};
    8282
    83 #endif //CONVEX_PLANE_COLLISION_ALGORITHM_H
     83#endif //BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
    8484
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef EMPTY_ALGORITH
    17 #define EMPTY_ALGORITH
     16#ifndef BT_EMPTY_ALGORITH
     17#define BT_EMPTY_ALGORITH
    1818#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
    1919#include "btCollisionCreateFunc.h"
     
    5252} ATTRIBUTE_ALIGNED(16);
    5353
    54 #endif //EMPTY_ALGORITH
     54#endif //BT_EMPTY_ALGORITH
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp

    r8351 r8393  
    22
    33#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
     4#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
    45#include "BulletCollision/CollisionShapes/btTriangleShape.h"
    56#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
     
    910
    1011//#define DEBUG_INTERNAL_EDGE
    11 
    1212
    1313#ifdef DEBUG_INTERNAL_EDGE
     
    457457                return;
    458458
    459         btBvhTriangleMeshShape* trimesh = (btBvhTriangleMeshShape*)colObj0->getRootCollisionShape();
    460         btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
     459        btBvhTriangleMeshShape* trimesh = 0;
     460       
     461        if( colObj0->getRootCollisionShape()->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE )
     462           trimesh = ((btScaledBvhTriangleMeshShape*)colObj0->getRootCollisionShape())->getChildShape();
     463   else   
     464           trimesh = (btBvhTriangleMeshShape*)colObj0->getRootCollisionShape();
     465           
     466        btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
    461467        if (!triangleInfoMapPtr)
    462468                return;
     
    502508        btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
    503509        localContactNormalOnB.normalize();//is this necessary?
    504 
    505         if ((info->m_edgeV0V1Angle)< SIMD_2_PI)
     510       
     511        // Get closest edge
     512        int      bestedge=-1;
     513        float    disttobestedge=BT_LARGE_FLOAT;
     514        //
     515        // Edge 0 -> 1
     516        if (btFabs(info->m_edgeV0V1Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
     517        {       
     518           btVector3 nearest;
     519           btNearestPointInLineSegment( cp.m_localPointB, v0, v1, nearest );
     520           float     len=(contact-nearest).length();
     521           //
     522           if( len < disttobestedge )
     523           {
     524              bestedge=0;
     525              disttobestedge=len;
     526      }       
     527   }       
     528        // Edge 1 -> 2
     529        if (btFabs(info->m_edgeV1V2Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
     530        {       
     531           btVector3 nearest;
     532           btNearestPointInLineSegment( cp.m_localPointB, v1, v2, nearest );
     533           float     len=(contact-nearest).length();
     534           //
     535           if( len < disttobestedge )
     536           {
     537              bestedge=1;
     538              disttobestedge=len;
     539      }       
     540   }       
     541        // Edge 2 -> 0
     542        if (btFabs(info->m_edgeV2V0Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
     543        {       
     544           btVector3 nearest;
     545           btNearestPointInLineSegment( cp.m_localPointB, v2, v0, nearest );
     546           float     len=(contact-nearest).length();
     547           //
     548           if( len < disttobestedge )
     549           {
     550              bestedge=2;
     551              disttobestedge=len;
     552      }       
     553   }           
     554       
     555#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
     556   btVector3 upfix=tri_normal * btVector3(0.1f,0.1f,0.1f);
     557   btDebugDrawLine(tr * v0 + upfix, tr * v1 + upfix, red );
     558#endif   
     559        if (btFabs(info->m_edgeV0V1Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
    506560        {
    507561#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
     
    510564                btScalar len = (contact-nearest).length();
    511565                if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
     566                if( bestedge==0 )
    512567                {
    513568                        btVector3 edge(v0-v1);
     
    578633#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
    579634
    580         if ((info->m_edgeV1V2Angle)< SIMD_2_PI)
     635#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
     636   btDebugDrawLine(tr * v1 + upfix, tr * v2 + upfix , green );
     637#endif   
     638
     639        if (btFabs(info->m_edgeV1V2Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
    581640        {
    582641#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
     
    588647                btScalar len = (contact-nearest).length();
    589648                if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
     649                if( bestedge==1 )
    590650                {
    591651                        isNearEdge = true;
     
    659719        btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,blue);
    660720#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
    661 
    662         if ((info->m_edgeV2V0Angle)< SIMD_2_PI)
     721#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
     722   btDebugDrawLine(tr * v2 + upfix, tr * v0 + upfix , blue );
     723#endif   
     724
     725        if (btFabs(info->m_edgeV2V0Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
    663726        {
    664727
     
    669732                btScalar len = (contact-nearest).length();
    670733                if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
     734                if( bestedge==2 )
    671735                {
    672736                        isNearEdge = true;
     
    760824                        } else
    761825                        {
     826                                btVector3 newNormal = tri_normal *frontFacing;
     827                                //if the tri_normal is pointing opposite direction as the current local contact normal, skip it
     828                                btScalar d = newNormal.dot(localContactNormalOnB) ;
     829                                if (d< 0)
     830                                {
     831                                        return;
     832                                }
    762833                                //modify the normal to be the triangle normal (or backfacing normal)
    763                                 cp.m_normalWorldOnB = colObj0->getWorldTransform().getBasis() *(tri_normal *frontFacing);
    764                         }
    765                        
    766                        
     834                                cp.m_normalWorldOnB = colObj0->getWorldTransform().getBasis() *newNormal;
     835                        }
     836                                               
    767837                        // Reproject collision point along normal.
    768838                        cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btManifoldResult.cpp

    r8351 r8393  
    6464        btAssert(m_manifoldPtr);
    6565        //order in manifold needs to match
    66        
    67         if (depth > m_manifoldPtr->getContactBreakingThreshold())
     66
     67//      if (depth > m_manifoldPtr->getContactBreakingThreshold())
     68        if (depth > m_manifoldPtr->getContactProcessingThreshold())
    6869                return;
    6970
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btManifoldResult.h

    r8351 r8393  
    1515
    1616
    17 #ifndef MANIFOLD_RESULT_H
    18 #define MANIFOLD_RESULT_H
     17#ifndef BT_MANIFOLD_RESULT_H
     18#define BT_MANIFOLD_RESULT_H
    1919
    2020class btCollisionObject;
     
    126126};
    127127
    128 #endif //MANIFOLD_RESULT_H
     128#endif //BT_MANIFOLD_RESULT_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp

    r8351 r8393  
    393393
    394394
    395                            bool islandSleeping = false;
     395                           bool islandSleeping = true;
    396396                       
    397397                                        for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
     
    400400                                                        btCollisionObject* colObj0 = collisionObjects[i];
    401401                                                        m_islandBodies.push_back(colObj0);
    402                                                         if (!colObj0->isActive())
    403                                                                         islandSleeping = true;
     402                                                        if (colObj0->isActive())
     403                                                                        islandSleeping = false;
    404404                                        }
    405405                       
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef SIMULATION_ISLAND_MANAGER_H
    17 #define SIMULATION_ISLAND_MANAGER_H
     16#ifndef BT_SIMULATION_ISLAND_MANAGER_H
     17#define BT_SIMULATION_ISLAND_MANAGER_H
    1818
    1919#include "BulletCollision/CollisionDispatch/btUnionFind.h"
     
    7878};
    7979
    80 #endif //SIMULATION_ISLAND_MANAGER_H
     80#endif //BT_SIMULATION_ISLAND_MANAGER_H
    8181
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef SPHERE_BOX_COLLISION_ALGORITHM_H
    17 #define SPHERE_BOX_COLLISION_ALGORITHM_H
     16#ifndef BT_SPHERE_BOX_COLLISION_ALGORITHM_H
     17#define BT_SPHERE_BOX_COLLISION_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    7272};
    7373
    74 #endif //SPHERE_BOX_COLLISION_ALGORITHM_H
     74#endif //BT_SPHERE_BOX_COLLISION_ALGORITHM_H
    7575
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef SPHERE_SPHERE_COLLISION_ALGORITHM_H
    17 #define SPHERE_SPHERE_COLLISION_ALGORITHM_H
     16#ifndef BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
     17#define BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    6363};
    6464
    65 #endif //SPHERE_SPHERE_COLLISION_ALGORITHM_H
     65#endif //BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
    6666
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
    17 #define SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
     16#ifndef BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
     17#define BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
    1818
    1919#include "btActivatingCollisionAlgorithm.h"
     
    6666};
    6767
    68 #endif //SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
     68#endif //BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
    6969
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btUnionFind.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef UNION_FIND_H
    17 #define UNION_FIND_H
     16#ifndef BT_UNION_FIND_H
     17#define BT_UNION_FIND_H
    1818
    1919#include "LinearMath/btAlignedObjectArray.h"
     
    127127
    128128
    129 #endif //UNION_FIND_H
     129#endif //BT_UNION_FIND_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBox2dShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef OBB_BOX_2D_SHAPE_H
    17 #define OBB_BOX_2D_SHAPE_H
     16#ifndef BT_OBB_BOX_2D_SHAPE_H
     17#define BT_OBB_BOX_2D_SHAPE_H
    1818
    1919#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
     
    359359};
    360360
    361 #endif //OBB_BOX_2D_SHAPE_H
    362 
    363 
     361#endif //BT_OBB_BOX_2D_SHAPE_H
     362
     363
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBoxShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef OBB_BOX_MINKOWSKI_H
    17 #define OBB_BOX_MINKOWSKI_H
     16#ifndef BT_OBB_BOX_MINKOWSKI_H
     17#define BT_OBB_BOX_MINKOWSKI_H
    1818
    1919#include "btPolyhedralConvexShape.h"
     
    146146        virtual void getVertex(int i,btVector3& vtx) const
    147147        {
    148                 btVector3 halfExtents = getHalfExtentsWithoutMargin();
     148                btVector3 halfExtents = getHalfExtentsWithMargin();
    149149
    150150                vtx = btVector3(
     
    314314
    315315
    316 #endif //OBB_BOX_MINKOWSKI_H
    317 
    318 
     316#endif //BT_OBB_BOX_MINKOWSKI_H
     317
     318
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp

    r8351 r8393  
    278278
    279279                        unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
    280                         btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
     280                        btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT||indicestype==PHY_UCHAR);
    281281       
    282282                        const btVector3& meshScaling = m_meshInterface->getScaling();
     
    284284                        {
    285285                               
    286                                 int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
     286                                int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:indicestype==PHY_INTEGER?gfxbase[j]:((unsigned char*)gfxbase)[j];
    287287
    288288
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef BVH_TRIANGLE_MESH_SHAPE_H
    17 #define BVH_TRIANGLE_MESH_SHAPE_H
     16#ifndef BT_BVH_TRIANGLE_MESH_SHAPE_H
     17#define BT_BVH_TRIANGLE_MESH_SHAPE_H
    1818
    1919#include "btTriangleMeshShape.h"
     
    4040        BT_DECLARE_ALIGNED_ALLOCATOR();
    4141
    42         btBvhTriangleMeshShape() : btTriangleMeshShape(0),m_bvh(0),m_triangleInfoMap(0),m_ownsBvh(false) {m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;};
     42       
    4343        btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true);
    4444
     
    137137
    138138
    139 #endif //BVH_TRIANGLE_MESH_SHAPE_H
     139#endif //BT_BVH_TRIANGLE_MESH_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCollisionMargin.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef COLLISION_MARGIN_H
    17 #define COLLISION_MARGIN_H
     16#ifndef BT_COLLISION_MARGIN_H
     17#define BT_COLLISION_MARGIN_H
    1818
    1919//used by Gjk and some other algorithms
     
    2323
    2424
    25 #endif //COLLISION_MARGIN_H
     25#endif //BT_COLLISION_MARGIN_H
    2626
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCollisionShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef COLLISION_SHAPE_H
    17 #define COLLISION_SHAPE_H
     16#ifndef BT_COLLISION_SHAPE_H
     17#define BT_COLLISION_SHAPE_H
    1818
    1919#include "LinearMath/btTransform.h"
     
    147147
    148148
    149 #endif //COLLISION_SHAPE_H
     149#endif //BT_COLLISION_SHAPE_H
    150150
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.cpp

    r8351 r8393  
    8686}
    8787
    88 void    btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform)
     88void    btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform,bool shouldRecalculateLocalAabb)
    8989{
    9090        m_children[childIndex].m_transform = newChildTransform;
     
    100100        }
    101101
    102         recalculateLocalAabb();
     102        if (shouldRecalculateLocalAabb)
     103        {
     104                recalculateLocalAabb();
     105        }
    103106}
    104107
     
    284287                m_children[i].m_childShape->setLocalScaling(childScale);
    285288                childTrans.setOrigin((childTrans.getOrigin())*scaling);
    286                 updateChildTransform(i, childTrans);
    287                 recalculateLocalAabb();
    288         }
     289                updateChildTransform(i, childTrans,false);
     290        }
     291       
    289292        m_localScaling = scaling;
     293        recalculateLocalAabb();
     294
    290295}
    291296
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef COMPOUND_SHAPE_H
    17 #define COMPOUND_SHAPE_H
     16#ifndef BT_COMPOUND_SHAPE_H
     17#define BT_COMPOUND_SHAPE_H
    1818
    1919#include "btCollisionShape.h"
     
    107107
    108108        ///set a new transform for a child, and update internal data structures (local aabb and dynamic tree)
    109         void    updateChildTransform(int childIndex, const btTransform& newChildTransform);
     109        void    updateChildTransform(int childIndex, const btTransform& newChildTransform, bool shouldRecalculateLocalAabb = true);
    110110
    111111
     
    144144        }
    145145
    146 
    147         btDbvt*                                                 getDynamicAabbTree()
     146        const btDbvt*   getDynamicAabbTree() const
     147        {
     148                return m_dynamicAabbTree;
     149        }
     150       
     151        btDbvt* getDynamicAabbTree()
    148152        {
    149153                return m_dynamicAabbTree;
     
    206210
    207211
    208 #endif //COMPOUND_SHAPE_H
     212#endif //BT_COMPOUND_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConcaveShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONCAVE_SHAPE_H
    17 #define CONCAVE_SHAPE_H
     16#ifndef BT_CONCAVE_SHAPE_H
     17#define BT_CONCAVE_SHAPE_H
    1818
    1919#include "btCollisionShape.h"
     
    5858};
    5959
    60 #endif //CONCAVE_SHAPE_H
     60#endif //BT_CONCAVE_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConeShape.cpp

    r8351 r8393  
    132132
    133133
     134void    btConeShape::setLocalScaling(const btVector3& scaling)
     135{
     136        int axis = m_coneIndices[1];
     137        int r1 = m_coneIndices[0];
     138        int r2 = m_coneIndices[2];
     139        m_height *= scaling[axis] / m_localScaling[axis];
     140        m_radius *= (scaling[r1] / m_localScaling[r1] + scaling[r2] / m_localScaling[r2]) / 2;
     141        m_sinAngle = (m_radius / btSqrt(m_radius * m_radius + m_height * m_height));
     142        btConvexInternalShape::setLocalScaling(scaling);
     143}
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConeShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONE_MINKOWSKI_H
    17 #define CONE_MINKOWSKI_H
     16#ifndef BT_CONE_MINKOWSKI_H
     17#define BT_CONE_MINKOWSKI_H
    1818
    1919#include "btConvexInternalShape.h"
     
    8282                        return m_coneIndices[1];
    8383                }
     84
     85        virtual void    setLocalScaling(const btVector3& scaling);
     86
    8487};
    8588
     
    97100                btConeShapeZ(btScalar radius,btScalar height);
    98101};
    99 #endif //CONE_MINKOWSKI_H
     102#endif //BT_CONE_MINKOWSKI_H
    100103
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvex2dShape.h

    r8351 r8393  
    2020#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
    2121
    22 ///The btConvex2dShape allows to use arbitrary convex shapes are 2d convex shapes, with the Z component assumed to be 0.
     22///The btConvex2dShape allows to use arbitrary convex shapes as 2d convex shapes, with the Z component assumed to be 0.
    2323///For 2d boxes, the btBox2dShape is recommended.
    2424class btConvex2dShape : public btConvexShape
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvexHullShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONVEX_HULL_SHAPE_H
    17 #define CONVEX_HULL_SHAPE_H
     16#ifndef BT_CONVEX_HULL_SHAPE_H
     17#define BT_CONVEX_HULL_SHAPE_H
    1818
    1919#include "btPolyhedralConvexShape.h"
     
    117117
    118118
    119 #endif //CONVEX_HULL_SHAPE_H
     119#endif //BT_CONVEX_HULL_SHAPE_H
    120120
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvexShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONVEX_SHAPE_INTERFACE1
    17 #define CONVEX_SHAPE_INTERFACE1
     16#ifndef BT_CONVEX_SHAPE_INTERFACE1
     17#define BT_CONVEX_SHAPE_INTERFACE1
    1818
    1919#include "btCollisionShape.h"
     
    8080
    8181
    82 #endif //CONVEX_SHAPE_INTERFACE1
     82#endif //BT_CONVEX_SHAPE_INTERFACE1
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h

    r8351 r8393  
    13133. This notice may not be removed or altered from any source distribution.
    1414*/
    15 #ifndef CONVEX_TRIANGLEMESH_SHAPE_H
    16 #define CONVEX_TRIANGLEMESH_SHAPE_H
     15#ifndef BT_CONVEX_TRIANGLEMESH_SHAPE_H
     16#define BT_CONVEX_TRIANGLEMESH_SHAPE_H
    1717
    1818
     
    7070
    7171
    72 #endif //CONVEX_TRIANGLEMESH_SHAPE_H
     72#endif //BT_CONVEX_TRIANGLEMESH_SHAPE_H
    7373
    7474
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCylinderShape.cpp

    r8351 r8393  
    4848void    btCylinderShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
    4949{
    50         //approximation of box shape, todo: implement cylinder shape inertia before people notice ;-)
     50
     51//Until Bullet 2.77 a box approximation was used, so uncomment this if you need backwards compatibility
     52//#define USE_BOX_INERTIA_APPROXIMATION 1
     53#ifndef USE_BOX_INERTIA_APPROXIMATION
     54
     55        /*
     56        cylinder is defined as following:
     57        *
     58        * - principle axis aligned along y by default, radius in x, z-value not used
     59        * - for btCylinderShapeX: principle axis aligned along x, radius in y direction, z-value not used
     60        * - for btCylinderShapeZ: principle axis aligned along z, radius in x direction, y-value not used
     61        *
     62        */
     63
     64        btScalar radius2;       // square of cylinder radius
     65        btScalar height2;       // square of cylinder height
     66        btVector3 halfExtents = getHalfExtentsWithMargin();     // get cylinder dimension
     67        btScalar div12 = mass / 12.f;
     68        btScalar div4 = mass / 4.f;
     69        btScalar div2 = mass / 2.f;
     70        int idxRadius, idxHeight;
     71
     72        switch (m_upAxis)       // get indices of radius and height of cylinder
     73        {
     74                case 0:         // cylinder is aligned along x
     75                        idxRadius = 1;
     76                        idxHeight = 0;
     77                        break;
     78                case 2:         // cylinder is aligned along z
     79                        idxRadius = 0;
     80                        idxHeight = 2;
     81                        break;
     82                default:        // cylinder is aligned along y
     83                        idxRadius = 0;
     84                        idxHeight = 1;
     85        }
     86
     87        // calculate squares
     88        radius2 = halfExtents[idxRadius] * halfExtents[idxRadius];
     89        height2 = btScalar(4.) * halfExtents[idxHeight] * halfExtents[idxHeight];
     90
     91        // calculate tensor terms
     92        btScalar t1 = div12 * height2 + div4 * radius2;
     93        btScalar t2 = div2 * radius2;
     94
     95        switch (m_upAxis)       // set diagonal elements of inertia tensor
     96        {
     97                case 0:         // cylinder is aligned along x
     98                        inertia.setValue(t2,t1,t1);
     99                        break;
     100                case 2:         // cylinder is aligned along z
     101                        inertia.setValue(t1,t1,t2);
     102                        break;
     103                default:        // cylinder is aligned along y
     104                        inertia.setValue(t1,t2,t1);
     105        }
     106#else //USE_BOX_INERTIA_APPROXIMATION
     107        //approximation of box shape
    51108        btVector3 halfExtents = getHalfExtentsWithMargin();
    52109
     
    58115                                        mass/(btScalar(12.0)) * (lx*lx + lz*lz),
    59116                                        mass/(btScalar(12.0)) * (lx*lx + ly*ly));
    60 
     117#endif //USE_BOX_INERTIA_APPROXIMATION
    61118}
    62119
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCylinderShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CYLINDER_MINKOWSKI_H
    17 #define CYLINDER_MINKOWSKI_H
     16#ifndef BT_CYLINDER_MINKOWSKI_H
     17#define BT_CYLINDER_MINKOWSKI_H
    1818
    1919#include "btBoxShape.h"
     
    197197
    198198
    199 #endif //CYLINDER_MINKOWSKI_H
    200 
     199#endif //BT_CYLINDER_MINKOWSKI_H
     200
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btEmptyShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef EMPTY_SHAPE_H
    17 #define EMPTY_SHAPE_H
     16#ifndef BT_EMPTY_SHAPE_H
     17#define BT_EMPTY_SHAPE_H
    1818
    1919#include "btConcaveShape.h"
     
    6868
    6969
    70 #endif //EMPTY_SHAPE_H
     70#endif //BT_EMPTY_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef HEIGHTFIELD_TERRAIN_SHAPE_H
    17 #define HEIGHTFIELD_TERRAIN_SHAPE_H
     16#ifndef BT_HEIGHTFIELD_TERRAIN_SHAPE_H
     17#define BT_HEIGHTFIELD_TERRAIN_SHAPE_H
    1818
    1919#include "btConcaveShape.h"
     
    159159};
    160160
    161 #endif //HEIGHTFIELD_TERRAIN_SHAPE_H
     161#endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMaterial.h

    r8351 r8393  
    1616/// This file was created by Alex Silverman
    1717
    18 #ifndef MATERIAL_H
    19 #define MATERIAL_H
     18#ifndef BT_MATERIAL_H
     19#define BT_MATERIAL_H
    2020
    2121// Material class to be used by btMultimaterialTriangleMeshShape to store triangle properties
     
    3232};
    3333
    34 #endif // MATERIAL_H
     34#endif // BT_MATERIAL_H
    3535
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMinkowskiSumShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef MINKOWSKI_SUM_SHAPE_H
    17 #define MINKOWSKI_SUM_SHAPE_H
     16#ifndef BT_MINKOWSKI_SUM_SHAPE_H
     17#define BT_MINKOWSKI_SUM_SHAPE_H
    1818
    1919#include "btConvexInternalShape.h"
     
    5858};
    5959
    60 #endif //MINKOWSKI_SUM_SHAPE_H
     60#endif //BT_MINKOWSKI_SUM_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMultiSphereShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef MULTI_SPHERE_MINKOWSKI_H
    17 #define MULTI_SPHERE_MINKOWSKI_H
     16#ifndef BT_MULTI_SPHERE_MINKOWSKI_H
     17#define BT_MULTI_SPHERE_MINKOWSKI_H
    1818
    1919#include "btConvexInternalShape.h"
     
    9797
    9898
    99 #endif //MULTI_SPHERE_MINKOWSKI_H
     99#endif //BT_MULTI_SPHERE_MINKOWSKI_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h

    r8351 r8393  
    1616/// This file was created by Alex Silverman
    1717
    18 #ifndef BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
    19 #define BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
     18#ifndef BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
     19#define BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
    2020
    2121#include "btBvhTriangleMeshShape.h"
     
    3232        BT_DECLARE_ALIGNED_ALLOCATOR();
    3333
    34     btMultimaterialTriangleMeshShape(): btBvhTriangleMeshShape() {m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;}
    3534    btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true):
    3635        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, buildBvh)
     
    119118;
    120119
    121 #endif //BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
     120#endif //BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btOptimizedBvh.h

    r8351 r8393  
    1616///Contains contributions from Disney Studio's
    1717
    18 #ifndef OPTIMIZED_BVH_H
    19 #define OPTIMIZED_BVH_H
     18#ifndef BT_OPTIMIZED_BVH_H
     19#define BT_OPTIMIZED_BVH_H
    2020
    2121#include "BulletCollision/BroadphaseCollision/btQuantizedBvh.h"
     
    6161
    6262
    63 #endif //OPTIMIZED_BVH_H
     63#endif //BT_OPTIMIZED_BVH_H
    6464
    6565
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp

    r8351 r8393  
    1515
    1616#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
    17 
    18 btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape()
    19 {
    20 
     17#include "btConvexPolyhedron.h"
     18#include "LinearMath/btConvexHullComputer.h"
     19#include <new>
     20
     21btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape(),
     22m_polyhedron(0)
     23{
     24
     25}
     26
     27btPolyhedralConvexShape::~btPolyhedralConvexShape()
     28{
     29        if (m_polyhedron)
     30        {
     31                btAlignedFree(m_polyhedron);
     32        }
     33}
     34
     35bool    btPolyhedralConvexShape::initializePolyhedralFeatures()
     36{
     37        if (m_polyhedron)
     38                btAlignedFree(m_polyhedron);
     39       
     40        void* mem = btAlignedAlloc(sizeof(btConvexPolyhedron),16);
     41        m_polyhedron = new (mem) btConvexPolyhedron;
     42
     43        btAlignedObjectArray<btVector3> tmpVertices;
     44        for (int i=0;i<getNumVertices();i++)
     45        {
     46                btVector3& newVertex = tmpVertices.expand();
     47                getVertex(i,newVertex);
     48        }
     49
     50        btConvexHullComputer conv;
     51        conv.compute(&tmpVertices[0].getX(), sizeof(btVector3),tmpVertices.size(),0.f,0.f);
     52
     53       
     54
     55        btAlignedObjectArray<btVector3> faceNormals;
     56        int numFaces = conv.faces.size();
     57        faceNormals.resize(numFaces);
     58        btConvexHullComputer* convexUtil = &conv;
     59
     60       
     61       
     62        m_polyhedron->m_faces.resize(numFaces);
     63        int numVertices = convexUtil->vertices.size();
     64        m_polyhedron->m_vertices.resize(numVertices);
     65        for (int p=0;p<numVertices;p++)
     66        {
     67                m_polyhedron->m_vertices[p] = convexUtil->vertices[p];
     68        }
     69
     70        for (int i=0;i<numFaces;i++)
     71        {
     72                int face = convexUtil->faces[i];
     73                //printf("face=%d\n",face);
     74                const btConvexHullComputer::Edge*  firstEdge = &convexUtil->edges[face];
     75                const btConvexHullComputer::Edge*  edge = firstEdge;
     76
     77                btVector3 edges[3];
     78                int numEdges = 0;
     79                //compute face normals
     80
     81                btScalar maxCross2 = 0.f;
     82                int chosenEdge = -1;
     83
     84                do
     85                {
     86                       
     87                        int src = edge->getSourceVertex();
     88                        m_polyhedron->m_faces[i].m_indices.push_back(src);
     89                        int targ = edge->getTargetVertex();
     90                        btVector3 wa = convexUtil->vertices[src];
     91
     92                        btVector3 wb = convexUtil->vertices[targ];
     93                        btVector3 newEdge = wb-wa;
     94                        newEdge.normalize();
     95                        if (numEdges<2)
     96                                edges[numEdges++] = newEdge;
     97
     98                        edge = edge->getNextEdgeOfFace();
     99                } while (edge!=firstEdge);
     100
     101                btScalar planeEq = 1e30f;
     102
     103               
     104                if (numEdges==2)
     105                {
     106                        faceNormals[i] = edges[0].cross(edges[1]);
     107                        faceNormals[i].normalize();
     108                        m_polyhedron->m_faces[i].m_plane[0] = -faceNormals[i].getX();
     109                        m_polyhedron->m_faces[i].m_plane[1] = -faceNormals[i].getY();
     110                        m_polyhedron->m_faces[i].m_plane[2] = -faceNormals[i].getZ();
     111                        m_polyhedron->m_faces[i].m_plane[3] = planeEq;
     112
     113                }
     114                else
     115                {
     116                        btAssert(0);//degenerate?
     117                        faceNormals[i].setZero();
     118                }
     119
     120                for (int v=0;v<m_polyhedron->m_faces[i].m_indices.size();v++)
     121                {
     122                        btScalar eq = m_polyhedron->m_vertices[m_polyhedron->m_faces[i].m_indices[v]].dot(faceNormals[i]);
     123                        if (planeEq>eq)
     124                        {
     125                                planeEq=eq;
     126                        }
     127                }
     128                m_polyhedron->m_faces[i].m_plane[3] = planeEq;
     129        }
     130
     131
     132        if (m_polyhedron->m_faces.size() && conv.vertices.size())
     133        {
     134
     135                for (int f=0;f<m_polyhedron->m_faces.size();f++)
     136                {
     137                       
     138                        btVector3 planeNormal(m_polyhedron->m_faces[f].m_plane[0],m_polyhedron->m_faces[f].m_plane[1],m_polyhedron->m_faces[f].m_plane[2]);
     139                        btScalar planeEq = m_polyhedron->m_faces[f].m_plane[3];
     140
     141                        btVector3 supVec = localGetSupportingVertex(-planeNormal);
     142
     143                        if (supVec.dot(planeNormal)<planeEq)
     144                        {
     145                                m_polyhedron->m_faces[f].m_plane[0] *= -1;
     146                                m_polyhedron->m_faces[f].m_plane[1] *= -1;
     147                                m_polyhedron->m_faces[f].m_plane[2] *= -1;
     148                                m_polyhedron->m_faces[f].m_plane[3] *= -1;
     149                                int numVerts = m_polyhedron->m_faces[f].m_indices.size();
     150                                for (int v=0;v<numVerts/2;v++)
     151                                {
     152                                        btSwap(m_polyhedron->m_faces[f].m_indices[v],m_polyhedron->m_faces[f].m_indices[numVerts-1-v]);
     153                                }
     154                        }
     155                }
     156        }
     157
     158       
     159
     160        m_polyhedron->initialize();
     161
     162        return true;
    21163}
    22164
     
    192334}
    193335
     336
     337
     338
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef BU_SHAPE
    17 #define BU_SHAPE
     16#ifndef BT_POLYHEDRAL_CONVEX_SHAPE_H
     17#define BT_POLYHEDRAL_CONVEX_SHAPE_H
    1818
    1919#include "LinearMath/btMatrix3x3.h"
    2020#include "btConvexInternalShape.h"
     21class btConvexPolyhedron;
    2122
    2223
     
    2425class btPolyhedralConvexShape : public btConvexInternalShape
    2526{
     27       
    2628
    2729protected:
    2830       
     31        btConvexPolyhedron* m_polyhedron;
     32
    2933public:
    3034
    3135        btPolyhedralConvexShape();
     36
     37        virtual ~btPolyhedralConvexShape();
     38
     39        ///optional method mainly used to generate multiple contact points by clipping polyhedral features (faces/edges)
     40        virtual bool    initializePolyhedralFeatures();
     41
     42        const btConvexPolyhedron*       getConvexPolyhedron() const
     43        {
     44                return m_polyhedron;
     45        }
    3246
    3347        //brute force implementations
     
    96110};
    97111
    98 #endif //BU_SHAPE
     112#endif //BT_POLYHEDRAL_CONVEX_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp

    r8351 r8393  
    6363        scaledAabbMin[1] = m_localScaling.getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
    6464        scaledAabbMin[2] = m_localScaling.getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
     65        scaledAabbMin[3] = 0.f;
    6566       
    6667        scaledAabbMax[0] = m_localScaling.getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
    6768        scaledAabbMax[1] = m_localScaling.getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
    6869        scaledAabbMax[2] = m_localScaling.getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
     70        scaledAabbMax[3] = 0.f;
    6971       
    7072       
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef SCALED_BVH_TRIANGLE_MESH_SHAPE_H
    17 #define SCALED_BVH_TRIANGLE_MESH_SHAPE_H
     16#ifndef BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
     17#define BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
    1818
    1919#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
     
    5858        virtual const char*     getName()const {return "SCALEDBVHTRIANGLEMESH";}
    5959
     60        virtual int     calculateSerializeBufferSize() const;
     61
     62        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     63        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
     64
    6065};
    6166
    62 #endif //BVH_TRIANGLE_MESH_SHAPE_H
     67///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     68struct  btScaledTriangleMeshShapeData
     69{
     70        btTriangleMeshShapeData m_trimeshShapeData;
     71
     72        btVector3FloatData      m_localScaling;
     73};
     74
     75
     76SIMD_FORCE_INLINE       int     btScaledBvhTriangleMeshShape::calculateSerializeBufferSize() const
     77{
     78        return sizeof(btScaledTriangleMeshShapeData);
     79}
     80
     81
     82///fills the dataBuffer and returns the struct name (and 0 on failure)
     83SIMD_FORCE_INLINE       const char*     btScaledBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
     84{
     85        btScaledTriangleMeshShapeData* scaledMeshData = (btScaledTriangleMeshShapeData*) dataBuffer;
     86        m_bvhTriMeshShape->serialize(&scaledMeshData->m_trimeshShapeData,serializer);
     87        scaledMeshData->m_trimeshShapeData.m_collisionShapeData.m_shapeType = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE;
     88        m_localScaling.serializeFloat(scaledMeshData->m_localScaling);
     89        return "btScaledTriangleMeshShapeData";
     90}
     91
     92
     93#endif //BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btShapeHull.h

    r8351 r8393  
    1616///btShapeHull implemented by John McCutchan.
    1717
    18 #ifndef _SHAPE_HULL_H
    19 #define _SHAPE_HULL_H
     18#ifndef BT_SHAPE_HULL_H
     19#define BT_SHAPE_HULL_H
    2020
    2121#include "LinearMath/btAlignedObjectArray.h"
     
    5757};
    5858
    59 #endif //_SHAPE_HULL_H
     59#endif //BT_SHAPE_HULL_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btSphereShape.h

    r8351 r8393  
    13133. This notice may not be removed or altered from any source distribution.
    1414*/
    15 #ifndef SPHERE_MINKOWSKI_H
    16 #define SPHERE_MINKOWSKI_H
     15#ifndef BT_SPHERE_MINKOWSKI_H
     16#define BT_SPHERE_MINKOWSKI_H
    1717
    1818#include "btConvexInternalShape.h"
     
    7171
    7272
    73 #endif //SPHERE_MINKOWSKI_H
     73#endif //BT_SPHERE_MINKOWSKI_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btStaticPlaneShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef STATIC_PLANE_SHAPE_H
    17 #define STATIC_PLANE_SHAPE_H
     16#ifndef BT_STATIC_PLANE_SHAPE_H
     17#define BT_STATIC_PLANE_SHAPE_H
    1818
    1919#include "btConcaveShape.h"
     
    9898
    9999
    100 #endif //STATIC_PLANE_SHAPE_H
     100#endif //BT_STATIC_PLANE_SHAPE_H
    101101
    102102
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp

    r8351 r8393  
    8989                                         break;
    9090                                 }
     91                        case PHY_UCHAR:
     92                                 {
     93                                         for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
     94                                         {
     95                                                 unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
     96                                                 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
     97                                                 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
     98                                                 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
     99                                                 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),    graphicsbase[2]*meshScaling.getZ());
     100                                                 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
     101                                                 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),    graphicsbase[2]*meshScaling.getZ());
     102                                                 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
     103                                         }
     104                                         break;
     105                                 }
    91106                         default:
    92107                                 btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT));
     
    121136                                                {
    122137                                                        unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
     138                                                        graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
     139                                                        triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
     140                                                        graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
     141                                                        triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
     142                                                        graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
     143                                                        triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
     144                                                        callback->internalProcessTriangleIndex(triangle,part,gfxindex);
     145                                                }
     146                                                break;
     147                                        }
     148                                case PHY_UCHAR:
     149                                        {
     150                                                for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
     151                                                {
     152                                                        unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
    123153                                                        graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
    124154                                                        triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
     
    267297                                        break;
    268298                                }
     299                                case PHY_UCHAR:
     300                                {
     301                                        if (numtriangles)
     302                                        {
     303                                                btChunk* chunk = serializer->allocate(sizeof(btCharIndexTripletData),numtriangles);
     304                                                btCharIndexTripletData* tmpIndices = (btCharIndexTripletData*)chunk->m_oldPtr;
     305                                                memPtr->m_3indices8 = (btCharIndexTripletData*) serializer->getUniquePointer(tmpIndices);
     306                                                for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
     307                                                {
     308                                                        unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
     309                                                        tmpIndices[gfxindex].m_values[0] = tri_indices[0];
     310                                                        tmpIndices[gfxindex].m_values[1] = tri_indices[1];
     311                                                        tmpIndices[gfxindex].m_values[2] = tri_indices[2];
     312                                                }
     313                                                serializer->finalizeChunk(chunk,"btCharIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
     314                                        }
     315                                        break;
     316                                }
    269317                        default:
    270318                                {
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef STRIDING_MESHINTERFACE_H
    17 #define STRIDING_MESHINTERFACE_H
     16#ifndef BT_STRIDING_MESHINTERFACE_H
     17#define BT_STRIDING_MESHINTERFACE_H
    1818
    1919#include "LinearMath/btVector3.h"
     
    117117};
    118118
     119struct  btCharIndexTripletData
     120{
     121        unsigned char m_values[3];
     122        char    m_pad;
     123};
     124
     125
    119126///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
    120127struct  btMeshPartData
     
    125132        btIntIndexData                          *m_indices32;
    126133        btShortIntIndexTripletData      *m_3indices16;
     134        btCharIndexTripletData          *m_3indices8;
    127135
    128136        btShortIntIndexData                     *m_indices16;//backwards compatibility
     
    152160
    153161
    154 #endif //STRIDING_MESHINTERFACE_H
     162#endif //BT_STRIDING_MESHINTERFACE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef BU_SIMPLEX_1TO4_SHAPE
    17 #define BU_SIMPLEX_1TO4_SHAPE
     16#ifndef BT_SIMPLEX_1TO4_SHAPE
     17#define BT_SIMPLEX_1TO4_SHAPE
    1818
    1919
     
    7272};
    7373
    74 #endif //BU_SIMPLEX_1TO4_SHAPE
     74#endif //BT_SIMPLEX_1TO4_SHAPE
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleCallback.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef TRIANGLE_CALLBACK_H
    17 #define TRIANGLE_CALLBACK_H
     16#ifndef BT_TRIANGLE_CALLBACK_H
     17#define BT_TRIANGLE_CALLBACK_H
    1818
    1919#include "LinearMath/btVector3.h"
     
    4040
    4141
    42 #endif //TRIANGLE_CALLBACK_H
     42#endif //BT_TRIANGLE_CALLBACK_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleInfoMap.h

    r8351 r8393  
    6262        btScalar        m_equalVertexThreshold; ///used to compute connectivity: if the distance between two vertices is smaller than m_equalVertexThreshold, they are considered to be 'shared'
    6363        btScalar        m_edgeDistanceThreshold; ///used to determine edge contacts: if the closest distance between a contact point and an edge is smaller than this distance threshold it is considered to "hit the edge"
     64        btScalar        m_maxEdgeAngleThreshold; //ignore edges that connect triangles at an angle larger than this m_maxEdgeAngleThreshold
    6465        btScalar        m_zeroAreaThreshold; ///used to determine if a triangle is degenerate (length squared of cross product of 2 triangle edges < threshold)
    6566       
     
    7273                m_edgeDistanceThreshold = btScalar(0.1);
    7374                m_zeroAreaThreshold = btScalar(0.0001)*btScalar(0.0001);
     75                m_maxEdgeAngleThreshold = SIMD_2_PI;
    7476        }
    7577        virtual ~btTriangleInfoMap() {}
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleMesh.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef TRIANGLE_MESH_H
    17 #define TRIANGLE_MESH_H
     16#ifndef BT_TRIANGLE_MESH_H
     17#define BT_TRIANGLE_MESH_H
    1818
    1919#include "btTriangleIndexVertexArray.h"
     
    6666};
    6767
    68 #endif //TRIANGLE_MESH_H
     68#endif //BT_TRIANGLE_MESH_H
    6969
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleMeshShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef TRIANGLE_MESH_SHAPE_H
    17 #define TRIANGLE_MESH_SHAPE_H
     16#ifndef BT_TRIANGLE_MESH_SHAPE_H
     17#define BT_TRIANGLE_MESH_SHAPE_H
    1818
    1919#include "btConcaveShape.h"
     
    8787
    8888
    89 #endif //TRIANGLE_MESH_SHAPE_H
     89#endif //BT_TRIANGLE_MESH_SHAPE_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleShape.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef OBB_TRIANGLE_MINKOWSKI_H
    17 #define OBB_TRIANGLE_MINKOWSKI_H
     16#ifndef BT_OBB_TRIANGLE_MINKOWSKI_H
     17#define BT_OBB_TRIANGLE_MINKOWSKI_H
    1818
    1919#include "btConvexShape.h"
     
    179179};
    180180
    181 #endif //OBB_TRIANGLE_MINKOWSKI_H
     181#endif //BT_OBB_TRIANGLE_MINKOWSKI_H
    182182
  • code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btUniformScalingShape.cpp

    r8351 r8393  
    6565
    6666        ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
    67 void btUniformScalingShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
     67void btUniformScalingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
    6868{
    69         m_childConvexShape->getAabb(t,aabbMin,aabbMax);
    70         btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5);
    71         btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor;
    72 
    73         aabbMin = aabbCenter - scaledAabbHalfExtends;
    74         aabbMax = aabbCenter + scaledAabbHalfExtends;
     69        getAabbSlow(trans,aabbMin,aabbMax);
    7570
    7671}
     
    7873void btUniformScalingShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
    7974{
    80         m_childConvexShape->getAabbSlow(t,aabbMin,aabbMax);
    81         btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5);
    82         btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor;
     75#if 1
     76        btVector3 _directions[] =
     77        {
     78                btVector3( 1.,  0.,  0.),
     79                btVector3( 0.,  1.,  0.),
     80                btVector3( 0.,  0.,  1.),
     81                btVector3( -1., 0.,  0.),
     82                btVector3( 0., -1.,  0.),
     83                btVector3( 0.,  0., -1.)
     84        };
     85       
     86        btVector3 _supporting[] =
     87        {
     88                btVector3( 0., 0., 0.),
     89                btVector3( 0., 0., 0.),
     90                btVector3( 0., 0., 0.),
     91                btVector3( 0., 0., 0.),
     92                btVector3( 0., 0., 0.),
     93                btVector3( 0., 0., 0.)
     94        };
    8395
    84         aabbMin = aabbCenter - scaledAabbHalfExtends;
    85         aabbMax = aabbCenter + scaledAabbHalfExtends;
     96        for (int i=0;i<6;i++)
     97        {
     98                _directions[i] = _directions[i]*t.getBasis();
     99        }
     100       
     101        batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
     102       
     103        btVector3 aabbMin1(0,0,0),aabbMax1(0,0,0);
     104
     105        for ( int i = 0; i < 3; ++i )
     106        {
     107                aabbMax1[i] = t(_supporting[i])[i];
     108                aabbMin1[i] = t(_supporting[i + 3])[i];
     109        }
     110        btVector3 marginVec(getMargin(),getMargin(),getMargin());
     111        aabbMin = aabbMin1-marginVec;
     112        aabbMax = aabbMax1+marginVec;
     113       
     114#else
     115
     116        btScalar margin = getMargin();
     117        for (int i=0;i<3;i++)
     118        {
     119                btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
     120                vec[i] = btScalar(1.);
     121                btVector3 sv = localGetSupportingVertex(vec*t.getBasis());
     122                btVector3 tmp = t(sv);
     123                aabbMax[i] = tmp[i]+margin;
     124                vec[i] = btScalar(-1.);
     125                sv = localGetSupportingVertex(vec*t.getBasis());
     126                tmp = t(sv);
     127                aabbMin[i] = tmp[i]-margin;
     128        }
     129
     130#endif
    86131}
    87132
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp

    r8351 r8393  
    2323#include "btGjkPairDetector.h"
    2424#include "btPointCollector.h"
     25#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
    2526
    2627
     
    2930:m_simplexSolver(simplexSolver),
    3031m_penetrationDepthSolver(penetrationDepthSolver),
    31 m_convexA(convexA),m_convexB(convexB)
    32 {
    33 }
     32m_convexA(convexA),m_convexB1(convexB),m_planeShape(0)
     33{
     34}
     35
     36
     37btContinuousConvexCollision::btContinuousConvexCollision( const btConvexShape*  convexA,const btStaticPlaneShape*       plane)
     38:m_simplexSolver(0),
     39m_penetrationDepthSolver(0),
     40m_convexA(convexA),m_convexB1(0),m_planeShape(plane)
     41{
     42}
     43
    3444
    3545/// This maximum should not be necessary. It allows for untested/degenerate cases in production code.
    3646/// You don't want your game ever to lock-up.
    3747#define MAX_ITERATIONS 64
     48
     49void btContinuousConvexCollision::computeClosestPoints( const btTransform& transA, const btTransform& transB,btPointCollector& pointCollector)
     50{
     51        if (m_convexB1)
     52        {
     53                m_simplexSolver->reset();
     54                btGjkPairDetector gjk(m_convexA,m_convexB1,m_convexA->getShapeType(),m_convexB1->getShapeType(),m_convexA->getMargin(),m_convexB1->getMargin(),m_simplexSolver,m_penetrationDepthSolver);               
     55                btGjkPairDetector::ClosestPointInput input;
     56                input.m_transformA = transA;
     57                input.m_transformB = transB;
     58                gjk.getClosestPoints(input,pointCollector,0);
     59        } else
     60        {
     61                //convex versus plane
     62                const btConvexShape* convexShape = m_convexA;
     63                const btStaticPlaneShape* planeShape = m_planeShape;
     64               
     65                bool hasCollision = false;
     66                const btVector3& planeNormal = planeShape->getPlaneNormal();
     67                const btScalar& planeConstant = planeShape->getPlaneConstant();
     68               
     69                btTransform convexWorldTransform = transA;
     70                btTransform convexInPlaneTrans;
     71                convexInPlaneTrans= transB.inverse() * convexWorldTransform;
     72                btTransform planeInConvex;
     73                planeInConvex= convexWorldTransform.inverse() * transB;
     74               
     75                btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
     76
     77                btVector3 vtxInPlane = convexInPlaneTrans(vtx);
     78                btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
     79
     80                btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
     81                btVector3 vtxInPlaneWorld = transB * vtxInPlaneProjected;
     82                btVector3 normalOnSurfaceB = transB.getBasis() * planeNormal;
     83
     84                pointCollector.addContactPoint(
     85                        normalOnSurfaceB,
     86                        vtxInPlaneWorld,
     87                        distance);
     88        }
     89}
    3890
    3991bool    btContinuousConvexCollision::calcTimeOfImpact(
     
    4597{
    4698
    47         m_simplexSolver->reset();
    4899
    49100        /// compute linear and angular velocity for this interval, to interpolate
     
    54105
    55106        btScalar boundingRadiusA = m_convexA->getAngularMotionDisc();
    56         btScalar boundingRadiusB = m_convexB->getAngularMotionDisc();
     107        btScalar boundingRadiusB = m_convexB1?m_convexB1->getAngularMotionDisc():0.f;
    57108
    58109        btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB;
     
    65116
    66117
    67         btScalar radius = btScalar(0.001);
    68118
    69119        btScalar lambda = btScalar(0.);
     
    84134
    85135
    86         btTransform identityTrans;
    87         identityTrans.setIdentity();
    88 
    89         btSphereShape   raySphere(btScalar(0.0));
    90         raySphere.setMargin(btScalar(0.));
    91 
    92 
     136        btScalar radius = 0.001f;
    93137//      result.drawCoordSystem(sphereTr);
    94138
     
    96140
    97141        {
    98                
    99                 btGjkPairDetector gjk(m_convexA,m_convexB,m_convexA->getShapeType(),m_convexB->getShapeType(),m_convexA->getMargin(),m_convexB->getMargin(),m_simplexSolver,m_penetrationDepthSolver);         
    100                 btGjkPairDetector::ClosestPointInput input;
    101142       
    102                 //we don't use margins during CCD
    103         //      gjk.setIgnoreMargin(true);
    104 
    105                 input.m_transformA = fromA;
    106                 input.m_transformB = fromB;
    107                 gjk.getClosestPoints(input,pointCollector1,0);
     143                computeClosestPoints(fromA,fromB,pointCollector1);
    108144
    109145                hasResult = pointCollector1.m_hasResult;
     
    114150        {
    115151                btScalar dist;
    116                 dist = pointCollector1.m_distance;
     152                dist = pointCollector1.m_distance + result.m_allowedPenetration;
    117153                n = pointCollector1.m_normalOnBInWorld;
    118 
    119154                btScalar projectedLinearVelocity = relLinVel.dot(n);
    120                
     155                if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)
     156                        return false;
     157
    121158                //not close enough
    122159                while (dist > radius)
     
    126163                                result.m_debugDrawer->drawSphere(c,0.2f,btVector3(1,1,1));
    127164                        }
    128                         numIter++;
    129                         if (numIter > maxIter)
    130                         {
    131                                 return false; //todo: report a failure
    132                         }
    133165                        btScalar dLambda = btScalar(0.);
    134166
    135167                        projectedLinearVelocity = relLinVel.dot(n);
    136168
    137                         //calculate safe moving fraction from distance / (linear+rotational velocity)
    138                        
    139                         //btScalar clippedDist  = GEN_min(angularConservativeRadius,dist);
    140                         //btScalar clippedDist  = dist;
    141169                       
    142170                        //don't report time of impact for motion away from the contact normal (or causes minor penetration)
     
    183211
    184212                        btPointCollector        pointCollector;
    185                         btGjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,m_penetrationDepthSolver);
    186                         btGjkPairDetector::ClosestPointInput input;
    187                         input.m_transformA = interpolatedTransA;
    188                         input.m_transformB = interpolatedTransB;
    189                         gjk.getClosestPoints(input,pointCollector,0);
     213                        computeClosestPoints(interpolatedTransA,interpolatedTransB,pointCollector);
     214
    190215                        if (pointCollector.m_hasResult)
    191216                        {
    192                                 if (pointCollector.m_distance < btScalar(0.))
    193                                 {
    194                                         //degenerate ?!
    195                                         result.m_fraction = lastLambda;
    196                                         n = pointCollector.m_normalOnBInWorld;
    197                                         result.m_normal=n;//.setValue(1,1,1);// = n;
    198                                         result.m_hitPoint = pointCollector.m_pointInWorld;
    199                                         return true;
    200                                 }
     217                                dist = pointCollector.m_distance+result.m_allowedPenetration;
    201218                                c = pointCollector.m_pointInWorld;             
    202219                                n = pointCollector.m_normalOnBInWorld;
    203                                 dist = pointCollector.m_distance;
    204220                        } else
    205221                        {
    206                                 //??
    207                                 return false;
    208                         }
    209                        
    210 
     222                                result.reportFailure(-1, numIter);
     223                                return false;
     224                        }
     225
     226                        numIter++;
     227                        if (numIter > maxIter)
     228                        {
     229                                result.reportFailure(-2, numIter);
     230                                return false;
     231                        }
    211232                }
    212233       
    213                 if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=result.m_allowedPenetration)//SIMD_EPSILON)
    214                         return false;
    215                        
    216234                result.m_fraction = lambda;
    217235                result.m_normal = n;
     
    222240        return false;
    223241
    224 /*
    225 //todo:
    226         //if movement away from normal, discard result
    227         btVector3 move = transBLocalTo.getOrigin() - transBLocalFrom.getOrigin();
    228         if (result.m_fraction < btScalar(1.))
    229         {
    230                 if (move.dot(result.m_normal) <= btScalar(0.))
    231                 {
    232                 }
    233         }
    234 */
    235 
    236 }
     242}
     243
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h

    r5781 r8393  
    1515
    1616
    17 #ifndef CONTINUOUS_COLLISION_CONVEX_CAST_H
    18 #define CONTINUOUS_COLLISION_CONVEX_CAST_H
     17#ifndef BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
     18#define BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
    1919
    2020#include "btConvexCast.h"
     
    2222class btConvexPenetrationDepthSolver;
    2323class btConvexShape;
     24class btStaticPlaneShape;
    2425
    2526/// btContinuousConvexCollision implements angular and linear time of impact for convex objects.
     
    3233        btConvexPenetrationDepthSolver* m_penetrationDepthSolver;
    3334        const btConvexShape*    m_convexA;
    34         const btConvexShape*    m_convexB;
     35        //second object is either a convex or a plane (code sharing)
     36        const btConvexShape*    m_convexB1;
     37        const btStaticPlaneShape*       m_planeShape;
    3538
     39        void computeClosestPoints( const btTransform& transA, const btTransform& transB,struct btPointCollector& pointCollector);
    3640
    3741public:
    3842
    3943        btContinuousConvexCollision (const btConvexShape*       shapeA,const btConvexShape*     shapeB ,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver);
     44
     45        btContinuousConvexCollision(const btConvexShape*        shapeA,const btStaticPlaneShape*        plane );
    4046
    4147        virtual bool    calcTimeOfImpact(
     
    4955};
    5056
    51 #endif //CONTINUOUS_COLLISION_CONVEX_CAST_H
    5257
     58#endif //BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
     59
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btConvexCast.h

    r8351 r8393  
    1515
    1616
    17 #ifndef CONVEX_CAST_H
    18 #define CONVEX_CAST_H
     17#ifndef BT_CONVEX_CAST_H
     18#define BT_CONVEX_CAST_H
    1919
    2020#include "LinearMath/btTransform.h"
     
    4040                virtual void    DebugDraw(btScalar      fraction) {(void)fraction;}
    4141                virtual void    drawCoordSystem(const btTransform& trans) {(void)trans;}
    42 
     42                virtual void    reportFailure(int errNo, int numIterations) {(void)errNo;(void)numIterations;}
    4343                CastResult()
    4444                        :m_fraction(btScalar(BT_LARGE_FLOAT)),
     
    7171};
    7272
    73 #endif //CONVEX_CAST_H
     73#endif //BT_CONVEX_CAST_H
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h

    r8351 r8393  
    1515
    1616
    17 #ifndef __CONVEX_PENETRATION_DEPTH_H
    18 #define __CONVEX_PENETRATION_DEPTH_H
     17#ifndef BT_CONVEX_PENETRATION_DEPTH_H
     18#define BT_CONVEX_PENETRATION_DEPTH_H
    1919
    2020class btStackAlloc;
     
    3939
    4040};
    41 #endif //CONVEX_PENETRATION_DEPTH_H
     41#endif //BT_CONVEX_PENETRATION_DEPTH_H
    4242
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h

    r8351 r8393  
    1515
    1616
    17 #ifndef DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
    18 #define DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
     17#ifndef BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
     18#define BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
     19
    1920#include "LinearMath/btTransform.h"
    2021#include "LinearMath/btVector3.h"
     
    8788};
    8889
    89 #endif //DISCRETE_COLLISION_DETECTOR_INTERFACE1_H
     90#endif //BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
     91
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h

    r5781 r8393  
    1616
    1717
    18 #ifndef GJK_CONVEX_CAST_H
    19 #define GJK_CONVEX_CAST_H
     18#ifndef BT_GJK_CONVEX_CAST_H
     19#define BT_GJK_CONVEX_CAST_H
    2020
    2121#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
     
    4848};
    4949
    50 #endif //GJK_CONVEX_CAST_H
     50#endif //BT_GJK_CONVEX_CAST_H
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h

    r8351 r8393  
    2323GJK-EPA collision solver by Nathanael Presson, 2008
    2424*/
    25 #ifndef _68DA1F85_90B7_4bb0_A705_83B4040A75C6_
    26 #define _68DA1F85_90B7_4bb0_A705_83B4040A75C6_
     25#ifndef BT_GJK_EPA2_H
     26#define BT_GJK_EPA2_H
     27
    2728#include "BulletCollision/CollisionShapes/btConvexShape.h"
    2829
     
    7172};
    7273
    73 #endif
     74#endif //BT_GJK_EPA2_H
     75
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp

    r8351 r8393  
    255255#endif //
    256256                       
    257                         m_cachedSeparatingAxis = newCachedSeparatingAxis;
    258257
    259258                        //redundant m_simplexSolver->compute_points(pointOnA, pointOnB);
     
    262261                        if (previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance)
    263262                        {
    264                                 m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
     263//                              m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
    265264                                checkSimplex = true;
    266265                                m_degenerateSimplex = 12;
     
    268267                                break;
    269268                        }
     269
     270                        m_cachedSeparatingAxis = newCachedSeparatingAxis;
    270271
    271272                          //degeneracy, this is typically due to invalid/uninitialized worldtransforms for a btCollisionObject   
     
    295296                        {
    296297                                //do we need this backup_closest here ?
    297                                 m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
     298//                              m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
    298299                                m_degenerateSimplex = 13;
    299300                                break;
     
    304305                {
    305306                        m_simplexSolver->compute_points(pointOnA, pointOnB);
    306                         normalInB = pointOnA-pointOnB;
     307                        normalInB = m_cachedSeparatingAxis;
    307308                        btScalar lenSqr =m_cachedSeparatingAxis.length2();
    308309                       
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h

    r8351 r8393  
    1717
    1818
    19 #ifndef GJK_PAIR_DETECTOR_H
    20 #define GJK_PAIR_DETECTOR_H
     19#ifndef BT_GJK_PAIR_DETECTOR_H
     20#define BT_GJK_PAIR_DETECTOR_H
    2121
    2222#include "btDiscreteCollisionDetectorInterface.h"
     
    101101};
    102102
    103 #endif //GJK_PAIR_DETECTOR_H
     103#endif //BT_GJK_PAIR_DETECTOR_H
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef MANIFOLD_CONTACT_POINT_H
    17 #define MANIFOLD_CONTACT_POINT_H
     16#ifndef BT_MANIFOLD_CONTACT_POINT_H
     17#define BT_MANIFOLD_CONTACT_POINT_H
    1818
    1919#include "LinearMath/btVector3.h"
    2020#include "LinearMath/btTransformUtil.h"
    2121
    22 // Don't change following order of parameters
    23 ATTRIBUTE_ALIGNED16(struct) PfxConstraintRow {
    24         btScalar mNormal[3];
    25         btScalar mRhs;
    26         btScalar mJacDiagInv;
    27         btScalar mLowerLimit;
    28         btScalar mUpperLimit;
    29         btScalar mAccumImpulse;
    30 };
    31 
     22#ifdef PFX_USE_FREE_VECTORMATH
     23        #include "physics_effects/base_level/solver/pfx_constraint_row.h"
     24typedef sce::PhysicsEffects::PfxConstraintRow btConstraintRow;
     25#else
     26        // Don't change following order of parameters
     27        ATTRIBUTE_ALIGNED16(struct) btConstraintRow {
     28                btScalar m_normal[3];
     29                btScalar m_rhs;
     30                btScalar m_jacDiagInv;
     31                btScalar m_lowerLimit;
     32                btScalar m_upperLimit;
     33                btScalar m_accumImpulse;
     34        };
     35        typedef btConstraintRow PfxConstraintRow;
     36#endif //PFX_USE_FREE_VECTORMATH
    3237
    3338
     
    7277                                        m_lifeTime(0)
    7378                        {
    74                                 mConstraintRow[0].mAccumImpulse = 0.f;
    75                                 mConstraintRow[1].mAccumImpulse = 0.f;
    76                                 mConstraintRow[2].mAccumImpulse = 0.f;
     79                                mConstraintRow[0].m_accumImpulse = 0.f;
     80                                mConstraintRow[1].m_accumImpulse = 0.f;
     81                                mConstraintRow[2].m_accumImpulse = 0.f;
    7782                        }
    7883
     
    114119
    115120
    116                         PfxConstraintRow mConstraintRow[3];
     121                        btConstraintRow mConstraintRow[3];
    117122
    118123
     
    151156        };
    152157
    153 #endif //MANIFOLD_CONTACT_POINT_H
     158#endif //BT_MANIFOLD_CONTACT_POINT_H
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
    17 #define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
     16#ifndef BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
     17#define BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
    1818
    1919#include "btConvexPenetrationDepthSolver.h"
     
    3737};
    3838
    39 #endif //MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
     39#endif //BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
    4040
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef PERSISTENT_MANIFOLD_H
    17 #define PERSISTENT_MANIFOLD_H
     16#ifndef BT_PERSISTENT_MANIFOLD_H
     17#define BT_PERSISTENT_MANIFOLD_H
    1818
    1919
     
    3333extern ContactProcessedCallback gContactProcessedCallback;
    3434
    35 
     35//the enum starts at 1024 to avoid type conflicts with btTypedConstraint
    3636enum btContactManifoldTypes
    3737{
    38         BT_PERSISTENT_MANIFOLD_TYPE = 1,
    39         MAX_CONTACT_MANIFOLD_TYPE
     38        MIN_CONTACT_MANIFOLD_TYPE = 1024,
     39        BT_PERSISTENT_MANIFOLD_TYPE
    4040};
    4141
     
    147147                        //get rid of duplicated userPersistentData pointer
    148148                        m_pointCache[lastUsedIndex].m_userPersistentData = 0;
    149                         m_pointCache[lastUsedIndex].mConstraintRow[0].mAccumImpulse = 0.f;
    150                         m_pointCache[lastUsedIndex].mConstraintRow[1].mAccumImpulse = 0.f;
    151                         m_pointCache[lastUsedIndex].mConstraintRow[2].mAccumImpulse = 0.f;
     149                        m_pointCache[lastUsedIndex].mConstraintRow[0].m_accumImpulse = 0.f;
     150                        m_pointCache[lastUsedIndex].mConstraintRow[1].m_accumImpulse = 0.f;
     151                        m_pointCache[lastUsedIndex].mConstraintRow[2].m_accumImpulse = 0.f;
    152152
    153153                        m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f;
     
    168168#ifdef MAINTAIN_PERSISTENCY
    169169                int     lifeTime = m_pointCache[insertIndex].getLifeTime();
    170                 btScalar        appliedImpulse = m_pointCache[insertIndex].mConstraintRow[0].mAccumImpulse;
    171                 btScalar        appliedLateralImpulse1 = m_pointCache[insertIndex].mConstraintRow[1].mAccumImpulse;
    172                 btScalar        appliedLateralImpulse2 = m_pointCache[insertIndex].mConstraintRow[2].mAccumImpulse;
     170                btScalar        appliedImpulse = m_pointCache[insertIndex].mConstraintRow[0].m_accumImpulse;
     171                btScalar        appliedLateralImpulse1 = m_pointCache[insertIndex].mConstraintRow[1].m_accumImpulse;
     172                btScalar        appliedLateralImpulse2 = m_pointCache[insertIndex].mConstraintRow[2].m_accumImpulse;
    173173//              bool isLateralFrictionInitialized = m_pointCache[insertIndex].m_lateralFrictionInitialized;
    174174               
     
    185185                m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2;
    186186               
    187                 m_pointCache[insertIndex].mConstraintRow[0].mAccumImpulse =  appliedImpulse;
    188                 m_pointCache[insertIndex].mConstraintRow[1].mAccumImpulse = appliedLateralImpulse1;
    189                 m_pointCache[insertIndex].mConstraintRow[2].mAccumImpulse = appliedLateralImpulse2;
     187                m_pointCache[insertIndex].mConstraintRow[0].m_accumImpulse =  appliedImpulse;
     188                m_pointCache[insertIndex].mConstraintRow[1].m_accumImpulse = appliedLateralImpulse1;
     189                m_pointCache[insertIndex].mConstraintRow[2].m_accumImpulse = appliedLateralImpulse2;
    190190
    191191
     
    200200        bool validContactDistance(const btManifoldPoint& pt) const
    201201        {
    202                 return pt.m_distance1 <= getContactBreakingThreshold();
     202                if (pt.m_lifeTime >1)
     203                {
     204                        return pt.m_distance1 <= getContactBreakingThreshold();
     205                }
     206                return pt.m_distance1 <= getContactProcessingThreshold();
     207       
    203208        }
    204209        /// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin
     
    225230
    226231
    227 #endif //PERSISTENT_MANIFOLD_H
     232#endif //BT_PERSISTENT_MANIFOLD_H
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btPointCollector.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef POINT_COLLECTOR_H
    17 #define POINT_COLLECTOR_H
     16#ifndef BT_POINT_COLLECTOR_H
     17#define BT_POINT_COLLECTOR_H
    1818
    1919#include "btDiscreteCollisionDetectorInterface.h"
     
    6161};
    6262
    63 #endif //POINT_COLLECTOR_H
     63#endif //BT_POINT_COLLECTOR_H
    6464
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp

    r5781 r8393  
    125125        m_convexShapeTo = convexShapeTo;
    126126        m_triangleToWorld = triangleToWorld;
    127         m_hitFraction = 1.0;
    128     m_triangleCollisionMargin = triangleCollisionMargin;
     127        m_hitFraction = 1.0f;
     128        m_triangleCollisionMargin = triangleCollisionMargin;
     129        m_allowedPenetration = 0.f;
    129130}
    130131
     
    149150        btConvexCast::CastResult castResult;
    150151        castResult.m_fraction = btScalar(1.);
     152        castResult.m_allowedPenetration = m_allowedPenetration;
    151153        if (convexCaster.calcTimeOfImpact(m_convexShapeFrom,m_convexShapeTo,m_triangleToWorld, m_triangleToWorld, castResult))
    152154        {
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef RAYCAST_TRI_CALLBACK_H
    17 #define RAYCAST_TRI_CALLBACK_H
     16#ifndef BT_RAYCAST_TRI_CALLBACK_H
     17#define BT_RAYCAST_TRI_CALLBACK_H
    1818
    1919#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
     
    5959        btTransform m_triangleToWorld;
    6060        btScalar m_hitFraction;
    61     btScalar m_triangleCollisionMargin;
     61        btScalar m_triangleCollisionMargin;
     62        btScalar m_allowedPenetration;
    6263
    6364        btTriangleConvexcastCallback (const btConvexShape* convexShape, const btTransform& convexShapeFrom, const btTransform& convexShapeTo, const btTransform& triangleToWorld, const btScalar triangleCollisionMargin);
     
    6869};
    6970
    70 #endif //RAYCAST_TRI_CALLBACK_H
     71#endif //BT_RAYCAST_TRI_CALLBACK_H
    7172
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h

    r5781 r8393  
    1616
    1717
    18 #ifndef SIMPLEX_SOLVER_INTERFACE_H
    19 #define SIMPLEX_SOLVER_INTERFACE_H
     18#ifndef BT_SIMPLEX_SOLVER_INTERFACE_H
     19#define BT_SIMPLEX_SOLVER_INTERFACE_H
    2020
    2121#include "LinearMath/btVector3.h"
     
    6060};
    6161#endif
    62 #endif //SIMPLEX_SOLVER_INTERFACE_H
     62#endif //BT_SIMPLEX_SOLVER_INTERFACE_H
    6363
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h

    r5781 r8393  
    1515
    1616
    17 #ifndef SUBSIMPLEX_CONVEX_CAST_H
    18 #define SUBSIMPLEX_CONVEX_CAST_H
     17#ifndef BT_SUBSIMPLEX_CONVEX_CAST_H
     18#define BT_SUBSIMPLEX_CONVEX_CAST_H
    1919
    2020#include "btConvexCast.h"
     
    4848};
    4949
    50 #endif //SUBSIMPLEX_CONVEX_CAST_H
     50#endif //BT_SUBSIMPLEX_CONVEX_CAST_H
  • code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h

    r8351 r8393  
    1616
    1717
    18 #ifndef btVoronoiSimplexSolver_H
    19 #define btVoronoiSimplexSolver_H
     18#ifndef BT_VORONOI_SIMPLEX_SOLVER_H
     19#define BT_VORONOI_SIMPLEX_SOLVER_H
    2020
    2121#include "btSimplexSolverInterface.h"
     
    176176};
    177177
    178 #endif //VoronoiSimplexSolver
     178#endif //BT_VORONOI_SIMPLEX_SOLVER_H
     179
  • code/trunk/src/external/bullet/BulletDynamics/Character/btCharacterControllerInterface.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CHARACTER_CONTROLLER_INTERFACE_H
    17 #define CHARACTER_CONTROLLER_INTERFACE_H
     16#ifndef BT_CHARACTER_CONTROLLER_INTERFACE_H
     17#define BT_CHARACTER_CONTROLLER_INTERFACE_H
    1818
    1919#include "LinearMath/btVector3.h"
     
    4343};
    4444
    45 #endif
     45#endif //BT_CHARACTER_CONTROLLER_INTERFACE_H
     46
  • code/trunk/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.cpp

    r8351 r8393  
    8585                {
    8686                        ///need to transform normal into worldspace
    87                         hitNormalWorld = m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;
     87                        hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;
    8888                }
    8989
  • code/trunk/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.h

    r8351 r8393  
    1515
    1616
    17 #ifndef KINEMATIC_CHARACTER_CONTROLLER_H
    18 #define KINEMATIC_CHARACTER_CONTROLLER_H
     17#ifndef BT_KINEMATIC_CHARACTER_CONTROLLER_H
     18#define BT_KINEMATIC_CHARACTER_CONTROLLER_H
    1919
    2020#include "LinearMath/btVector3.h"
     
    160160};
    161161
    162 #endif // KINEMATIC_CHARACTER_CONTROLLER_H
     162#endif // BT_KINEMATIC_CHARACTER_CONTROLLER_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp

    r8351 r8393  
    11151115
    11161116
    1117 
     1117void btConeTwistConstraint::setFrames(const btTransform & frameA, const btTransform & frameB)
     1118{
     1119        m_rbAFrame = frameA;
     1120        m_rbBFrame = frameB;
     1121        buildJacobian();
     1122        //calculateTransforms();
     1123}
     1124
     1125 
     1126
     1127
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h

    r8351 r8393  
    3434
    3535
    36 #ifndef CONETWISTCONSTRAINT_H
    37 #define CONETWISTCONSTRAINT_H
     36#ifndef BT_CONETWISTCONSTRAINT_H
     37#define BT_CONETWISTCONSTRAINT_H
    3838
    3939#include "LinearMath/btVector3.h"
     
    144144
    145145        void    updateRHS(btScalar      timeStep);
     146
    146147
    147148        const btRigidBody& getRigidBodyA() const
     
    245246        bool isPastSwingLimit() { return m_solveSwingLimit; }
    246247
    247 
    248248        void setDamping(btScalar damping) { m_damping = damping; }
    249249
     
    269269        ///If no axis is provided, it uses the default axis for this constraint.
    270270        virtual void setParam(int num, btScalar value, int axis = -1);
     271
     272        virtual void setFrames(const btTransform& frameA, const btTransform& frameB);
     273
     274        const btTransform& getFrameOffsetA() const
     275        {
     276                return m_rbAFrame;
     277        }
     278
     279        const btTransform& getFrameOffsetB() const
     280        {
     281                return m_rbBFrame;
     282        }
     283
     284
    271285        ///return the local value of parameter
    272286        virtual btScalar getParam(int num, int axis = -1) const;
     
    330344
    331345
    332 #endif //CONETWISTCONSTRAINT_H
     346#endif //BT_CONETWISTCONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btConstraintSolver.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef CONSTRAINT_SOLVER_H
    17 #define CONSTRAINT_SOLVER_H
     16#ifndef BT_CONSTRAINT_SOLVER_H
     17#define BT_CONSTRAINT_SOLVER_H
    1818
    1919#include "LinearMath/btScalar.h"
     
    5050
    5151
    52 #endif //CONSTRAINT_SOLVER_H
     52#endif //BT_CONSTRAINT_SOLVER_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactConstraint.cpp

    r8351 r8393  
    6969#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
    7070
    71 #define ASSERT2 btAssert
    7271
    73 #define USE_INTERNAL_APPLY_IMPULSE 1
     72
     73//response  between two dynamic objects without friction, assuming 0 penetration depth
     74btScalar resolveSingleCollision(
     75        btRigidBody* body1,
     76        btCollisionObject* colObj2,
     77                const btVector3& contactPositionWorld,
     78                const btVector3& contactNormalOnB,
     79        const btContactSolverInfo& solverInfo,
     80                btScalar distance)
     81{
     82        btRigidBody* body2 = btRigidBody::upcast(colObj2);
     83   
     84       
     85    const btVector3& normal = contactNormalOnB;
     86
     87    btVector3 rel_pos1 = contactPositionWorld - body1->getWorldTransform().getOrigin();
     88    btVector3 rel_pos2 = contactPositionWorld - colObj2->getWorldTransform().getOrigin();
     89   
     90    btVector3 vel1 = body1->getVelocityInLocalPoint(rel_pos1);
     91        btVector3 vel2 = body2? body2->getVelocityInLocalPoint(rel_pos2) : btVector3(0,0,0);
     92    btVector3 vel = vel1 - vel2;
     93    btScalar rel_vel;
     94    rel_vel = normal.dot(vel);
     95   
     96    btScalar combinedRestitution = body1->getRestitution() * colObj2->getRestitution();
     97    btScalar restitution = combinedRestitution* -rel_vel;
     98
     99    btScalar positionalError = solverInfo.m_erp *-distance /solverInfo.m_timeStep ;
     100    btScalar velocityError = -(1.0f + restitution) * rel_vel;// * damping;
     101        btScalar denom0 = body1->computeImpulseDenominator(contactPositionWorld,normal);
     102        btScalar denom1 = body2? body2->computeImpulseDenominator(contactPositionWorld,normal) : 0.f;
     103        btScalar relaxation = 1.f;
     104        btScalar jacDiagABInv = relaxation/(denom0+denom1);
     105
     106    btScalar penetrationImpulse = positionalError * jacDiagABInv;
     107    btScalar velocityImpulse = velocityError * jacDiagABInv;
     108
     109    btScalar normalImpulse = penetrationImpulse+velocityImpulse;
     110    normalImpulse = 0.f > normalImpulse ? 0.f: normalImpulse;
     111
     112        body1->applyImpulse(normal*(normalImpulse), rel_pos1);
     113    if (body2)
     114                body2->applyImpulse(-normal*(normalImpulse), rel_pos2);
     115   
     116    return normalImpulse;
     117}
    74118
    75119
     
    84128
    85129        btScalar normalLenSqr = normal.length2();
    86         ASSERT2(btFabs(normalLenSqr) < btScalar(1.1));
     130        btAssert(btFabs(normalLenSqr) < btScalar(1.1));
    87131        if (normalLenSqr > btScalar(1.1))
    88132        {
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactConstraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONTACT_CONSTRAINT_H
    17 #define CONTACT_CONSTRAINT_H
     16#ifndef BT_CONTACT_CONSTRAINT_H
     17#define BT_CONTACT_CONSTRAINT_H
    1818
    1919#include "LinearMath/btVector3.h"
     
    5858};
    5959
     60///very basic collision resolution without friction
     61btScalar resolveSingleCollision(btRigidBody* body1, class btCollisionObject* colObj2, const btVector3& contactPositionWorld,const btVector3& contactNormalOnB, const struct btContactSolverInfo& solverInfo,btScalar distance);
     62
    6063
    6164///resolveSingleBilateral is an obsolete methods used for vehicle friction between two dynamic objects
     
    6669
    6770
    68 #endif //CONTACT_CONSTRAINT_H
     71#endif //BT_CONTACT_CONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef CONTACT_SOLVER_INFO
    17 #define CONTACT_SOLVER_INFO
     16#ifndef BT_CONTACT_SOLVER_INFO
     17#define BT_CONTACT_SOLVER_INFO
    1818
    1919enum    btSolverMode
     
    8585};
    8686
    87 #endif //CONTACT_SOLVER_INFO
     87#endif //BT_CONTACT_SOLVER_INFO
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp

    r8351 r8393  
    711711        (void)timeStep;
    712712
     713}
     714
     715
     716void btGeneric6DofConstraint::setFrames(const btTransform& frameA, const btTransform& frameB)
     717{
     718        m_frameInA = frameA;
     719        m_frameInB = frameB;
     720        buildJacobian();
     721        calculateTransforms();
    713722}
    714723
     
    10391048        return retVal;
    10401049}
     1050
     1051 
     1052
     1053void btGeneric6DofConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
     1054{
     1055        btVector3 zAxis = axis1.normalized();
     1056        btVector3 yAxis = axis2.normalized();
     1057        btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
     1058       
     1059        btTransform frameInW;
     1060        frameInW.setIdentity();
     1061        frameInW.getBasis().setValue(   xAxis[0], yAxis[0], zAxis[0],   
     1062                                        xAxis[1], yAxis[1], zAxis[1],
     1063                                       xAxis[2], yAxis[2], zAxis[2]);
     1064       
     1065        // now get constraint frame in local coordinate systems
     1066        m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
     1067        m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
     1068       
     1069        calculateTransforms();
     1070}
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h

    r8351 r8393  
    2525
    2626
    27 #ifndef GENERIC_6DOF_CONSTRAINT_H
    28 #define GENERIC_6DOF_CONSTRAINT_H
     27#ifndef BT_GENERIC_6DOF_CONSTRAINT_H
     28#define BT_GENERIC_6DOF_CONSTRAINT_H
    2929
    3030#include "LinearMath/btVector3.h"
     
    434434        btScalar getRelativePivotPosition(int axis_index) const;
    435435
     436        void setFrames(const btTransform & frameA, const btTransform & frameB);
    436437
    437438        //! Test angular limit.
     
    447448    }
    448449
    449     void        setLinearUpperLimit(const btVector3& linearUpper)
    450     {
    451         m_linearLimits.m_upperLimit = linearUpper;
    452     }
     450        void    getLinearLowerLimit(btVector3& linearLower)
     451        {
     452                linearLower = m_linearLimits.m_lowerLimit;
     453        }
     454
     455        void    setLinearUpperLimit(const btVector3& linearUpper)
     456        {
     457                m_linearLimits.m_upperLimit = linearUpper;
     458        }
     459
     460        void    getLinearUpperLimit(btVector3& linearUpper)
     461        {
     462                linearUpper = m_linearLimits.m_upperLimit;
     463        }
    453464
    454465    void        setAngularLowerLimit(const btVector3& angularLower)
     
    458469    }
    459470
     471        void    getAngularLowerLimit(btVector3& angularLower)
     472        {
     473                for(int i = 0; i < 3; i++)
     474                        angularLower[i] = m_angularLimits[i].m_loLimit;
     475        }
     476
    460477    void        setAngularUpperLimit(const btVector3& angularUpper)
    461478    {
     
    463480                        m_angularLimits[i].m_hiLimit = btNormalizeAngle(angularUpper[i]);
    464481    }
     482
     483        void    getAngularUpperLimit(btVector3& angularUpper)
     484        {
     485                for(int i = 0; i < 3; i++)
     486                        angularUpper[i] = m_angularLimits[i].m_hiLimit;
     487        }
    465488
    466489        //! Retrieves the angular limit informacion
     
    526549        virtual btScalar getParam(int num, int axis = -1) const;
    527550
     551        void setAxis( const btVector3& axis1, const btVector3& axis2);
     552
     553
    528554        virtual int     calculateSerializeBufferSize() const;
    529555
     
    586612
    587613
    588 #endif //GENERIC_6DOF_CONSTRAINT_H
     614#endif //BT_GENERIC_6DOF_CONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp

    r8351 r8393  
    2222        : btGeneric6DofConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA)
    2323{
     24        m_objectType = D6_SPRING_CONSTRAINT_TYPE;
     25
    2426        for(int i = 0; i < 6; i++)
    2527        {
     
    148150
    149151
     152void btGeneric6DofSpringConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
     153{
     154        btVector3 zAxis = axis1.normalized();
     155        btVector3 yAxis = axis2.normalized();
     156        btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
     157
     158        btTransform frameInW;
     159        frameInW.setIdentity();
     160        frameInW.getBasis().setValue(   xAxis[0], yAxis[0], zAxis[0],   
     161                                xAxis[1], yAxis[1], zAxis[1],
     162                                xAxis[2], yAxis[2], zAxis[2]);
     163
     164        // now get constraint frame in local coordinate systems
     165        m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
     166        m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
     167
     168  calculateTransforms();
     169}
    150170
    151171
     172
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef GENERIC_6DOF_SPRING_CONSTRAINT_H
    17 #define GENERIC_6DOF_SPRING_CONSTRAINT_H
     16#ifndef BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
     17#define BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
    1818
    1919
     
    4949        void setEquilibriumPoint(int index);  // set the current constraint position/orientation as an equilibrium point for given DOF
    5050        void setEquilibriumPoint(int index, btScalar val);
     51
     52        virtual void setAxis( const btVector3& axis1, const btVector3& axis2);
     53
    5154        virtual void getInfo2 (btConstraintInfo2* info);
     55
     56        virtual int     calculateSerializeBufferSize() const;
     57        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     58        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
     59
    5260};
    5361
    54 #endif // GENERIC_6DOF_SPRING_CONSTRAINT_H
    5562
     63///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     64struct btGeneric6DofSpringConstraintData
     65{
     66        btGeneric6DofConstraintData     m_6dofData;
     67       
     68        int                     m_springEnabled[6];
     69        float           m_equilibriumPoint[6];
     70        float           m_springStiffness[6];
     71        float           m_springDamping[6];
     72};
     73
     74SIMD_FORCE_INLINE       int     btGeneric6DofSpringConstraint::calculateSerializeBufferSize() const
     75{
     76        return sizeof(btGeneric6DofSpringConstraintData);
     77}
     78
     79        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     80SIMD_FORCE_INLINE       const char*     btGeneric6DofSpringConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
     81{
     82        btGeneric6DofSpringConstraintData* dof = (btGeneric6DofSpringConstraintData*)dataBuffer;
     83        btGeneric6DofConstraint::serialize(&dof->m_6dofData,serializer);
     84
     85        int i;
     86        for (i=0;i<6;i++)
     87        {
     88                dof->m_equilibriumPoint[i] = m_equilibriumPoint[i];
     89                dof->m_springDamping[i] = m_springDamping[i];
     90                dof->m_springEnabled[i] = m_springEnabled[i]? 1 : 0;
     91                dof->m_springStiffness[i] = m_springStiffness[i];
     92        }
     93        return "btGeneric6DofConstraintData";
     94}
     95
     96#endif // BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
     97
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btHinge2Constraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef HINGE2_CONSTRAINT_H
    17 #define HINGE2_CONSTRAINT_H
     16#ifndef BT_HINGE2_CONSTRAINT_H
     17#define BT_HINGE2_CONSTRAINT_H
    1818
    1919
     
    5555
    5656
    57 #endif // HINGE2_CONSTRAINT_H
     57#endif // BT_HINGE2_CONSTRAINT_H
    5858
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp

    r8351 r8393  
    4444                                                                         m_useReferenceFrameA(useReferenceFrameA),
    4545                                                                         m_flags(0)
     46#ifdef _BT_USE_CENTER_LIMIT_
     47                                                                        ,m_limit()
     48#endif
    4649{
    4750        m_rbAFrame.getOrigin() = pivotInA;
     
    7679                                                                        rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
    7780       
     81#ifndef _BT_USE_CENTER_LIMIT_
    7882        //start with free
    7983        m_lowerLimit = btScalar(1.0f);
     
    8387        m_limitSoftness = 0.9f;
    8488        m_solveLimit = false;
     89#endif
    8590        m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
    8691}
     
    9499m_useReferenceFrameA(useReferenceFrameA),
    95100m_flags(0)
     101#ifdef  _BT_USE_CENTER_LIMIT_
     102,m_limit()
     103#endif
    96104{
    97105
     
    118126                                                                        rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
    119127       
     128#ifndef _BT_USE_CENTER_LIMIT_
    120129        //start with free
    121130        m_lowerLimit = btScalar(1.0f);
     
    125134        m_limitSoftness = 0.9f;
    126135        m_solveLimit = false;
     136#endif
    127137        m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
    128138}
     
    139149m_useReferenceFrameA(useReferenceFrameA),
    140150m_flags(0)
    141 {
     151#ifdef  _BT_USE_CENTER_LIMIT_
     152,m_limit()
     153#endif
     154{
     155#ifndef _BT_USE_CENTER_LIMIT_
    142156        //start with free
    143157        m_lowerLimit = btScalar(1.0f);
     
    147161        m_limitSoftness = 0.9f;
    148162        m_solveLimit = false;
     163#endif
    149164        m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
    150165}                       
     
    160175m_useReferenceFrameA(useReferenceFrameA),
    161176m_flags(0)
     177#ifdef  _BT_USE_CENTER_LIMIT_
     178,m_limit()
     179#endif
    162180{
    163181        ///not providing rigidbody B means implicitly using worldspace for body B
    164182
    165183        m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(m_rbAFrame.getOrigin());
    166 
     184#ifndef _BT_USE_CENTER_LIMIT_
    167185        //start with free
    168186        m_lowerLimit = btScalar(1.0f);
     
    172190        m_limitSoftness = 0.9f;
    173191        m_solveLimit = false;
     192#endif
    174193        m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
    175194}
     
    450469        if(getSolveLimit())
    451470        {
    452                 limit_err = m_correction * m_referenceSign;
    453                 limit = (limit_err > btScalar(0.0)) ? 1 : 2;
     471#ifdef  _BT_USE_CENTER_LIMIT_
     472        limit_err = m_limit.getCorrection() * m_referenceSign;
     473#else
     474        limit_err = m_correction * m_referenceSign;
     475#endif
     476        limit = (limit_err > btScalar(0.0)) ? 1 : 2;
     477
    454478        }
    455479        // if the hinge has joint limits or motor, add in the extra row
     
    515539                        }
    516540                        // bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
     541#ifdef  _BT_USE_CENTER_LIMIT_
     542                        btScalar bounce = m_limit.getRelaxationFactor();
     543#else
    517544                        btScalar bounce = m_relaxationFactor;
     545#endif
    518546                        if(bounce > btScalar(0.0))
    519547                        {
     
    545573                                }
    546574                        }
     575#ifdef  _BT_USE_CENTER_LIMIT_
     576                        info->m_constraintError[srow] *= m_limit.getBiasFactor();
     577#else
    547578                        info->m_constraintError[srow] *= m_biasFactor;
     579#endif
    548580                } // if(limit)
    549581        } // if angular limit or powered
     
    551583
    552584
    553 
    554 
     585void btHingeConstraint::setFrames(const btTransform & frameA, const btTransform & frameB)
     586{
     587        m_rbAFrame = frameA;
     588        m_rbBFrame = frameB;
     589        buildJacobian();
     590}
    555591
    556592
     
    578614
    579615
    580 #if 0
    581 void btHingeConstraint::testLimit()
    582 {
    583         // Compute limit information
    584         m_hingeAngle = getHingeAngle(); 
    585         m_correction = btScalar(0.);
    586         m_limitSign = btScalar(0.);
    587         m_solveLimit = false;
    588         if (m_lowerLimit <= m_upperLimit)
    589         {
    590                 if (m_hingeAngle <= m_lowerLimit)
    591                 {
    592                         m_correction = (m_lowerLimit - m_hingeAngle);
    593                         m_limitSign = 1.0f;
    594                         m_solveLimit = true;
    595                 }
    596                 else if (m_hingeAngle >= m_upperLimit)
    597                 {
    598                         m_correction = m_upperLimit - m_hingeAngle;
    599                         m_limitSign = -1.0f;
    600                         m_solveLimit = true;
    601                 }
    602         }
    603         return;
    604 }
    605 #else
    606 
    607616
    608617void btHingeConstraint::testLimit(const btTransform& transA,const btTransform& transB)
     
    610619        // Compute limit information
    611620        m_hingeAngle = getHingeAngle(transA,transB);
     621#ifdef  _BT_USE_CENTER_LIMIT_
     622        m_limit.test(m_hingeAngle);
     623#else
    612624        m_correction = btScalar(0.);
    613625        m_limitSign = btScalar(0.);
     
    629641                }
    630642        }
     643#endif
    631644        return;
    632645}
    633 #endif
     646
    634647
    635648static btVector3 vHinge(0, 0, btScalar(1));
     
    662675void btHingeConstraint::setMotorTarget(btScalar targetAngle, btScalar dt)
    663676{
     677#ifdef  _BT_USE_CENTER_LIMIT_
     678        m_limit.fit(targetAngle);
     679#else
    664680        if (m_lowerLimit < m_upperLimit)
    665681        {
     
    669685                        targetAngle = m_upperLimit;
    670686        }
    671 
     687#endif
    672688        // compute angular velocity
    673689        btScalar curAngle  = getHingeAngle(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
     
    840856        if(getSolveLimit())
    841857        {
    842                 limit_err = m_correction * m_referenceSign;
    843                 limit = (limit_err > btScalar(0.0)) ? 1 : 2;
     858#ifdef  _BT_USE_CENTER_LIMIT_
     859        limit_err = m_limit.getCorrection() * m_referenceSign;
     860#else
     861        limit_err = m_correction * m_referenceSign;
     862#endif
     863        limit = (limit_err > btScalar(0.0)) ? 1 : 2;
     864
    844865        }
    845866        // if the hinge has joint limits or motor, add in the extra row
     
    905926                        }
    906927                        // bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
     928#ifdef  _BT_USE_CENTER_LIMIT_
     929                        btScalar bounce = m_limit.getRelaxationFactor();
     930#else
    907931                        btScalar bounce = m_relaxationFactor;
     932#endif
    908933                        if(bounce > btScalar(0.0))
    909934                        {
     
    935960                                }
    936961                        }
     962#ifdef  _BT_USE_CENTER_LIMIT_
     963                        info->m_constraintError[srow] *= m_limit.getBiasFactor();
     964#else
    937965                        info->m_constraintError[srow] *= m_biasFactor;
     966#endif
    938967                } // if(limit)
    939968        } // if angular limit or powered
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btHingeConstraint.h

    r8351 r8393  
    1616/* Hinge Constraint by Dirk Gregorius. Limits added by Marcus Hennix at Starbreeze Studios */
    1717
    18 #ifndef HINGECONSTRAINT_H
    19 #define HINGECONSTRAINT_H
     18#ifndef BT_HINGECONSTRAINT_H
     19#define BT_HINGECONSTRAINT_H
     20
     21#define _BT_USE_CENTER_LIMIT_ 1
     22
    2023
    2124#include "LinearMath/btVector3.h"
     
    3235#define btHingeConstraintDataName       "btHingeConstraintFloatData"
    3336#endif //BT_USE_DOUBLE_PRECISION
     37
    3438
    3539
     
    5862        btScalar        m_maxMotorImpulse;
    5963
     64
     65#ifdef  _BT_USE_CENTER_LIMIT_
     66        btAngularLimit  m_limit;
     67#else
     68        btScalar        m_lowerLimit;   
     69        btScalar        m_upperLimit;   
     70        btScalar        m_limitSign;
     71        btScalar        m_correction;
     72
    6073        btScalar        m_limitSoftness;
    6174        btScalar        m_biasFactor;
    62         btScalar    m_relaxationFactor;
    63 
    64         btScalar    m_lowerLimit;       
    65         btScalar    m_upperLimit;       
    66        
     75        btScalar        m_relaxationFactor;
     76
     77        bool            m_solveLimit;
     78#endif
     79
    6780        btScalar        m_kHinge;
    6881
    69         btScalar        m_limitSign;
    70         btScalar        m_correction;
    7182
    7283        btScalar        m_accLimitImpulse;
    7384        btScalar        m_hingeAngle;
    74         btScalar    m_referenceSign;
     85        btScalar        m_referenceSign;
    7586
    7687        bool            m_angularOnly;
    7788        bool            m_enableAngularMotor;
    78         bool            m_solveLimit;
    7989        bool            m_useSolveConstraintObsolete;
    8090        bool            m_useOffsetForConstraintFrame;
     
    133143        {               
    134144                return m_rbB;   
    135         }       
     145        }
     146
     147        btTransform& getFrameOffsetA()
     148        {
     149        return m_rbAFrame;
     150        }
     151
     152        btTransform& getFrameOffsetB()
     153        {
     154                return m_rbBFrame;
     155        }
     156
     157        void setFrames(const btTransform& frameA, const btTransform& frameB);
    136158       
    137159        void    setAngularOnly(bool angularOnly)
     
    158180        void    setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
    159181        {
     182#ifdef  _BT_USE_CENTER_LIMIT_
     183                m_limit.set(low, high, _softness, _biasFactor, _relaxationFactor);
     184#else
    160185                m_lowerLimit = btNormalizeAngle(low);
    161186                m_upperLimit = btNormalizeAngle(high);
    162 
    163187                m_limitSoftness =  _softness;
    164188                m_biasFactor = _biasFactor;
    165189                m_relaxationFactor = _relaxationFactor;
    166 
     190#endif
    167191        }
    168192
     
    183207                btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
    184208
    185 
    186                 m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(pivotInA);
     209                m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
     210
    187211                m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
    188212                                                                                rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
    189213                                                                                rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
     214                m_rbBFrame.getBasis() = m_rbB.getCenterOfMassTransform().getBasis().inverse() * m_rbBFrame.getBasis();
     215
    190216        }
    191217
    192218        btScalar        getLowerLimit() const
    193219        {
    194                 return m_lowerLimit;
     220#ifdef  _BT_USE_CENTER_LIMIT_
     221        return m_limit.getLow();
     222#else
     223        return m_lowerLimit;
     224#endif
    195225        }
    196226
    197227        btScalar        getUpperLimit() const
    198228        {
    199                 return m_upperLimit;
     229#ifdef  _BT_USE_CENTER_LIMIT_
     230        return m_limit.getHigh();
     231#else           
     232        return m_upperLimit;
     233#endif
    200234        }
    201235
     
    216250        inline int getSolveLimit()
    217251        {
    218                 return m_solveLimit;
     252#ifdef  _BT_USE_CENTER_LIMIT_
     253        return m_limit.isLimit();
     254#else
     255        return m_solveLimit;
     256#endif
    219257        }
    220258
    221259        inline btScalar getLimitSign()
    222260        {
     261#ifdef  _BT_USE_CENTER_LIMIT_
     262        return m_limit.getSign();
     263#else
    223264                return m_limitSign;
     265#endif
    224266        }
    225267
     
    320362        hingeData->m_motorTargetVelocity = float(m_motorTargetVelocity);
    321363        hingeData->m_useReferenceFrameA = m_useReferenceFrameA;
    322        
     364#ifdef  _BT_USE_CENTER_LIMIT_
     365        hingeData->m_lowerLimit = float(m_limit.getLow());
     366        hingeData->m_upperLimit = float(m_limit.getHigh());
     367        hingeData->m_limitSoftness = float(m_limit.getSoftness());
     368        hingeData->m_biasFactor = float(m_limit.getBiasFactor());
     369        hingeData->m_relaxationFactor = float(m_limit.getRelaxationFactor());
     370#else
    323371        hingeData->m_lowerLimit = float(m_lowerLimit);
    324372        hingeData->m_upperLimit = float(m_upperLimit);
     
    326374        hingeData->m_biasFactor = float(m_biasFactor);
    327375        hingeData->m_relaxationFactor = float(m_relaxationFactor);
     376#endif
    328377
    329378        return btHingeConstraintDataName;
    330379}
    331380
    332 #endif //HINGECONSTRAINT_H
     381#endif //BT_HINGECONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btJacobianEntry.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef JACOBIAN_ENTRY_H
    17 #define JACOBIAN_ENTRY_H
     16#ifndef BT_JACOBIAN_ENTRY_H
     17#define BT_JACOBIAN_ENTRY_H
    1818
    1919#include "LinearMath/btVector3.h"
     
    154154};
    155155
    156 #endif //JACOBIAN_ENTRY_H
     156#endif //BT_JACOBIAN_ENTRY_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef POINT2POINTCONSTRAINT_H
    17 #define POINT2POINTCONSTRAINT_H
     16#ifndef BT_POINT2POINTCONSTRAINT_H
     17#define BT_POINT2POINTCONSTRAINT_H
    1818
    1919#include "LinearMath/btVector3.h"
     
    159159}
    160160
    161 #endif //POINT2POINTCONSTRAINT_H
     161#endif //BT_POINT2POINTCONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp

    r8351 r8393  
    4949#ifdef USE_SIMD
    5050#include <emmintrin.h>
    51 #define vec_splat(x, e) _mm_shuffle_ps(x, x, _MM_SHUFFLE(e,e,e,e))
    52 static inline __m128 _vmathVfDot3( __m128 vec0, __m128 vec1 )
     51#define btVecSplat(x, e) _mm_shuffle_ps(x, x, _MM_SHUFFLE(e,e,e,e))
     52static inline __m128 btSimdDot3( __m128 vec0, __m128 vec1 )
    5353{
    5454        __m128 result = _mm_mul_ps( vec0, vec1);
    55         return _mm_add_ps( vec_splat( result, 0 ), _mm_add_ps( vec_splat( result, 1 ), vec_splat( result, 2 ) ) );
     55        return _mm_add_ps( btVecSplat( result, 0 ), _mm_add_ps( btVecSplat( result, 1 ), btVecSplat( result, 2 ) ) );
    5656}
    5757#endif//USE_SIMD
     
    6565        __m128  upperLimit1 = _mm_set1_ps(c.m_upperLimit);
    6666        __m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhs), _mm_mul_ps(_mm_set1_ps(c.m_appliedImpulse),_mm_set1_ps(c.m_cfm)));
    67         __m128 deltaVel1Dotn    =       _mm_add_ps(_vmathVfDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), _vmathVfDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
    68         __m128 deltaVel2Dotn    =       _mm_sub_ps(_vmathVfDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),_vmathVfDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
     67        __m128 deltaVel1Dotn    =       _mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
     68        __m128 deltaVel2Dotn    =       _mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
    6969        deltaImpulse    =       _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
    7070        deltaImpulse    =       _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
     
    128128        __m128  upperLimit1 = _mm_set1_ps(c.m_upperLimit);
    129129        __m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhs), _mm_mul_ps(_mm_set1_ps(c.m_appliedImpulse),_mm_set1_ps(c.m_cfm)));
    130         __m128 deltaVel1Dotn    =       _mm_add_ps(_vmathVfDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), _vmathVfDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
    131         __m128 deltaVel2Dotn    =       _mm_sub_ps(_vmathVfDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),_vmathVfDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
     130        __m128 deltaVel1Dotn    =       _mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
     131        __m128 deltaVel2Dotn    =       _mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
    132132        deltaImpulse    =       _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
    133133        deltaImpulse    =       _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
     
    216216        __m128  upperLimit1 = _mm_set1_ps(c.m_upperLimit);
    217217        __m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhsPenetration), _mm_mul_ps(_mm_set1_ps(c.m_appliedPushImpulse),_mm_set1_ps(c.m_cfm)));
    218         __m128 deltaVel1Dotn    =       _mm_add_ps(_vmathVfDot3(c.m_contactNormal.mVec128,body1.internalGetPushVelocity().mVec128), _vmathVfDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetTurnVelocity().mVec128));
    219         __m128 deltaVel2Dotn    =       _mm_sub_ps(_vmathVfDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetTurnVelocity().mVec128),_vmathVfDot3((c.m_contactNormal).mVec128,body2.internalGetPushVelocity().mVec128));
     218        __m128 deltaVel1Dotn    =       _mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetPushVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetTurnVelocity().mVec128));
     219        __m128 deltaVel2Dotn    =       _mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetTurnVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetPushVelocity().mVec128));
    220220        deltaImpulse    =       _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
    221221        deltaImpulse    =       _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
     
    558558
    559559                                        btScalar positionalError = 0.f;
    560                                         positionalError = -penetration * infoGlobal.m_erp/infoGlobal.m_timeStep;
    561560                                        btScalar        velocityError = restitution - rel_vel;// * damping;
     561
     562                                        if (penetration>0)
     563                                        {
     564                                                positionalError = 0;
     565                                                velocityError -= penetration / infoGlobal.m_timeStep;
     566                                        } else
     567                                        {
     568                                                positionalError = -penetration * infoGlobal.m_erp/infoGlobal.m_timeStep;
     569                                        }
     570
    562571                                        btScalar  penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
    563572                                        btScalar velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
     
    780789                        btTypedConstraint* constraint = constraints[j];
    781790                        constraint->buildJacobian();
     791                        constraint->internalSetAppliedImpulse(0.0f);
    782792                }
    783793        }
     
    796806                        {
    797807                                btTypedConstraint::btConstraintInfo1& info1 = m_tmpConstraintSizesPool[i];
    798                                 constraints[i]->getInfo1(&info1);
     808                                if (constraints[i]->isEnabled())
     809                                {
     810                                        constraints[i]->getInfo1(&info1);
     811                                } else
     812                                {
     813                                        info1.m_numConstraintRows = 0;
     814                                        info1.nub = 0;
     815                                }
    799816                                totalNumRows += info1.m_numConstraintRows;
    800817                        }
     
    817834
    818835
    819 
    820836                                        btRigidBody& rbA = constraint->getRigidBodyA();
    821837                                        btRigidBody& rbB = constraint->getRigidBodyB();
     
    826842                                        {
    827843                                                memset(&currentConstraintRow[j],0,sizeof(btSolverConstraint));
    828                                                 currentConstraintRow[j].m_lowerLimit = -FLT_MAX;
    829                                                 currentConstraintRow[j].m_upperLimit = FLT_MAX;
     844                                                currentConstraintRow[j].m_lowerLimit = -SIMD_INFINITY;
     845                                                currentConstraintRow[j].m_upperLimit = SIMD_INFINITY;
    830846                                                currentConstraintRow[j].m_appliedImpulse = 0.f;
    831847                                                currentConstraintRow[j].m_appliedPushImpulse = 0.f;
     
    860876                                        constraints[i]->getInfo2(&info2);
    861877
     878                                        if (currentConstraintRow->m_upperLimit>constraints[i]->getBreakingImpulseThreshold())
     879                                        {
     880                                                currentConstraintRow->m_upperLimit = constraints[i]->getBreakingImpulseThreshold();
     881                                        }
     882
     883                                        if (currentConstraintRow->m_lowerLimit<-constraints[i]->getBreakingImpulseThreshold())
     884                                        {
     885                                                currentConstraintRow->m_lowerLimit = -constraints[i]->getBreakingImpulseThreshold();
     886                                        }
     887
     888
     889
    862890                                        ///finalize the constraint setup
    863891                                        for ( j=0;j<info1.m_numConstraintRows;j++)
     
    11071135        int iteration;
    11081136        {
     1137                solveGroupCacheFriendlySplitImpulseIterations(bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);
     1138
    11091139                for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
    11101140                {                       
     
    11121142                }
    11131143               
    1114                 solveGroupCacheFriendlySplitImpulseIterations(bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);
    11151144        }
    11161145        return 0.f;
     
    11431172                const btSolverConstraint& solverConstr = m_tmpSolverNonContactConstraintPool[j];
    11441173                btTypedConstraint* constr = (btTypedConstraint*)solverConstr.m_originalContactPoint;
    1145                 btScalar sum = constr->internalGetAppliedImpulse();
    1146                 sum += solverConstr.m_appliedImpulse;
    1147                 constr->internalSetAppliedImpulse(sum);
     1174                constr->internalSetAppliedImpulse(solverConstr.m_appliedImpulse);
     1175                if (solverConstr.m_appliedImpulse>constr->getBreakingImpulseThreshold())
     1176                {
     1177                        constr->setEnabled(false);
     1178                }
    11481179        }
    11491180
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
    17 #define SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
     16#ifndef BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
     17#define BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
    1818
    1919#include "btConstraintSolver.h"
     
    125125
    126126
    127 #endif //SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
     127#endif //BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
    128128
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSliderConstraint.h

    r8351 r8393  
    2323*/
    2424
    25 #ifndef SLIDER_CONSTRAINT_H
    26 #define SLIDER_CONSTRAINT_H
     25#ifndef BT_SLIDER_CONSTRAINT_H
     26#define BT_SLIDER_CONSTRAINT_H
    2727
    2828
     
    237237        void setMaxAngMotorForce(btScalar maxAngMotorForce) { m_maxAngMotorForce = maxAngMotorForce; }
    238238        btScalar getMaxAngMotorForce() { return m_maxAngMotorForce; }
    239         btScalar getLinearPos() { return m_linPos; }
     239
     240        btScalar getLinearPos() const { return m_linPos; }
     241        btScalar getAngularPos() const { return m_angPos; }
     242       
    240243       
    241244
     
    256259        void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
    257260
     261        void setFrames(const btTransform& frameA, const btTransform& frameB)
     262        {
     263                m_frameInA=frameA;
     264                m_frameInB=frameB;
     265                calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
     266                buildJacobian();
     267        }
     268
     269
    258270        ///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5).
    259271        ///If no axis is provided, it uses the default axis for this constraint.
     
    318330
    319331
    320 #endif //SLIDER_CONSTRAINT_H
    321 
     332#endif //BT_SLIDER_CONSTRAINT_H
     333
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h

    r5781 r8393  
    1414*/
    1515
    16 #ifndef SOLVE_2LINEAR_CONSTRAINT_H
    17 #define SOLVE_2LINEAR_CONSTRAINT_H
     16#ifndef BT_SOLVE_2LINEAR_CONSTRAINT_H
     17#define BT_SOLVE_2LINEAR_CONSTRAINT_H
    1818
    1919#include "LinearMath/btMatrix3x3.h"
     
    105105};
    106106
    107 #endif //SOLVE_2LINEAR_CONSTRAINT_H
     107#endif //BT_SOLVE_2LINEAR_CONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp

    r8351 r8393  
    3030m_rbB(getFixedBody()),
    3131m_appliedImpulse(btScalar(0.)),
    32 m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
     32m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
     33m_breakingImpulseThreshold(SIMD_INFINITY),
     34m_isEnabled(true)
    3335{
    3436}
     
    4345m_rbB(rbB),
    4446m_appliedImpulse(btScalar(0.)),
    45 m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
     47m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
     48m_breakingImpulseThreshold(SIMD_INFINITY),
     49m_isEnabled(true)
    4650{
    4751}
     
    141145}
    142146
     147
     148void btAngularLimit::set(btScalar low, btScalar high, btScalar _softness, btScalar _biasFactor, btScalar _relaxationFactor)
     149{
     150        m_halfRange = (high - low) / 2.0f;
     151        m_center = btNormalizeAngle(low + m_halfRange);
     152        m_softness =  _softness;
     153        m_biasFactor = _biasFactor;
     154        m_relaxationFactor = _relaxationFactor;
     155}
     156
     157void btAngularLimit::test(const btScalar angle)
     158{
     159        m_correction = 0.0f;
     160        m_sign = 0.0f;
     161        m_solveLimit = false;
     162
     163        if (m_halfRange >= 0.0f)
     164        {
     165                btScalar deviation = btNormalizeAngle(angle - m_center);
     166                if (deviation < -m_halfRange)
     167                {
     168                        m_solveLimit = true;
     169                        m_correction = - (deviation + m_halfRange);
     170                        m_sign = +1.0f;
     171                }
     172                else if (deviation > m_halfRange)
     173                {
     174                        m_solveLimit = true;
     175                        m_correction = m_halfRange - deviation;
     176                        m_sign = -1.0f;
     177                }
     178        }
     179}
     180
     181
     182btScalar btAngularLimit::getError() const
     183{
     184        return m_correction * m_sign;
     185}
     186
     187void btAngularLimit::fit(btScalar& angle) const
     188{
     189        if (m_halfRange > 0.0f)
     190        {
     191                btScalar relativeAngle = btNormalizeAngle(angle - m_center);
     192                if (!btEqual(relativeAngle, m_halfRange))
     193                {
     194                        if (relativeAngle > 0.0f)
     195                        {
     196                                angle = getHigh();
     197                        }
     198                        else
     199                        {
     200                                angle = getLow();
     201                        }
     202                }
     203        }
     204}
     205
     206btScalar btAngularLimit::getLow() const
     207{
     208        return btNormalizeAngle(m_center - m_halfRange);
     209}
     210
     211btScalar btAngularLimit::getHigh() const
     212{
     213        return btNormalizeAngle(m_center + m_halfRange);
     214}
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef TYPED_CONSTRAINT_H
    17 #define TYPED_CONSTRAINT_H
     16#ifndef BT_TYPED_CONSTRAINT_H
     17#define BT_TYPED_CONSTRAINT_H
    1818
    1919class btRigidBody;
    2020#include "LinearMath/btScalar.h"
    2121#include "btSolverConstraint.h"
    22 #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
    2322
    2423class btSerializer;
    2524
     25//Don't change any of the existing enum values, so add enum types at the end for serialization compatibility
    2626enum btTypedConstraintType
    2727{
    28         POINT2POINT_CONSTRAINT_TYPE=MAX_CONTACT_MANIFOLD_TYPE+1,
     28        POINT2POINT_CONSTRAINT_TYPE=3,
    2929        HINGE_CONSTRAINT_TYPE,
    3030        CONETWIST_CONSTRAINT_TYPE,
    3131        D6_CONSTRAINT_TYPE,
    3232        SLIDER_CONSTRAINT_TYPE,
    33         CONTACT_CONSTRAINT_TYPE
     33        CONTACT_CONSTRAINT_TYPE,
     34        D6_SPRING_CONSTRAINT_TYPE,
     35        MAX_CONSTRAINT_TYPE
    3436};
    3537
     
    6062                void* m_userConstraintPtr;
    6163        };
     64
     65        btScalar        m_breakingImpulseThreshold;
     66        bool            m_isEnabled;
     67
    6268
    6369        bool m_needsFeedback;
     
    154160        }
    155161
     162
     163        btScalar        getBreakingImpulseThreshold() const
     164        {
     165                return  m_breakingImpulseThreshold;
     166        }
     167
     168        void    setBreakingImpulseThreshold(btScalar threshold)
     169        {
     170                m_breakingImpulseThreshold = threshold;
     171        }
     172
     173        bool    isEnabled() const
     174        {
     175                return m_isEnabled;
     176        }
     177
     178        void    setEnabled(bool enabled)
     179        {
     180                m_isEnabled=enabled;
     181        }
     182
     183
    156184        ///internal method used by the constraint solver, don't use them directly
    157185        virtual void    solveConstraintObsolete(btRigidBody& /*bodyA*/,btRigidBody& /*bodyB*/,btScalar  /*timeStep*/) {};
     
    312340
    313341
    314 
    315 #endif //TYPED_CONSTRAINT_H
     342class btAngularLimit
     343{
     344private:
     345        btScalar
     346                m_center,
     347                m_halfRange,
     348                m_softness,
     349                m_biasFactor,
     350                m_relaxationFactor,
     351                m_correction,
     352                m_sign;
     353
     354        bool
     355                m_solveLimit;
     356
     357public:
     358        /// Default constructor initializes limit as inactive, allowing free constraint movement
     359        btAngularLimit()
     360                :m_center(0.0f),
     361                m_halfRange(-1.0f),
     362                m_softness(0.9f),
     363                m_biasFactor(0.3f),
     364                m_relaxationFactor(1.0f),
     365                m_correction(0.0f),
     366                m_sign(0.0f),
     367                m_solveLimit(false)
     368        {}
     369
     370        /// Sets all limit's parameters.
     371        /// When low > high limit becomes inactive.
     372        /// When high - low > 2PI limit is ineffective too becouse no angle can exceed the limit
     373        void set(btScalar low, btScalar high, btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f);
     374
     375        /// Checks conastaint angle against limit. If limit is active and the angle violates the limit
     376        /// correction is calculated.
     377        void test(const btScalar angle);
     378
     379        /// Returns limit's softness
     380        inline btScalar getSoftness() const
     381        {
     382                return m_softness;
     383        }
     384
     385        /// Returns limit's bias factor
     386        inline btScalar getBiasFactor() const
     387        {
     388                return m_biasFactor;
     389        }
     390
     391        /// Returns limit's relaxation factor
     392        inline btScalar getRelaxationFactor() const
     393        {
     394                return m_relaxationFactor;
     395        }
     396
     397        /// Returns correction value evaluated when test() was invoked
     398        inline btScalar getCorrection() const
     399        {
     400                return m_correction;
     401        }
     402
     403        /// Returns sign value evaluated when test() was invoked
     404        inline btScalar getSign() const
     405        {
     406                return m_sign;
     407        }
     408
     409        /// Gives half of the distance between min and max limit angle
     410        inline btScalar getHalfRange() const
     411        {
     412                return m_halfRange;
     413        }
     414
     415        /// Returns true when the last test() invocation recognized limit violation
     416        inline bool isLimit() const
     417        {
     418                return m_solveLimit;
     419        }
     420
     421        /// Checks given angle against limit. If limit is active and angle doesn't fit it, the angle
     422        /// returned is modified so it equals to the limit closest to given angle.
     423        void fit(btScalar& angle) const;
     424
     425        /// Returns correction value multiplied by sign value
     426        btScalar getError() const;
     427
     428        btScalar getLow() const;
     429
     430        btScalar getHigh() const;
     431
     432};
     433
     434
     435
     436#endif //BT_TYPED_CONSTRAINT_H
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp

    r8351 r8393  
    6262}
    6363
     64void btUniversalConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
     65{
     66  m_axis1 = axis1;
     67  m_axis2 = axis2;
     68
     69        btVector3 zAxis = axis1.normalized();
     70        btVector3 yAxis = axis2.normalized();
     71        btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
     72
     73        btTransform frameInW;
     74        frameInW.setIdentity();
     75        frameInW.getBasis().setValue(   xAxis[0], yAxis[0], zAxis[0],   
     76                                xAxis[1], yAxis[1], zAxis[1],
     77                                xAxis[2], yAxis[2], zAxis[2]);
     78        frameInW.setOrigin(m_anchor);
     79
     80        // now get constraint frame in local coordinate systems
     81        m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
     82        m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
     83
     84  calculateTransforms();
     85}
     86
     87
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btUniversalConstraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef UNIVERSAL_CONSTRAINT_H
    17 #define UNIVERSAL_CONSTRAINT_H
     16#ifndef BT_UNIVERSAL_CONSTRAINT_H
     17#define BT_UNIVERSAL_CONSTRAINT_H
    1818
    1919
     
    5353        void setUpperLimit(btScalar ang1max, btScalar ang2max) { setAngularUpperLimit(btVector3(0.f, ang1max, ang2max)); }
    5454        void setLowerLimit(btScalar ang1min, btScalar ang2min) { setAngularLowerLimit(btVector3(0.f, ang1min, ang2min)); }
     55
     56        void setAxis( const btVector3& axis1, const btVector3& axis2);
    5557};
    5658
    5759
    5860
    59 #endif // UNIVERSAL_CONSTRAINT_H
     61#endif // BT_UNIVERSAL_CONSTRAINT_H
    6062
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp

    r8351 r8393  
    3636#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h"
    3737#include "BulletDynamics/ConstraintSolver/btSliderConstraint.h"
     38#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
     39
    3840
    3941#include "LinearMath/btIDebugDraw.h"
     
    4648
    4749#include "LinearMath/btSerializer.h"
     50
     51#if 0
     52btAlignedObjectArray<btVector3> debugContacts;
     53btAlignedObjectArray<btVector3> debugNormals;
     54int startHit=2;
     55int firstHit=startHit;
     56#endif
    4857
    4958
     
    315324        dispatchInfo.m_debugDraw = getDebugDrawer();
    316325
     326
    317327        ///perform collision detection
    318328        performDiscreteCollisionDetection();
     329
     330        if (getDispatchInfo().m_useContinuous)
     331                addSpeculativeContacts(timeStep);
     332
    319333
    320334        calculateSimulationIslands();
     
    746760class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback
    747761{
     762public:
     763
    748764        btCollisionObject* m_me;
    749765        btScalar m_allowedPenetration;
    750766        btOverlappingPairCache* m_pairCache;
    751767        btDispatcher* m_dispatcher;
    752 
    753768
    754769public:
     
    798813                if (m_dispatcher->needsResponse(m_me,otherObj))
    799814                {
     815#if 0
    800816                        ///don't do CCD when there are already contact points (touching contact/penetration)
    801817                        btAlignedObjectArray<btPersistentManifold*> manifoldArray;
     
    815831                                }
    816832                        }
    817                 }
    818                 return true;
     833#endif
     834                        return true;
     835                }
     836
     837                return false;
    819838        }
    820839
     
    825844int gNumClampedCcdMotions=0;
    826845
    827 //#include "stdio.h"
    828846void    btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep)
    829847{
     
    837855                if (body->isActive() && (!body->isStaticOrKinematicObject()))
    838856                {
     857
     858                        body->predictIntegratedTransform(timeStep, predictedTrans);
     859                       
     860                        btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
     861
     862                       
     863
     864                        if (getDispatchInfo().m_useContinuous && body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion)
     865                        {
     866                                BT_PROFILE("CCD motion clamping");
     867                                if (body->getCollisionShape()->isConvex())
     868                                {
     869                                        gNumClampedCcdMotions++;
     870#ifdef USE_STATIC_ONLY
     871                                        class StaticOnlyCallback : public btClosestNotMeConvexResultCallback
     872                                        {
     873                                        public:
     874
     875                                                StaticOnlyCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) :
     876                                                  btClosestNotMeConvexResultCallback(me,fromA,toA,pairCache,dispatcher)
     877                                                {
     878                                                }
     879
     880                                                virtual bool needsCollision(btBroadphaseProxy* proxy0) const
     881                                                {
     882                                                        btCollisionObject* otherObj = (btCollisionObject*) proxy0->m_clientObject;
     883                                                        if (!otherObj->isStaticOrKinematicObject())
     884                                                                return false;
     885                                                        return btClosestNotMeConvexResultCallback::needsCollision(proxy0);
     886                                                }
     887                                        };
     888
     889                                        StaticOnlyCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
     890#else
     891                                        btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
     892#endif
     893                                        //btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
     894                                        btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
     895                                        sweepResults.m_allowedPenetration=getDispatchInfo().m_allowedCcdPenetration;
     896
     897                                        sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
     898                                        sweepResults.m_collisionFilterMask  = body->getBroadphaseProxy()->m_collisionFilterMask;
     899                                        btTransform modifiedPredictedTrans = predictedTrans;
     900                                        modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis());
     901
     902                                        convexSweepTest(&tmpSphere,body->getWorldTransform(),modifiedPredictedTrans,sweepResults);
     903                                        if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f))
     904                                        {
     905                                               
     906                                                //printf("clamped integration to hit fraction = %f\n",fraction);
     907                                                body->setHitFraction(sweepResults.m_closestHitFraction);
     908                                                body->predictIntegratedTransform(timeStep*body->getHitFraction(), predictedTrans);
     909                                                body->setHitFraction(0.f);
     910                                                body->proceedToTransform( predictedTrans);
     911
     912#if 0
     913                                                btVector3 linVel = body->getLinearVelocity();
     914
     915                                                btScalar maxSpeed = body->getCcdMotionThreshold()/getSolverInfo().m_timeStep;
     916                                                btScalar maxSpeedSqr = maxSpeed*maxSpeed;
     917                                                if (linVel.length2()>maxSpeedSqr)
     918                                                {
     919                                                        linVel.normalize();
     920                                                        linVel*= maxSpeed;
     921                                                        body->setLinearVelocity(linVel);
     922                                                        btScalar ms2 = body->getLinearVelocity().length2();
     923                                                        body->predictIntegratedTransform(timeStep, predictedTrans);
     924
     925                                                        btScalar sm2 = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
     926                                                        btScalar smt = body->getCcdSquareMotionThreshold();
     927                                                        printf("sm2=%f\n",sm2);
     928                                                }
     929#else
     930                                                //response  between two dynamic objects without friction, assuming 0 penetration depth
     931                                                btScalar appliedImpulse = 0.f;
     932                                                btScalar depth = 0.f;
     933                                                appliedImpulse = resolveSingleCollision(body,sweepResults.m_hitCollisionObject,sweepResults.m_hitPointWorld,sweepResults.m_hitNormalWorld,getSolverInfo(), depth);
     934                                               
     935
     936#endif
     937
     938                                        continue;
     939                                        }
     940                                }
     941                        }
     942                       
     943
     944                        body->proceedToTransform( predictedTrans);
     945                }
     946        }
     947}
     948
     949void    btDiscreteDynamicsWorld::addSpeculativeContacts(btScalar timeStep)
     950{
     951        BT_PROFILE("addSpeculativeContacts");
     952        btTransform predictedTrans;
     953        for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
     954        {
     955                btRigidBody* body = m_nonStaticRigidBodies[i];
     956                body->setHitFraction(1.f);
     957
     958                if (body->isActive() && (!body->isStaticOrKinematicObject()))
     959                {
    839960                        body->predictIntegratedTransform(timeStep, predictedTrans);
    840961                        btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
     
    842963                        if (body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion)
    843964                        {
    844                                 BT_PROFILE("CCD motion clamping");
     965                                BT_PROFILE("search speculative contacts");
    845966                                if (body->getCollisionShape()->isConvex())
    846967                                {
     
    853974                                        sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
    854975                                        sweepResults.m_collisionFilterMask  = body->getBroadphaseProxy()->m_collisionFilterMask;
    855 
    856                                         convexSweepTest(&tmpSphere,body->getWorldTransform(),predictedTrans,sweepResults);
     976                                        btTransform modifiedPredictedTrans;
     977                                        modifiedPredictedTrans = predictedTrans;
     978                                        modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis());
     979
     980                                        convexSweepTest(&tmpSphere,body->getWorldTransform(),modifiedPredictedTrans,sweepResults);
    857981                                        if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f))
    858982                                        {
    859                                                 body->setHitFraction(sweepResults.m_closestHitFraction);
    860                                                 body->predictIntegratedTransform(timeStep*body->getHitFraction(), predictedTrans);
    861                                                 body->setHitFraction(0.f);
    862 //                                                      printf("clamped integration to hit fraction = %f\n",fraction);
     983                                                btBroadphaseProxy* proxy0 = body->getBroadphaseHandle();
     984                                                btBroadphaseProxy* proxy1 = sweepResults.m_hitCollisionObject->getBroadphaseHandle();
     985                                                btBroadphasePair* pair = sweepResults.m_pairCache->findPair(proxy0,proxy1);
     986                                                if (pair)
     987                                                {
     988                                                        if (pair->m_algorithm)
     989                                                        {
     990                                                                btManifoldArray contacts;
     991                                                                pair->m_algorithm->getAllContactManifolds(contacts);
     992                                                                if (contacts.size())
     993                                                                {
     994                                                                        btManifoldResult result(body,sweepResults.m_hitCollisionObject);
     995                                                                        result.setPersistentManifold(contacts[0]);
     996
     997                                                                        btVector3 vec = (modifiedPredictedTrans.getOrigin()-body->getWorldTransform().getOrigin());
     998                                                                        vec*=sweepResults.m_closestHitFraction;
     999                                                                       
     1000                                                                        btScalar lenSqr = vec.length2();
     1001                                                                        btScalar depth = 0.f;
     1002                                                                        btVector3 pointWorld = sweepResults.m_hitPointWorld;
     1003                                                                        if (lenSqr>SIMD_EPSILON)
     1004                                                                        {
     1005                                                                                depth = btSqrt(lenSqr);
     1006                                                                                pointWorld -= vec;
     1007                                                                                vec /= depth;
     1008                                                                        }
     1009
     1010                                                                        if (contacts[0]->getBody0()==body)
     1011                                                                        {
     1012                                                                                result.addContactPoint(sweepResults.m_hitNormalWorld,pointWorld,depth);
     1013#if 0
     1014                                                                                debugContacts.push_back(sweepResults.m_hitPointWorld);//sweepResults.m_hitPointWorld);
     1015                                                                                debugNormals.push_back(sweepResults.m_hitNormalWorld);
     1016#endif
     1017                                                                        } else
     1018                                                                        {
     1019                                                                                //swapped
     1020                                                                                result.addContactPoint(-sweepResults.m_hitNormalWorld,pointWorld,depth);
     1021                                                                                //sweepResults.m_hitPointWorld,depth);
     1022                                                                               
     1023#if 0
     1024                                                                                if (1)//firstHit==1)
     1025                                                                                {
     1026                                                                                        firstHit=0;
     1027                                                                                        debugNormals.push_back(sweepResults.m_hitNormalWorld);
     1028                                                                                        debugContacts.push_back(pointWorld);//sweepResults.m_hitPointWorld);
     1029                                                                                        debugNormals.push_back(sweepResults.m_hitNormalWorld);
     1030                                                                                        debugContacts.push_back(sweepResults.m_hitPointWorld);
     1031                                                                                }
     1032                                                                                firstHit--;
     1033#endif
     1034                                                                        }
     1035                                                                }
     1036
     1037                                                        } else
     1038                                                        {
     1039                                                                //no algorithm, use dispatcher to create one
     1040
     1041                                                        }
     1042
     1043
     1044                                                } else
     1045                                                {
     1046                                                        //add an overlapping pair
     1047                                                        //printf("pair missing\n");
     1048
     1049                                                }
    8631050                                        }
    8641051                                }
    8651052                        }
    8661053                       
    867                         body->proceedToTransform( predictedTrans);
    8681054                }
    8691055        }
     
    10101196                        }
    10111197                        break;
     1198                case D6_SPRING_CONSTRAINT_TYPE:
    10121199                case D6_CONSTRAINT_TYPE:
    10131200                        {
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h

    r8351 r8393  
    6363        virtual void    integrateTransforms(btScalar timeStep);
    6464               
     65        virtual void    addSpeculativeContacts(btScalar timeStep);
     66
    6567        virtual void    calculateSimulationIslands();
    6668
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btDynamicsWorld.h

    r8351 r8393  
    3333        BT_SIMPLE_DYNAMICS_WORLD=1,
    3434        BT_DISCRETE_DYNAMICS_WORLD=2,
    35         BT_CONTINUOUS_DYNAMICS_WORLD=3
     35        BT_CONTINUOUS_DYNAMICS_WORLD=3,
     36        BT_SOFT_RIGID_DYNAMICS_WORLD=4
    3637};
    3738
     
    8687
    8788                virtual void    addRigidBody(btRigidBody* body) = 0;
     89
     90                virtual void    addRigidBody(btRigidBody* body, short group, short mask) = 0;
    8891
    8992                virtual void    removeRigidBody(btRigidBody* body) = 0;
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btRigidBody.cpp

    r8351 r8393  
    5252        m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
    5353        m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)),
    54         m_linearDamping = btScalar(0.);
    55         m_angularDamping = btScalar(0.5);
     54    setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
     55
    5656        m_linearSleepingThreshold = constructionInfo.m_linearSleepingThreshold;
    5757        m_angularSleepingThreshold = constructionInfo.m_angularSleepingThreshold;
     
    8585       
    8686        setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia);
    87     setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
    8887        updateInertiaTensor();
    8988
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btRigidBody.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef RIGIDBODY_H
    17 #define RIGIDBODY_H
     16#ifndef BT_RIGIDBODY_H
     17#define BT_RIGIDBODY_H
    1818
    1919#include "LinearMath/btAlignedObjectArray.h"
     
    9090       
    9191        int                             m_debugBodyId;
    92 
     92       
    9393
    9494protected:
     
    271271        }
    272272
    273         const btVector3& getTotalForce()
     273        const btVector3& getTotalForce() const
    274274        {
    275275                return m_totalForce;
    276276        };
    277277
    278         const btVector3& getTotalTorque()
     278        const btVector3& getTotalTorque() const
    279279        {
    280280                return m_totalTorque;
     
    505505        }
    506506
    507         int getNumConstraintRefs()
     507        int getNumConstraintRefs() const
    508508        {
    509509                return m_constraintRefs.size();
     
    618618
    619619        void    internalWritebackVelocity(btScalar timeStep);
     620
    620621       
    621622
     
    687688
    688689
    689 #endif
    690 
     690#endif //BT_RIGIDBODY_H
     691
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp

    r8351 r8393  
    7979                infoGlobal.m_timeStep = timeStep;
    8080                m_constraintSolver->prepareSolve(0,numManifolds);
    81                 m_constraintSolver->solveGroup(0,0,manifoldPtr, numManifolds,0,0,infoGlobal,m_debugDrawer, m_stackAlloc,m_dispatcher1);
     81                m_constraintSolver->solveGroup(&getCollisionObjectArray()[0],getNumCollisionObjects(),manifoldPtr, numManifolds,0,0,infoGlobal,m_debugDrawer, m_stackAlloc,m_dispatcher1);
    8282                m_constraintSolver->allSolved(infoGlobal,m_debugDrawer, m_stackAlloc);
    8383        }
     
    155155        }
    156156}
     157
     158void    btSimpleDynamicsWorld::addRigidBody(btRigidBody* body, short group, short mask)
     159{
     160        body->setGravity(m_gravity);
     161
     162        if (body->getCollisionShape())
     163        {
     164                addCollisionObject(body,group,mask);
     165        }
     166}
     167
     168
     169void    btSimpleDynamicsWorld::debugDrawWorld()
     170{
     171
     172}
     173                               
     174void    btSimpleDynamicsWorld::addAction(btActionInterface* action)
     175{
     176
     177}
     178
     179void    btSimpleDynamicsWorld::removeAction(btActionInterface* action)
     180{
     181
     182}
     183
    157184
    158185void    btSimpleDynamicsWorld::updateAabbs()
  • code/trunk/src/external/bullet/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h

    r8351 r8393  
    5757        virtual void    addRigidBody(btRigidBody* body);
    5858
     59        virtual void    addRigidBody(btRigidBody* body, short group, short mask);
     60
    5961        virtual void    removeRigidBody(btRigidBody* body);
     62
     63        virtual void    debugDrawWorld();
     64                               
     65        virtual void    addAction(btActionInterface* action);
     66
     67        virtual void    removeAction(btActionInterface* action);
    6068
    6169        ///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
  • code/trunk/src/external/bullet/BulletDynamics/Vehicle/btRaycastVehicle.cpp

    r8351 r8393  
    2222#include "LinearMath/btIDebugDraw.h"
    2323#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
     24
     25#define ROLLING_INFLUENCE_FIX
     26
    2427
    2528btRigidBody& btActionInterface::getFixedBody()
     
    695698                                        btVector3 sideImp = m_axle[wheel] * m_sideImpulse[wheel];
    696699
     700#if defined ROLLING_INFLUENCE_FIX // fix. It only worked if car's up was along Y - VT.
     701                                        btVector3 vChassisWorldUp = getRigidBody()->getCenterOfMassTransform().getBasis().getColumn(m_indexUpAxis);
     702                                        rel_pos -= vChassisWorldUp * (vChassisWorldUp.dot(rel_pos) * (1.f-wheelInfo.m_rollInfluence));
     703#else
    697704                                        rel_pos[m_indexUpAxis] *= wheelInfo.m_rollInfluence;
     705#endif
    698706                                        m_chassisBody->applyImpulse(sideImp,rel_pos);
    699707
  • code/trunk/src/external/bullet/BulletDynamics/Vehicle/btRaycastVehicle.h

    r8351 r8393  
    99 * It is provided "as is" without express or implied warranty.
    1010*/
    11 #ifndef RAYCASTVEHICLE_H
    12 #define RAYCASTVEHICLE_H
     11#ifndef BT_RAYCASTVEHICLE_H
     12#define BT_RAYCASTVEHICLE_H
    1313
    1414#include "BulletDynamics/Dynamics/btRigidBody.h"
     
    113113        void    updateWheelTransform( int wheelIndex, bool interpolatedTransform = true );
    114114       
    115         void    setRaycastWheelInfo( int wheelIndex , bool isInContact, const btVector3& hitPoint, const btVector3& hitNormal,btScalar depth);
     115//      void    setRaycastWheelInfo( int wheelIndex , bool isInContact, const btVector3& hitPoint, const btVector3& hitNormal,btScalar depth);
    116116
    117117        btWheelInfo&    addWheel( const btVector3& connectionPointCS0, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS,btScalar suspensionRestLength,btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel);
     
    233233
    234234
    235 #endif //RAYCASTVEHICLE_H
    236 
     235#endif //BT_RAYCASTVEHICLE_H
     236
  • code/trunk/src/external/bullet/BulletDynamics/Vehicle/btVehicleRaycaster.h

    r5781 r8393  
    11/*
    2  * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
     2 * Copyright (c) 2005 Erwin Coumans http://bulletphysics.org
    33 *
    44 * Permission to use, copy, modify, distribute and sell this software
     
    99 * It is provided "as is" without express or implied warranty.
    1010*/
    11 #ifndef VEHICLE_RAYCASTER_H
    12 #define VEHICLE_RAYCASTER_H
     11#ifndef BT_VEHICLE_RAYCASTER_H
     12#define BT_VEHICLE_RAYCASTER_H
    1313
    1414#include "LinearMath/btVector3.h"
     
    3232};
    3333
    34 #endif //VEHICLE_RAYCASTER_H
     34#endif //BT_VEHICLE_RAYCASTER_H
    3535
  • code/trunk/src/external/bullet/BulletDynamics/Vehicle/btWheelInfo.h

    r8351 r8393  
    99 * It is provided "as is" without express or implied warranty.
    1010*/
    11 #ifndef WHEEL_INFO_H
    12 #define WHEEL_INFO_H
     11#ifndef BT_WHEEL_INFO_H
     12#define BT_WHEEL_INFO_H
    1313
    1414#include "LinearMath/btVector3.h"
     
    116116};
    117117
    118 #endif //WHEEL_INFO_H
     118#endif //BT_WHEEL_INFO_H
    119119
  • code/trunk/src/external/bullet/CMakeLists.txt

    r8351 r8393  
    3131  NO_DLL_INTERFACE
    3232  VERSION
    33     2.77
     33    2.78
    3434  SOURCE_FILES
    3535    ${BULLET_FILES}
  • code/trunk/src/external/bullet/ChangeLog

    r8351 r8393  
    55using http://tinyurl.com/yabmjjj
    66
    7 
    8 2010 September 21
    9         - Bullet 2.77 release based on revision 2218
    10         - Added Visual Studio project files for OpenCL and Direct Compute in msvc folder
    11        
     72011 April 8
     8        - Bullet 2.78 release 2383
     9        - Added FractureDemo
     10        - Added Separatinx Axis Test and Polyhedral Clipping support (See InternalEdgeDemo)
     11        - Added speculative contacts as CCD response method (See CcdPhysicsDemo)
     12        - OpenCL and DirectCompute cloth as basic support for capsule collision
     13
    12142010 September 7
    1315        - autotools now uses CamelCase naming for libraryes just like cmake:
  • code/trunk/src/external/bullet/LinearMath/CMakeLists.txt

    r8351 r8393  
    44        btAlignedAllocator.cpp
    55        btConvexHull.cpp
     6    btConvexHullComputer.cpp
    67        btGeometryUtil.cpp
    78        btQuickprof.cpp
     
    1415        btAlignedObjectArray.h
    1516        btConvexHull.h
     17    btConvexHullComputer.h
    1618        btDefaultMotionState.h
    1719        btGeometryUtil.h
  • code/trunk/src/external/bullet/LinearMath/btAabbUtil2.h

    r5781 r8393  
    1515
    1616
    17 #ifndef AABB_UTIL2
    18 #define AABB_UTIL2
     17#ifndef BT_AABB_UTIL2
     18#define BT_AABB_UTIL2
    1919
    2020#include "btTransform.h"
     
    232232#endif //USE_BANCHLESS
    233233
    234 #endif
    235 
    236 
     234#endif //BT_AABB_UTIL2
     235
     236
  • code/trunk/src/external/bullet/LinearMath/btAlignedObjectArray.h

    r8351 r8393  
    407407        {
    408408                int first = 0;
    409                 int last = size();
     409                int last = size()-1;
    410410
    411411                //assume sorted array
  • code/trunk/src/external/bullet/LinearMath/btConvexHull.h

    r8351 r8393  
    1717///includes modifications/improvements by John Ratcliff, see BringOutYourDead below.
    1818
    19 #ifndef CD_HULL_H
    20 #define CD_HULL_H
     19#ifndef BT_CD_HULL_H
     20#define BT_CD_HULL_H
    2121
    2222#include "btVector3.h"
     
    238238
    239239
    240 #endif
    241 
     240#endif //BT_CD_HULL_H
     241
  • code/trunk/src/external/bullet/LinearMath/btDefaultMotionState.h

    r8351 r8393  
    1 #ifndef DEFAULT_MOTION_STATE_H
    2 #define DEFAULT_MOTION_STATE_H
     1#ifndef BT_DEFAULT_MOTION_STATE_H
     2#define BT_DEFAULT_MOTION_STATE_H
    33
    44#include "btMotionState.h"
     
    3838};
    3939
    40 #endif //DEFAULT_MOTION_STATE_H
     40#endif //BT_DEFAULT_MOTION_STATE_H
  • code/trunk/src/external/bullet/LinearMath/btHashMap.h

    r8351 r8393  
     1/*
     2Bullet Continuous Collision Detection and Physics Library
     3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
     4
     5This software is provided 'as-is', without any express or implied warranty.
     6In no event will the authors be held liable for any damages arising from the use of this software.
     7Permission is granted to anyone to use this software for any purpose,
     8including commercial applications, and to alter it and redistribute it freely,
     9subject to the following restrictions:
     10
     111. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
     122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
     133. This notice may not be removed or altered from any source distribution.
     14*/
     15
     16
    117#ifndef BT_HASH_MAP_H
    218#define BT_HASH_MAP_H
  • code/trunk/src/external/bullet/LinearMath/btIDebugDraw.h

    r8351 r8393  
    1515
    1616
    17 #ifndef IDEBUG_DRAW__H
    18 #define IDEBUG_DRAW__H
     17#ifndef BT_IDEBUG_DRAW__H
     18#define BT_IDEBUG_DRAW__H
    1919
    2020#include "btVector3.h"
     
    310310                drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
    311311        }
     312
     313        virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
     314        {
     315                btVector3 capStart(0.f,0.f,0.f);
     316                capStart[upAxis] = -halfHeight;
     317
     318                btVector3 capEnd(0.f,0.f,0.f);
     319                capEnd[upAxis] = halfHeight;
     320
     321                // Draw the ends
     322                {
     323
     324                        btTransform childTransform = transform;
     325                        childTransform.getOrigin() = transform * capStart;
     326                        drawSphere(radius, childTransform, color);
     327                }
     328
     329                {
     330                        btTransform childTransform = transform;
     331                        childTransform.getOrigin() = transform * capEnd;
     332                        drawSphere(radius, childTransform, color);
     333                }
     334
     335                // Draw some additional lines
     336                btVector3 start = transform.getOrigin();
     337
     338                capStart[(upAxis+1)%3] = radius;
     339                capEnd[(upAxis+1)%3] = radius;
     340                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     341                capStart[(upAxis+1)%3] = -radius;
     342                capEnd[(upAxis+1)%3] = -radius;
     343                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     344
     345                capStart[(upAxis+1)%3] = 0.f;
     346                capEnd[(upAxis+1)%3] = 0.f;
     347
     348                capStart[(upAxis+2)%3] = radius;
     349                capEnd[(upAxis+2)%3] = radius;
     350                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     351                capStart[(upAxis+2)%3] = -radius;
     352                capEnd[(upAxis+2)%3] = -radius;
     353                drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
     354        }
     355
     356        virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
     357        {
     358                btVector3 start = transform.getOrigin();
     359                btVector3       offsetHeight(0,0,0);
     360                offsetHeight[upAxis] = halfHeight;
     361                btVector3       offsetRadius(0,0,0);
     362                offsetRadius[(upAxis+1)%3] = radius;
     363                drawLine(start+transform.getBasis() * (offsetHeight+offsetRadius),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
     364                drawLine(start+transform.getBasis() * (offsetHeight-offsetRadius),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
     365
     366                // Drawing top and bottom caps of the cylinder
     367                btVector3 yaxis(0,0,0);
     368                yaxis[upAxis] = btScalar(1.0);
     369                btVector3 xaxis(0,0,0);
     370                xaxis[(upAxis+1)%3] = btScalar(1.0);
     371                drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
     372                drawArc(start+transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
     373        }
     374
     375        virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
     376        {
     377
     378                btVector3 start = transform.getOrigin();
     379
     380                btVector3       offsetHeight(0,0,0);
     381                offsetHeight[upAxis] = height * btScalar(0.5);
     382                btVector3       offsetRadius(0,0,0);
     383                offsetRadius[(upAxis+1)%3] = radius;
     384                btVector3       offset2Radius(0,0,0);
     385                offset2Radius[(upAxis+2)%3] = radius;
     386
     387                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
     388                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
     389                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offset2Radius),color);
     390                drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offset2Radius),color);
     391
     392                // Drawing the base of the cone
     393                btVector3 yaxis(0,0,0);
     394                yaxis[upAxis] = btScalar(1.0);
     395                btVector3 xaxis(0,0,0);
     396                xaxis[(upAxis+1)%3] = btScalar(1.0);
     397                drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,10.0);
     398        }
     399
     400        virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
     401        {
     402                btVector3 planeOrigin = planeNormal * planeConst;
     403                btVector3 vec0,vec1;
     404                btPlaneSpace1(planeNormal,vec0,vec1);
     405                btScalar vecLen = 100.f;
     406                btVector3 pt0 = planeOrigin + vec0*vecLen;
     407                btVector3 pt1 = planeOrigin - vec0*vecLen;
     408                btVector3 pt2 = planeOrigin + vec1*vecLen;
     409                btVector3 pt3 = planeOrigin - vec1*vecLen;
     410                drawLine(transform*pt0,transform*pt1,color);
     411                drawLine(transform*pt2,transform*pt3,color);
     412        }
    312413};
    313414
    314415
    315 #endif //IDEBUG_DRAW__H
    316 
     416#endif //BT_IDEBUG_DRAW__H
     417
  • code/trunk/src/external/bullet/LinearMath/btList.h

    r5781 r8393  
    1515
    1616
    17 #ifndef GEN_LIST_H
    18 #define GEN_LIST_H
     17#ifndef BT_GEN_LIST_H
     18#define BT_GEN_LIST_H
    1919
    2020class btGEN_Link {
     
    6868};
    6969
    70 #endif
     70#endif //BT_GEN_LIST_H
    7171
    7272
  • code/trunk/src/external/bullet/LinearMath/btMatrix3x3.h

    r8351 r8393  
    111111        btMatrix3x3& operator*=(const btMatrix3x3& m);
    112112
    113         /** @brief Set from a carray of btScalars
    114         *  @param m A pointer to the beginning of an array of 9 btScalars */
     113        /** @brief Adds by the target matrix on the right
     114        *  @param m matrix to be applied
     115        * Equivilant to this = this + m */
     116        btMatrix3x3& operator+=(const btMatrix3x3& m);
     117
     118        /** @brief Substractss by the target matrix on the right
     119        *  @param m matrix to be applied
     120        * Equivilant to this = this - m */
     121        btMatrix3x3& operator-=(const btMatrix3x3& m);
     122
     123        /** @brief Set from the rotational part of a 4x4 OpenGL matrix
     124        *  @param m A pointer to the beginning of the array of scalars*/
    115125        void setFromOpenGLSubMatrix(const btScalar *m)
    116126        {
     
    209219        }
    210220
    211         /**@brief Fill the values of the matrix into a 9 element array
     221        /**@brief Fill the rotational part of an OpenGL matrix and clear the shear/perspective
    212222        * @param m The array to be filled */
    213223        void getOpenGLSubMatrix(btScalar *m) const
     
    524534}
    525535
     536SIMD_FORCE_INLINE btMatrix3x3&
     537btMatrix3x3::operator+=(const btMatrix3x3& m)
     538{
     539        setValue(
     540                m_el[0][0]+m.m_el[0][0],
     541                m_el[0][1]+m.m_el[0][1],
     542                m_el[0][2]+m.m_el[0][2],
     543                m_el[1][0]+m.m_el[1][0],
     544                m_el[1][1]+m.m_el[1][1],
     545                m_el[1][2]+m.m_el[1][2],
     546                m_el[2][0]+m.m_el[2][0],
     547                m_el[2][1]+m.m_el[2][1],
     548                m_el[2][2]+m.m_el[2][2]);
     549        return *this;
     550}
     551
     552SIMD_FORCE_INLINE btMatrix3x3
     553operator*(const btMatrix3x3& m, const btScalar & k)
     554{
     555        return btMatrix3x3(
     556                m[0].x()*k,m[0].y()*k,m[0].z()*k,
     557                m[1].x()*k,m[1].y()*k,m[1].z()*k,
     558                m[2].x()*k,m[2].y()*k,m[2].z()*k);
     559}
     560
     561 SIMD_FORCE_INLINE btMatrix3x3
     562operator+(const btMatrix3x3& m1, const btMatrix3x3& m2)
     563{
     564        return btMatrix3x3(
     565        m1[0][0]+m2[0][0],
     566        m1[0][1]+m2[0][1],
     567        m1[0][2]+m2[0][2],
     568        m1[1][0]+m2[1][0],
     569        m1[1][1]+m2[1][1],
     570        m1[1][2]+m2[1][2],
     571        m1[2][0]+m2[2][0],
     572        m1[2][1]+m2[2][1],
     573        m1[2][2]+m2[2][2]);
     574}
     575
     576SIMD_FORCE_INLINE btMatrix3x3
     577operator-(const btMatrix3x3& m1, const btMatrix3x3& m2)
     578{
     579        return btMatrix3x3(
     580        m1[0][0]-m2[0][0],
     581        m1[0][1]-m2[0][1],
     582        m1[0][2]-m2[0][2],
     583        m1[1][0]-m2[1][0],
     584        m1[1][1]-m2[1][1],
     585        m1[1][2]-m2[1][2],
     586        m1[2][0]-m2[2][0],
     587        m1[2][1]-m2[2][1],
     588        m1[2][2]-m2[2][2]);
     589}
     590
     591
     592SIMD_FORCE_INLINE btMatrix3x3&
     593btMatrix3x3::operator-=(const btMatrix3x3& m)
     594{
     595        setValue(
     596        m_el[0][0]-m.m_el[0][0],
     597        m_el[0][1]-m.m_el[0][1],
     598        m_el[0][2]-m.m_el[0][2],
     599        m_el[1][0]-m.m_el[1][0],
     600        m_el[1][1]-m.m_el[1][1],
     601        m_el[1][2]-m.m_el[1][2],
     602        m_el[2][0]-m.m_el[2][0],
     603        m_el[2][1]-m.m_el[2][1],
     604        m_el[2][2]-m.m_el[2][2]);
     605        return *this;
     606}
     607
     608
    526609SIMD_FORCE_INLINE btScalar
    527610btMatrix3x3::determinant() const
  • code/trunk/src/external/bullet/LinearMath/btMinMax.h

    r8351 r8393  
    1515
    1616
    17 #ifndef GEN_MINMAX_H
    18 #define GEN_MINMAX_H
     17#ifndef BT_GEN_MINMAX_H
     18#define BT_GEN_MINMAX_H
    1919
    2020#include "LinearMath/btScalar.h"
     
    6969}
    7070
    71 #endif
     71#endif //BT_GEN_MINMAX_H
  • code/trunk/src/external/bullet/LinearMath/btPoolAllocator.h

    r8351 r8393  
    6363        }
    6464
     65        int getMaxCount() const
     66        {
     67                return m_maxElements;
     68        }
     69
    6570        void*   allocate(int size)
    6671        {
  • code/trunk/src/external/bullet/LinearMath/btQuadWord.h

    r5781 r8393  
    1414
    1515
    16 #ifndef SIMD_QUADWORD_H
    17 #define SIMD_QUADWORD_H
     16#ifndef BT_SIMD_QUADWORD_H
     17#define BT_SIMD_QUADWORD_H
    1818
    1919#include "btScalar.h"
     
    178178};
    179179
    180 #endif //SIMD_QUADWORD_H
     180#endif //BT_SIMD_QUADWORD_H
  • code/trunk/src/external/bullet/LinearMath/btQuaternion.h

    r8351 r8393  
    1515
    1616
    17 #ifndef SIMD__QUATERNION_H_
    18 #define SIMD__QUATERNION_H_
     17#ifndef BT_SIMD__QUATERNION_H_
     18#define BT_SIMD__QUATERNION_H_
    1919
    2020
     
    427427}
    428428
    429 #endif
    430 
    431 
    432 
    433 
     429#endif //BT_SIMD__QUATERNION_H_
     430
     431
     432
     433
  • code/trunk/src/external/bullet/LinearMath/btQuickprof.h

    r8351 r8393  
    1313
    1414
    15 #ifndef QUICK_PROF_H
    16 #define QUICK_PROF_H
     15#ifndef BT_QUICK_PROF_H
     16#define BT_QUICK_PROF_H
    1717
    1818//To disable built-in profiling, please comment out next line
     
    192192
    193193
    194 #endif //QUICK_PROF_H
     194#endif //BT_QUICK_PROF_H
    195195
    196196
  • code/trunk/src/external/bullet/LinearMath/btRandom.h

    r5781 r8393  
    1515
    1616
    17 #ifndef GEN_RANDOM_H
    18 #define GEN_RANDOM_H
     17#ifndef BT_GEN_RANDOM_H
     18#define BT_GEN_RANDOM_H
    1919
    2020#ifdef MT19937
     
    3939#endif
    4040
    41 #endif
     41#endif //BT_GEN_RANDOM_H
    4242
  • code/trunk/src/external/bullet/LinearMath/btScalar.h

    r8351 r8393  
    1515
    1616
    17 #ifndef SIMD___SCALAR_H
    18 #define SIMD___SCALAR_H
     17#ifndef BT_SCALAR_H
     18#define BT_SCALAR_H
    1919
    2020#ifdef BT_MANAGED_CODE
     
    2626#include <math.h>
    2727#include <stdlib.h>//size_t for MSVC 6.0
    28 #include <cstdlib>
    29 #include <cfloat>
    3028#include <float.h>
    3129
    3230/* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/
    33 #define BT_BULLET_VERSION 277
     31#define BT_BULLET_VERSION 278
    3432
    3533inline int      btGetVersion()
     
    287285SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return expf(x); }
    288286SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return logf(x); }
    289   #if defined( __MINGW32__ )
    290   SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return pow(x,y); }
    291   #else
    292   SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); }
    293   #endif
     287SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); }
    294288SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmodf(x,y); }
    295289       
     
    526520        }
    527521};
    528 #endif //SIMD___SCALAR_H
     522#endif //BT_SCALAR_H
  • code/trunk/src/external/bullet/LinearMath/btSerializer.cpp

    r8351 r8393  
    1 unsigned char sBulletDNAstr64[]= {
    2 83,68,78,65,78,65,77,69,-79,0,0,0,109,95,115,105,122,101,0,109,
     1unsigned char sBulletDNAstr[]= {
     283,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
    3395,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
    4499,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
     
    414197,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
    4242109,95,118,97,108,117,101,0,109,95,112,97,100,91,50,93,0,109,95,118,
    43 97,108,117,101,115,91,51,93,0,42,109,95,118,101,114,116,105,99,101,115,
    44 51,102,0,42,109,95,118,101,114,116,105,99,101,115,51,100,0,42,109,95,
    45 105,110,100,105,99,101,115,51,50,0,42,109,95,51,105,110,100,105,99,101,
    46 115,49,54,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,
    47 117,109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,
    48 116,105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,
    49 114,0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,
    50 104,80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,
    51 99,101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,
    52 66,118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,
    53 108,101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,
    54 111,77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,97,
    55 110,115,102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,
    56 0,109,95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,
    57 99,104,105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,
    58 83,104,97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,
    59 104,97,112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,
    60 103,115,0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,
    61 95,101,100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,
    62 101,86,50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,
    63 98,108,101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,
    64 95,118,97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,
    65 121,65,114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,
    66 115,105,108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,
    67 110,0,109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,
    68 104,111,108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,
    69 104,114,101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,
    70 104,114,101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,
    71 109,95,104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,
    72 109,86,97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,
    73 103,105,109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,
    74 115,99,97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,
    75 0,42,109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,
    76 117,98,108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,
    77 100,80,111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,
    78 93,0,42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,
    79 101,0,42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
    80 42,109,95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,
    81 101,0,109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,
    82 95,105,110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,
    83 114,97,110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,
    84 116,105,111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,
    85 95,105,110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,
    86 114,86,101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,
    87 112,105,99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,
    88 116,80,114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,
    89 0,109,95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,
    90 109,95,102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,
    91 116,105,111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,
    92 95,99,99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,
    93 115,0,109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,
    94 108,100,0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,
    95 114,105,99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,
    96 108,97,103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,
    97 99,111,109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,
    98 116,105,111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,
    99 108,84,121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,
    100 87,105,116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,
    101 99,116,68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,
    102 101,110,115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,
    103 101,108,111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,
    104 111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,
    105 114,0,109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,
    106 114,97,118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,
    107 101,108,101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,
    108 105,97,76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,
    109 0,109,95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,
    110 101,114,115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,
    111 112,105,110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,
    112 103,0,109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,
    113 103,70,97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,
    114 76,105,110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,
    115 108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,
    116 103,117,108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,
    117 100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,
    118 117,108,97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,
    119 108,105,110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,
    120 111,108,100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,
    121 103,84,104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,
    122 110,97,108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,
    123 116,114,97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,
    124 65,0,42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,
    125 101,0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,
    126 112,101,0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,
    127 100,0,109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,
    128 97,112,112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,
    129 68,114,97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,
    130 108,108,105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,
    131 100,66,111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,
    132 116,121,112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,
    133 95,112,105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,
    134 0,109,95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,
    135 109,101,0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,
    136 109,101,65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,
    137 101,110,97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,
    138 95,109,111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,
    139 0,109,95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,
    140 95,108,111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,
    141 105,109,105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,
    142 0,109,95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,
    143 120,97,116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,
    144 83,112,97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,
    145 95,116,119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,
    146 0,109,95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,
    147 109,95,108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,
    148 95,97,110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,
    149 95,97,110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,
    150 95,117,115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,
    151 114,97,109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,
    152 67,111,110,115,116,114,97,105,110,116,70,114,97,109,101,0,84,89,80,69,
    153 58,0,0,0,99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,
    154 0,117,115,104,111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,
    155 110,103,0,102,108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,
    156 0,80,111,105,110,116,101,114,65,114,114,97,121,0,98,116,80,104,121,115,
    157 105,99,115,83,121,115,116,101,109,0,76,105,115,116,66,97,115,101,0,98,
    158 116,86,101,99,116,111,114,51,70,108,111,97,116,68,97,116,97,0,98,116,
    159 86,101,99,116,111,114,51,68,111,117,98,108,101,68,97,116,97,0,98,116,
    160 77,97,116,114,105,120,51,120,51,70,108,111,97,116,68,97,116,97,0,98,
    161 116,77,97,116,114,105,120,51,120,51,68,111,117,98,108,101,68,97,116,97,
    162 0,98,116,84,114,97,110,115,102,111,114,109,70,108,111,97,116,68,97,116,
    163 97,0,98,116,84,114,97,110,115,102,111,114,109,68,111,117,98,108,101,68,
    164 97,116,97,0,98,116,66,118,104,83,117,98,116,114,101,101,73,110,102,111,
     4397,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101,
     44114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,
     4551,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51,
     46105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101,
     47115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
     48109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
     49105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
     500,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104,
     5180,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99,
     52101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66,
     53118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108,
     54101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111,
     5577,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109,
     56101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115,
     57102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109,
     5895,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104,
     59105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104,
     6097,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97,
     61112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115,
     620,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101,
     63100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86,
     6450,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108,
     65101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118,
     6697,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65,
     67114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105,
     68108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0,
     69109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111,
     70108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114,
     71101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114,
     72101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95,
     73104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86,
     7497,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105,
     75109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99,
     7697,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,
     77109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,
     78108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,
     79111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,
     8042,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,
     8142,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,
     8295,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
     83109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
     84110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
     85110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
     86111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
     87110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
     88101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
     8999,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
     90114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
     9195,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
     92102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
     93111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
     9499,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
     95109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
     960,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
     9799,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
     98103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
     99109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
     100111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
     101121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
     102116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
     10368,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
     104115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
     105111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
     106105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
     107109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
     108118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
     109101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
     11076,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
     11195,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
     112115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
     113110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
     114109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
     11597,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
     116110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
     11783,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
     118108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
     119113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
     12097,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
     121110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
     122100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
     123104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
     124108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114,
     12597,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0,
     12642,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0,
     127109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101,
     1280,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0,
     129109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112,
     130112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
     13197,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
     132105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
     133111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
     134112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
     135105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
     13695,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
     1370,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
     13865,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
     13997,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
     140111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
     14195,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
     142111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
     143105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
     14495,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
     145116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
     14697,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
     147119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
     14895,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
     149108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
     150110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
     151110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
     152115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
     153109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
     154110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
     15568,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
     15691,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
     157110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
     158101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
     159110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
     160101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
     161115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
     1620,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
     163105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
     164111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
     165109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
     166108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
     167110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
     168116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
     16995,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
     170115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
     171101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
     172108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
     173109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
     174100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
     17597,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
     176101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
     177101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
     178110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
     17977,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
     18072,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
     181110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
     18267,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
     18399,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
     184105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
     185109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
     18672,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
     187108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
     188116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
     18983,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
     190108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
     19195,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
     192108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
     1930,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
     194105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
     195116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
     196102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
     197101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
     19895,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
     199109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
     200116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
     201110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
     202109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
     203109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
     204118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
     205108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
     20695,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
     207100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
     208109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
     209115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
     210115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
     211115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
     212100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
     21395,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
     2140,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
     215109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
     216111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
     217110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
     218100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
     21995,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
     220102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
     221115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
     22280,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
     223121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
     224105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
     225109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
     226109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
     227116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
     228115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
     229110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
     23095,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
     2310,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
     232117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
     233101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
     234110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114,
     2350,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,
     236105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,
     2370,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,
     23865,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
     239109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
     24070,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
     241111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
     24251,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
     243120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
     244102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
     245115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
     246104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
     247112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
    16524868,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
    166 111,100,101,70,108,111,97,116,68,97,116,97,0,98,116,79,112,116,105,109,
    167 105,122,101,100,66,118,104,78,111,100,101,68,111,117,98,108,101,68,97,116,
    168 97,0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,78,111,100,101,
    169 68,97,116,97,0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,70,
    170 108,111,97,116,68,97,116,97,0,98,116,81,117,97,110,116,105,122,101,100,
    171 66,118,104,68,111,117,98,108,101,68,97,116,97,0,98,116,67,111,108,108,
    172 105,115,105,111,110,83,104,97,112,101,68,97,116,97,0,98,116,83,116,97,
    173 116,105,99,80,108,97,110,101,83,104,97,112,101,68,97,116,97,0,98,116,
    174 67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,68,
    175 97,116,97,0,98,116,80,111,115,105,116,105,111,110,65,110,100,82,97,100,
    176 105,117,115,0,98,116,77,117,108,116,105,83,112,104,101,114,101,83,104,97,
    177 112,101,68,97,116,97,0,98,116,73,110,116,73,110,100,101,120,68,97,116,
    178 97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,68,97,116,
    179 97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,84,114,105,
    180 112,108,101,116,68,97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,
    181 97,116,97,0,98,116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,
    182 116,101,114,102,97,99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,
    183 108,101,77,101,115,104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,
    184 105,97,110,103,108,101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,
    185 67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,105,108,100,68,97,
    186 116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,68,97,
    187 116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,97,112,101,68,97,
    188 116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,112,101,68,97,116,
    189 97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,111,68,97,116,97,
    190 0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,104,97,112,101,68,
    191 97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,108,83,104,97,112,
    192 101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,106,
    193 101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,116,67,111,108,108,
    194 105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,116,68,97,116,97,
    195 0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,97,116,68,97,116,
    196 97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,117,98,108,101,68,
    197 97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,116,73,110,102,111,
    198 49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,97,105,110,116,68,
    199 97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,97,116,97,0,
    200 98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,
    201 105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,80,111,105,110,116,
    202 50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,116,68,111,117,98,
    203 108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,111,110,115,116,114,
    204 97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,
    205 103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,
    206 97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,110,115,116,114,97,
    207 105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,105,99,54,68,111,
    208 102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,
    209 105,100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,0,
    210 84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,4,0,4,0,
    211 8,0,0,0,16,0,48,0,16,0,16,0,32,0,48,0,96,0,64,0,
    212 -128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0,56,0,56,0,
    213 20,0,72,0,4,0,4,0,8,0,48,0,32,0,80,0,72,0,80,0,
    214 32,0,64,0,64,0,16,0,72,0,80,0,-40,1,8,1,-16,1,-88,3,
    215 8,0,56,0,0,0,88,0,120,0,96,1,-32,0,-40,0,0,1,-48,0,
    216 83,84,82,67,47,0,0,0,10,0,3,0,4,0,0,0,4,0,1,0,
    217 9,0,2,0,11,0,3,0,10,0,3,0,10,0,4,0,10,0,5,0,
    218 12,0,2,0,9,0,6,0,9,0,7,0,13,0,1,0,7,0,8,0,
    219 14,0,1,0,8,0,8,0,15,0,1,0,13,0,9,0,16,0,1,0,
    220 14,0,9,0,17,0,2,0,15,0,10,0,13,0,11,0,18,0,2,0,
    221 16,0,10,0,14,0,11,0,19,0,4,0,4,0,12,0,4,0,13,0,
    222 2,0,14,0,2,0,15,0,20,0,6,0,13,0,16,0,13,0,17,0,
    223 4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,21,0,6,0,
    224 14,0,16,0,14,0,17,0,4,0,18,0,4,0,19,0,4,0,20,0,
    225 0,0,21,0,22,0,3,0,2,0,14,0,2,0,15,0,4,0,22,0,
    226 23,0,12,0,13,0,23,0,13,0,24,0,13,0,25,0,4,0,26,0,
    227 4,0,27,0,4,0,28,0,4,0,29,0,20,0,30,0,22,0,31,0,
    228 19,0,32,0,4,0,33,0,4,0,34,0,24,0,12,0,14,0,23,0,
    229 14,0,24,0,14,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
    230 4,0,29,0,21,0,30,0,22,0,31,0,4,0,33,0,4,0,34,0,
    231 19,0,32,0,25,0,3,0,0,0,35,0,4,0,36,0,0,0,37,0,
    232 26,0,5,0,25,0,38,0,13,0,39,0,13,0,40,0,7,0,41,0,
    233 0,0,21,0,27,0,5,0,25,0,38,0,13,0,39,0,13,0,42,0,
    234 7,0,43,0,4,0,44,0,28,0,2,0,13,0,45,0,7,0,46,0,
    235 29,0,4,0,27,0,47,0,28,0,48,0,4,0,49,0,0,0,37,0,
    236 30,0,1,0,4,0,50,0,31,0,2,0,2,0,50,0,0,0,51,0,
    237 32,0,2,0,2,0,52,0,0,0,51,0,33,0,7,0,13,0,53,0,
    238 14,0,54,0,30,0,55,0,32,0,56,0,31,0,57,0,4,0,58,0,
    239 4,0,59,0,34,0,4,0,33,0,60,0,13,0,61,0,4,0,62,0,
    240 0,0,37,0,35,0,7,0,25,0,38,0,34,0,63,0,23,0,64,0,
    241 24,0,65,0,36,0,66,0,7,0,43,0,0,0,67,0,37,0,4,0,
    242 17,0,68,0,25,0,69,0,4,0,70,0,7,0,71,0,38,0,4,0,
    243 25,0,38,0,37,0,72,0,4,0,73,0,7,0,43,0,39,0,3,0,
    244 27,0,47,0,4,0,74,0,0,0,37,0,40,0,3,0,27,0,47,0,
    245 4,0,74,0,0,0,37,0,41,0,4,0,4,0,75,0,7,0,76,0,
    246 7,0,77,0,7,0,78,0,36,0,14,0,4,0,79,0,4,0,80,0,
    247 41,0,81,0,4,0,82,0,7,0,83,0,7,0,84,0,7,0,85,0,
    248 7,0,86,0,7,0,87,0,4,0,88,0,4,0,89,0,4,0,90,0,
    249 4,0,91,0,0,0,37,0,42,0,5,0,25,0,38,0,34,0,63,0,
    250 13,0,39,0,7,0,43,0,4,0,92,0,43,0,5,0,27,0,47,0,
    251 13,0,93,0,14,0,94,0,4,0,95,0,0,0,96,0,44,0,24,0,
    252 9,0,97,0,9,0,98,0,25,0,99,0,0,0,35,0,18,0,100,0,
    253 18,0,101,0,14,0,102,0,14,0,103,0,14,0,104,0,8,0,105,0,
    254 8,0,106,0,8,0,107,0,8,0,108,0,8,0,109,0,8,0,110,0,
    255 8,0,111,0,4,0,112,0,4,0,113,0,4,0,114,0,4,0,115,0,
    256 4,0,116,0,4,0,117,0,4,0,118,0,0,0,37,0,45,0,23,0,
    257 9,0,97,0,9,0,98,0,25,0,99,0,0,0,35,0,17,0,100,0,
    258 17,0,101,0,13,0,102,0,13,0,103,0,13,0,104,0,7,0,105,0,
    259 7,0,106,0,7,0,107,0,7,0,108,0,7,0,109,0,7,0,110,0,
    260 7,0,111,0,4,0,112,0,4,0,113,0,4,0,114,0,4,0,115,0,
    261 4,0,116,0,4,0,117,0,4,0,118,0,46,0,21,0,45,0,119,0,
    262 15,0,120,0,13,0,121,0,13,0,122,0,13,0,123,0,13,0,124,0,
    263 13,0,125,0,13,0,126,0,13,0,127,0,13,0,-128,0,13,0,-127,0,
    264 7,0,-126,0,7,0,-125,0,7,0,-124,0,7,0,-123,0,7,0,-122,0,
    265 7,0,-121,0,7,0,-120,0,7,0,-119,0,7,0,-118,0,4,0,-117,0,
    266 47,0,22,0,44,0,119,0,16,0,120,0,14,0,121,0,14,0,122,0,
    267 14,0,123,0,14,0,124,0,14,0,125,0,14,0,126,0,14,0,127,0,
    268 14,0,-128,0,14,0,-127,0,8,0,-126,0,8,0,-125,0,8,0,-124,0,
    269 8,0,-123,0,8,0,-122,0,8,0,-121,0,8,0,-120,0,8,0,-119,0,
    270 8,0,-118,0,4,0,-117,0,0,0,37,0,48,0,2,0,4,0,-116,0,
    271 4,0,-115,0,49,0,11,0,50,0,-114,0,50,0,-113,0,0,0,35,0,
    272 4,0,-112,0,4,0,-111,0,4,0,-110,0,4,0,-109,0,7,0,-108,0,
    273 7,0,-107,0,4,0,-106,0,0,0,-105,0,51,0,3,0,49,0,-104,0,
    274 13,0,-103,0,13,0,-102,0,52,0,3,0,49,0,-104,0,14,0,-103,0,
    275 14,0,-102,0,53,0,13,0,49,0,-104,0,18,0,-101,0,18,0,-100,0,
    276 4,0,-99,0,4,0,-98,0,4,0,-97,0,7,0,-96,0,7,0,-95,0,
    277 7,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,7,0,-90,0,
    278 54,0,13,0,49,0,-104,0,17,0,-101,0,17,0,-100,0,4,0,-99,0,
    279 4,0,-98,0,4,0,-97,0,7,0,-96,0,7,0,-95,0,7,0,-94,0,
    280 7,0,-93,0,7,0,-92,0,7,0,-91,0,7,0,-90,0,55,0,11,0,
    281 49,0,-104,0,17,0,-101,0,17,0,-100,0,7,0,-89,0,7,0,-88,0,
    282 7,0,-87,0,7,0,-92,0,7,0,-91,0,7,0,-90,0,7,0,-86,0,
    283 0,0,21,0,56,0,9,0,49,0,-104,0,17,0,-101,0,17,0,-100,0,
    284 13,0,-85,0,13,0,-84,0,13,0,-83,0,13,0,-82,0,4,0,-81,0,
    285 4,0,-80,0,57,0,9,0,49,0,-104,0,17,0,-101,0,17,0,-100,0,
    286 7,0,-85,0,7,0,-84,0,7,0,-83,0,7,0,-82,0,4,0,-81,0,
    287 4,0,-80,0,};
    288 int sBulletDNAlen64= sizeof(sBulletDNAstr64);
    289 
    290 unsigned char sBulletDNAstr[]= {
    291 83,68,78,65,78,65,77,69,-79,0,0,0,109,95,115,105,122,101,0,109,
     249111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
     250116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
     251117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
     2520,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
     253101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
     254112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
     25583,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
     256116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
     257115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
     258108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
     259116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
     260116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
     261116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
     2620,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
     26397,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
     264116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
     26599,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
     266104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
     267101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
     268100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
     269116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
     270105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
     27197,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
     27297,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
     273112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
     274111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
     275104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
     276108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
     277111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
     278116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
     279116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
     28097,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
     281117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
     282116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
     28397,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
     28468,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
     285110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
     28680,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
     287116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
     288111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
     28998,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
     29097,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
     291110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
     292105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
     2930,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
     29467,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
     295100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
     296102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
     297111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
     29866,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
     299121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
     300116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
     301104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
     302105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
     30397,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
     30497,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
     30597,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
     30697,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,
     3074,0,4,0,8,0,0,0,12,0,36,0,8,0,16,0,32,0,48,0,
     30896,0,64,0,-128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0,
     30952,0,52,0,20,0,64,0,4,0,4,0,8,0,4,0,32,0,28,0,
     31060,0,56,0,76,0,76,0,24,0,60,0,60,0,16,0,64,0,68,0,
     311-56,1,-8,0,-32,1,-104,3,8,0,44,0,0,0,76,0,108,0,84,1,
     312-44,0,-52,0,-12,0,84,1,-60,0,16,0,100,0,20,0,36,0,100,0,
     31392,0,104,0,-64,0,92,1,104,0,-92,1,83,84,82,67,61,0,0,0,
     31410,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
     31510,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
     3169,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
     31715,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
     31815,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
     31919,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
     32020,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
     3214,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
     3224,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
     3232,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
     32413,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
     3254,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
     3264,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
     3274,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
     32822,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
     3290,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
     33013,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
     33125,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
     33228,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
     33328,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
     33431,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
     3350,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
     33613,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
     33731,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
     33813,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
     33935,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
     3400,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
     34117,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
     34225,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
     34327,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
     3444,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
     3457,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
     34643,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
     3477,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
     3484,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
     34913,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
     35013,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
     3519,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
     35218,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
     3538,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
     3548,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
     3554,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
     3569,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
     35717,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
     3587,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
     3597,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
     3604,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
     36115,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
     36213,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
     3637,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
     3647,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
     36549,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
     36614,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
     36714,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
     3688,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
     3698,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
     3704,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
     3714,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
     3727,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
     37313,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
     37414,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
     3754,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
     3767,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
     37756,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
     3784,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
     3797,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
     38051,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
     3817,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
     3820,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
     38313,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
     3844,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
     3857,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
     38617,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
     3874,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
     3887,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
     38913,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
     3907,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
     3914,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
     39261,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
     39361,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
     3944,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
     39552,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
     3967,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
     3977,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
     3987,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
     3997,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
     4004,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
     40168,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
     40213,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
     4034,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
     40415,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
     40513,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
     4064,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
     4074,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
     4087,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
     4094,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
     4107,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
     4114,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
     41247,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
     41364,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
     4144,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
     4154,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
     416int sBulletDNAlen= sizeof(sBulletDNAstr);
     417unsigned char sBulletDNAstr64[]= {
     41883,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
    29241995,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
    29342099,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
     
    33045797,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
    331458109,95,118,97,108,117,101,0,109,95,112,97,100,91,50,93,0,109,95,118,
    332 97,108,117,101,115,91,51,93,0,42,109,95,118,101,114,116,105,99,101,115,
    333 51,102,0,42,109,95,118,101,114,116,105,99,101,115,51,100,0,42,109,95,
    334 105,110,100,105,99,101,115,51,50,0,42,109,95,51,105,110,100,105,99,101,
    335 115,49,54,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,
    336 117,109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,
    337 116,105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,
    338 114,0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,
    339 104,80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,
    340 99,101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,
    341 66,118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,
    342 108,101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,
    343 111,77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,97,
    344 110,115,102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,
    345 0,109,95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,
    346 99,104,105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,
    347 83,104,97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,
    348 104,97,112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,
    349 103,115,0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,
    350 95,101,100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,
    351 101,86,50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,
    352 98,108,101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,
    353 95,118,97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,
    354 121,65,114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,
    355 115,105,108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,
    356 110,0,109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,
    357 104,111,108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,
    358 104,114,101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,
    359 104,114,101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,
    360 109,95,104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,
    361 109,86,97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,
    362 103,105,109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,
    363 115,99,97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,
    364 0,42,109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,
    365 117,98,108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,
    366 100,80,111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,
    367 93,0,42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,
    368 101,0,42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
    369 42,109,95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,
    370 101,0,109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,
    371 95,105,110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,
    372 114,97,110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,
    373 116,105,111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,
    374 95,105,110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,
    375 114,86,101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,
    376 112,105,99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,
    377 116,80,114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,
    378 0,109,95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,
    379 109,95,102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,
    380 116,105,111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,
    381 95,99,99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,
    382 115,0,109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,
    383 108,100,0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,
    384 114,105,99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,
    385 108,97,103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,
    386 99,111,109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,
    387 116,105,111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,
    388 108,84,121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,
    389 87,105,116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,
    390 99,116,68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,
    391 101,110,115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,
    392 101,108,111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,
    393 111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,
    394 114,0,109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,
    395 114,97,118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,
    396 101,108,101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,
    397 105,97,76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,
    398 0,109,95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,
    399 101,114,115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,
    400 112,105,110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,
    401 103,0,109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,
    402 103,70,97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,
    403 76,105,110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,
    404 108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,
    405 103,117,108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,
    406 100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,
    407 117,108,97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,
    408 108,105,110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,
    409 111,108,100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,
    410 103,84,104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,
    411 110,97,108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,
    412 116,114,97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,
    413 65,0,42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,
    414 101,0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,
    415 112,101,0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,
    416 100,0,109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,
    417 97,112,112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,
    418 68,114,97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,
    419 108,108,105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,
    420 100,66,111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,
    421 116,121,112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,
    422 95,112,105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,
    423 0,109,95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,
    424 109,101,0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,
    425 109,101,65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,
    426 101,110,97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,
    427 95,109,111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,
    428 0,109,95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,
    429 95,108,111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,
    430 105,109,105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,
    431 0,109,95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,
    432 120,97,116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,
    433 83,112,97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,
    434 95,116,119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,
    435 0,109,95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,
    436 109,95,108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,
    437 95,97,110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,
    438 95,97,110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,
    439 95,117,115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,
    440 114,97,109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,
    441 67,111,110,115,116,114,97,105,110,116,70,114,97,109,101,0,84,89,80,69,
    442 58,0,0,0,99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,
    443 0,117,115,104,111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,
    444 110,103,0,102,108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,
    445 0,80,111,105,110,116,101,114,65,114,114,97,121,0,98,116,80,104,121,115,
    446 105,99,115,83,121,115,116,101,109,0,76,105,115,116,66,97,115,101,0,98,
    447 116,86,101,99,116,111,114,51,70,108,111,97,116,68,97,116,97,0,98,116,
    448 86,101,99,116,111,114,51,68,111,117,98,108,101,68,97,116,97,0,98,116,
    449 77,97,116,114,105,120,51,120,51,70,108,111,97,116,68,97,116,97,0,98,
    450 116,77,97,116,114,105,120,51,120,51,68,111,117,98,108,101,68,97,116,97,
    451 0,98,116,84,114,97,110,115,102,111,114,109,70,108,111,97,116,68,97,116,
    452 97,0,98,116,84,114,97,110,115,102,111,114,109,68,111,117,98,108,101,68,
    453 97,116,97,0,98,116,66,118,104,83,117,98,116,114,101,101,73,110,102,111,
     45997,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101,
     460114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,
     46151,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51,
     462105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101,
     463115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
     464109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
     465105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
     4660,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104,
     46780,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99,
     468101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66,
     469118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108,
     470101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111,
     47177,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109,
     472101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115,
     473102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109,
     47495,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104,
     475105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104,
     47697,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97,
     477112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115,
     4780,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101,
     479100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86,
     48050,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108,
     481101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118,
     48297,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65,
     483114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105,
     484108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0,
     485109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111,
     486108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114,
     487101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114,
     488101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95,
     489104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86,
     49097,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105,
     491109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99,
     49297,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,
     493109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,
     494108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,
     495111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,
     49642,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,
     49742,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,
     49895,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
     499109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
     500110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
     501110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
     502111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
     503110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
     504101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
     50599,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
     506114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
     50795,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
     508102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
     509111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
     51099,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
     511109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
     5120,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
     51399,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
     514103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
     515109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
     516111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
     517121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
     518116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
     51968,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
     520115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
     521111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
     522105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
     523109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
     524118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
     525101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
     52676,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
     52795,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
     528115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
     529110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
     530109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
     53197,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
     532110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
     53383,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
     534108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
     535113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
     53697,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
     537110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
     538100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
     539104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
     540108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114,
     54197,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0,
     54242,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0,
     543109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101,
     5440,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0,
     545109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112,
     546112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
     54797,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
     548105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
     549111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
     550112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
     551105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
     55295,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
     5530,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
     55465,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
     55597,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
     556111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
     55795,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
     558111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
     559105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
     56095,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
     561116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
     56297,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
     563119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
     56495,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
     565108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
     566110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
     567110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
     568115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
     569109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
     570110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
     57168,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
     57291,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
     573110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
     574101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
     575110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
     576101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
     577115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
     5780,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
     579105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
     580111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
     581109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
     582108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
     583110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
     584116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
     58595,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
     586115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
     587101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
     588108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
     589109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
     590100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
     59197,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
     592101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
     593101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
     594110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
     59577,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
     59672,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
     597110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
     59867,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
     59999,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
     600105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
     601109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
     60272,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
     603108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
     604116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
     60583,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
     606108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
     60795,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
     608108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
     6090,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
     610105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
     611116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
     612102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
     613101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
     61495,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
     615109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
     616116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
     617110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
     618109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
     619109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
     620118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
     621108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
     62295,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
     623100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
     624109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
     625115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
     626115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
     627115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
     628100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
     62995,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
     6300,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
     631109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
     632111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
     633110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
     634100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
     63595,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
     636102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
     637115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
     63880,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
     639121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
     640105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
     641109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
     642109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
     643116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
     644115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
     645110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
     64695,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
     6470,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
     648117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
     649101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
     650110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114,
     6510,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,
     652105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,
     6530,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,
     65465,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
     655109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
     65670,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
     657111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
     65851,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
     659120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
     660102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
     661115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
     662104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
     663112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
    45466468,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
    455 111,100,101,70,108,111,97,116,68,97,116,97,0,98,116,79,112,116,105,109,
    456 105,122,101,100,66,118,104,78,111,100,101,68,111,117,98,108,101,68,97,116,
    457 97,0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,78,111,100,101,
    458 68,97,116,97,0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,70,
    459 108,111,97,116,68,97,116,97,0,98,116,81,117,97,110,116,105,122,101,100,
    460 66,118,104,68,111,117,98,108,101,68,97,116,97,0,98,116,67,111,108,108,
    461 105,115,105,111,110,83,104,97,112,101,68,97,116,97,0,98,116,83,116,97,
    462 116,105,99,80,108,97,110,101,83,104,97,112,101,68,97,116,97,0,98,116,
    463 67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,68,
    464 97,116,97,0,98,116,80,111,115,105,116,105,111,110,65,110,100,82,97,100,
    465 105,117,115,0,98,116,77,117,108,116,105,83,112,104,101,114,101,83,104,97,
    466 112,101,68,97,116,97,0,98,116,73,110,116,73,110,100,101,120,68,97,116,
    467 97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,68,97,116,
    468 97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,84,114,105,
    469 112,108,101,116,68,97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,
    470 97,116,97,0,98,116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,
    471 116,101,114,102,97,99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,
    472 108,101,77,101,115,104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,
    473 105,97,110,103,108,101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,
    474 67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,105,108,100,68,97,
    475 116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,68,97,
    476 116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,97,112,101,68,97,
    477 116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,112,101,68,97,116,
    478 97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,111,68,97,116,97,
    479 0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,104,97,112,101,68,
    480 97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,108,83,104,97,112,
    481 101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,106,
    482 101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,116,67,111,108,108,
    483 105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,116,68,97,116,97,
    484 0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,97,116,68,97,116,
    485 97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,117,98,108,101,68,
    486 97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,116,73,110,102,111,
    487 49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,97,105,110,116,68,
    488 97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,97,116,97,0,
    489 98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,
    490 105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,80,111,105,110,116,
    491 50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,116,68,111,117,98,
    492 108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,111,110,115,116,114,
    493 97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,
    494 103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,
    495 97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,110,115,116,114,97,
    496 105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,105,99,54,68,111,
    497 102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,
    498 105,100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,0,
    499 84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,4,0,4,0,
    500 8,0,0,0,12,0,36,0,8,0,16,0,32,0,48,0,96,0,64,0,
    501 -128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0,52,0,52,0,
    502 20,0,64,0,4,0,4,0,8,0,28,0,28,0,60,0,56,0,76,0,
    503 24,0,60,0,60,0,16,0,64,0,68,0,-56,1,-8,0,-32,1,-104,3,
    504 8,0,44,0,0,0,76,0,108,0,84,1,-44,0,-52,0,-12,0,-60,0,
    505 83,84,82,67,47,0,0,0,10,0,3,0,4,0,0,0,4,0,1,0,
    506 9,0,2,0,11,0,3,0,10,0,3,0,10,0,4,0,10,0,5,0,
    507 12,0,2,0,9,0,6,0,9,0,7,0,13,0,1,0,7,0,8,0,
    508 14,0,1,0,8,0,8,0,15,0,1,0,13,0,9,0,16,0,1,0,
    509 14,0,9,0,17,0,2,0,15,0,10,0,13,0,11,0,18,0,2,0,
    510 16,0,10,0,14,0,11,0,19,0,4,0,4,0,12,0,4,0,13,0,
    511 2,0,14,0,2,0,15,0,20,0,6,0,13,0,16,0,13,0,17,0,
    512 4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,21,0,6,0,
    513 14,0,16,0,14,0,17,0,4,0,18,0,4,0,19,0,4,0,20,0,
    514 0,0,21,0,22,0,3,0,2,0,14,0,2,0,15,0,4,0,22,0,
    515 23,0,12,0,13,0,23,0,13,0,24,0,13,0,25,0,4,0,26,0,
    516 4,0,27,0,4,0,28,0,4,0,29,0,20,0,30,0,22,0,31,0,
    517 19,0,32,0,4,0,33,0,4,0,34,0,24,0,12,0,14,0,23,0,
    518 14,0,24,0,14,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
    519 4,0,29,0,21,0,30,0,22,0,31,0,4,0,33,0,4,0,34,0,
    520 19,0,32,0,25,0,3,0,0,0,35,0,4,0,36,0,0,0,37,0,
    521 26,0,5,0,25,0,38,0,13,0,39,0,13,0,40,0,7,0,41,0,
    522 0,0,21,0,27,0,5,0,25,0,38,0,13,0,39,0,13,0,42,0,
    523 7,0,43,0,4,0,44,0,28,0,2,0,13,0,45,0,7,0,46,0,
    524 29,0,4,0,27,0,47,0,28,0,48,0,4,0,49,0,0,0,37,0,
    525 30,0,1,0,4,0,50,0,31,0,2,0,2,0,50,0,0,0,51,0,
    526 32,0,2,0,2,0,52,0,0,0,51,0,33,0,7,0,13,0,53,0,
    527 14,0,54,0,30,0,55,0,32,0,56,0,31,0,57,0,4,0,58,0,
    528 4,0,59,0,34,0,4,0,33,0,60,0,13,0,61,0,4,0,62,0,
    529 0,0,37,0,35,0,7,0,25,0,38,0,34,0,63,0,23,0,64,0,
    530 24,0,65,0,36,0,66,0,7,0,43,0,0,0,67,0,37,0,4,0,
    531 17,0,68,0,25,0,69,0,4,0,70,0,7,0,71,0,38,0,4,0,
    532 25,0,38,0,37,0,72,0,4,0,73,0,7,0,43,0,39,0,3,0,
    533 27,0,47,0,4,0,74,0,0,0,37,0,40,0,3,0,27,0,47,0,
    534 4,0,74,0,0,0,37,0,41,0,4,0,4,0,75,0,7,0,76,0,
    535 7,0,77,0,7,0,78,0,36,0,14,0,4,0,79,0,4,0,80,0,
    536 41,0,81,0,4,0,82,0,7,0,83,0,7,0,84,0,7,0,85,0,
    537 7,0,86,0,7,0,87,0,4,0,88,0,4,0,89,0,4,0,90,0,
    538 4,0,91,0,0,0,37,0,42,0,5,0,25,0,38,0,34,0,63,0,
    539 13,0,39,0,7,0,43,0,4,0,92,0,43,0,5,0,27,0,47,0,
    540 13,0,93,0,14,0,94,0,4,0,95,0,0,0,96,0,44,0,24,0,
    541 9,0,97,0,9,0,98,0,25,0,99,0,0,0,35,0,18,0,100,0,
    542 18,0,101,0,14,0,102,0,14,0,103,0,14,0,104,0,8,0,105,0,
    543 8,0,106,0,8,0,107,0,8,0,108,0,8,0,109,0,8,0,110,0,
    544 8,0,111,0,4,0,112,0,4,0,113,0,4,0,114,0,4,0,115,0,
    545 4,0,116,0,4,0,117,0,4,0,118,0,0,0,37,0,45,0,23,0,
    546 9,0,97,0,9,0,98,0,25,0,99,0,0,0,35,0,17,0,100,0,
    547 17,0,101,0,13,0,102,0,13,0,103,0,13,0,104,0,7,0,105,0,
    548 7,0,106,0,7,0,107,0,7,0,108,0,7,0,109,0,7,0,110,0,
    549 7,0,111,0,4,0,112,0,4,0,113,0,4,0,114,0,4,0,115,0,
    550 4,0,116,0,4,0,117,0,4,0,118,0,46,0,21,0,45,0,119,0,
    551 15,0,120,0,13,0,121,0,13,0,122,0,13,0,123,0,13,0,124,0,
    552 13,0,125,0,13,0,126,0,13,0,127,0,13,0,-128,0,13,0,-127,0,
    553 7,0,-126,0,7,0,-125,0,7,0,-124,0,7,0,-123,0,7,0,-122,0,
    554 7,0,-121,0,7,0,-120,0,7,0,-119,0,7,0,-118,0,4,0,-117,0,
    555 47,0,22,0,44,0,119,0,16,0,120,0,14,0,121,0,14,0,122,0,
    556 14,0,123,0,14,0,124,0,14,0,125,0,14,0,126,0,14,0,127,0,
    557 14,0,-128,0,14,0,-127,0,8,0,-126,0,8,0,-125,0,8,0,-124,0,
    558 8,0,-123,0,8,0,-122,0,8,0,-121,0,8,0,-120,0,8,0,-119,0,
    559 8,0,-118,0,4,0,-117,0,0,0,37,0,48,0,2,0,4,0,-116,0,
    560 4,0,-115,0,49,0,11,0,50,0,-114,0,50,0,-113,0,0,0,35,0,
    561 4,0,-112,0,4,0,-111,0,4,0,-110,0,4,0,-109,0,7,0,-108,0,
    562 7,0,-107,0,4,0,-106,0,0,0,-105,0,51,0,3,0,49,0,-104,0,
    563 13,0,-103,0,13,0,-102,0,52,0,3,0,49,0,-104,0,14,0,-103,0,
    564 14,0,-102,0,53,0,13,0,49,0,-104,0,18,0,-101,0,18,0,-100,0,
    565 4,0,-99,0,4,0,-98,0,4,0,-97,0,7,0,-96,0,7,0,-95,0,
    566 7,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,7,0,-90,0,
    567 54,0,13,0,49,0,-104,0,17,0,-101,0,17,0,-100,0,4,0,-99,0,
    568 4,0,-98,0,4,0,-97,0,7,0,-96,0,7,0,-95,0,7,0,-94,0,
    569 7,0,-93,0,7,0,-92,0,7,0,-91,0,7,0,-90,0,55,0,11,0,
    570 49,0,-104,0,17,0,-101,0,17,0,-100,0,7,0,-89,0,7,0,-88,0,
    571 7,0,-87,0,7,0,-92,0,7,0,-91,0,7,0,-90,0,7,0,-86,0,
    572 0,0,21,0,56,0,9,0,49,0,-104,0,17,0,-101,0,17,0,-100,0,
    573 13,0,-85,0,13,0,-84,0,13,0,-83,0,13,0,-82,0,4,0,-81,0,
    574 4,0,-80,0,57,0,9,0,49,0,-104,0,17,0,-101,0,17,0,-100,0,
    575 7,0,-85,0,7,0,-84,0,7,0,-83,0,7,0,-82,0,4,0,-81,0,
    576 4,0,-80,0,};
    577 int sBulletDNAlen= sizeof(sBulletDNAstr);
     665111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
     666116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
     667117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
     6680,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
     669101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
     670112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
     67183,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
     672116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
     673115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
     674108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
     675116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
     676116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
     677116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
     6780,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
     67997,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
     680116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
     68199,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
     682104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
     683101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
     684100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
     685116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
     686105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
     68797,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
     68897,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
     689112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
     690111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
     691104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
     692108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
     693111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
     694116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
     695116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
     69697,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
     697117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
     698116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
     69997,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
     70068,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
     701110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
     70280,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
     703116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
     704111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
     70598,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
     70697,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
     707110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
     708105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
     7090,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
     71067,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
     711100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
     712102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
     713111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
     71466,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
     715121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
     716116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
     717104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
     718105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
     71997,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
     72097,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
     72197,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
     72297,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,
     7234,0,4,0,8,0,0,0,16,0,48,0,16,0,16,0,32,0,48,0,
     72496,0,64,0,-128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0,
     72556,0,56,0,20,0,72,0,4,0,4,0,8,0,4,0,56,0,32,0,
     72680,0,72,0,96,0,80,0,32,0,64,0,64,0,16,0,72,0,80,0,
     727-40,1,8,1,-16,1,-88,3,8,0,56,0,0,0,88,0,120,0,96,1,
     728-32,0,-40,0,0,1,96,1,-48,0,16,0,104,0,24,0,40,0,104,0,
     72996,0,104,0,-56,0,104,1,112,0,-40,1,83,84,82,67,61,0,0,0,
     73010,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
     73110,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
     7329,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
     73315,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
     73415,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
     73519,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
     73620,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
     7374,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
     7384,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
     7392,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
     74013,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
     7414,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
     7424,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
     7434,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
     74422,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
     7450,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
     74613,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
     74725,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
     74828,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
     74928,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
     75031,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
     7510,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
     75213,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
     75331,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
     75413,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
     75535,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
     7560,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
     75717,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
     75825,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
     75927,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
     7604,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
     7617,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
     76243,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
     7637,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
     7644,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
     76513,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
     76613,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
     7679,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
     76818,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
     7698,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
     7708,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
     7714,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
     7729,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
     77317,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
     7747,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
     7757,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
     7764,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
     77715,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
     77813,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
     7797,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
     7807,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
     78149,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
     78214,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
     78314,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
     7848,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
     7858,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
     7864,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
     7874,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
     7887,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
     78913,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
     79014,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
     7914,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
     7927,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
     79356,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
     7944,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
     7957,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
     79651,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
     7977,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
     7980,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
     79913,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
     8004,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
     8017,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
     80217,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
     8034,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
     8047,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
     80513,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
     8067,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
     8074,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
     80861,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
     80961,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
     8104,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
     81152,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
     8127,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
     8137,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
     8147,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
     8157,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
     8164,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
     81768,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
     81813,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
     8194,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
     82015,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
     82113,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
     8224,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
     8234,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
     8247,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
     8254,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
     8267,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
     8274,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
     82847,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
     82964,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
     8304,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
     8314,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
     832int sBulletDNAlen64= sizeof(sBulletDNAstr64);
  • code/trunk/src/external/bullet/LinearMath/btSerializer.h

    r8351 r8393  
    112112#endif
    113113
     114#define BT_SOFTBODY_CODE                MAKE_ID('S','B','D','Y')
    114115#define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J')
    115116#define BT_RIGIDBODY_CODE               MAKE_ID('R','B','D','Y')
     
    120121#define BT_SHAPE_CODE                   MAKE_ID('S','H','A','P')
    121122#define BT_ARRAY_CODE                   MAKE_ID('A','R','A','Y')
     123#define BT_SBMATERIAL_CODE              MAKE_ID('S','B','M','T')
     124#define BT_SBNODE_CODE                  MAKE_ID('S','B','N','D')
    122125#define BT_DNA_CODE                             MAKE_ID('D','N','A','1')
    123 
    124126
    125127
     
    133135};
    134136
    135 
     137///The btDefaultSerializer is the main Bullet serialization class.
     138///The constructor takes an optional argument for backwards compatibility, it is recommended to leave this empty/zero.
    136139class btDefaultSerializer       :       public btSerializer
    137140{
     
    372375       
    373376
    374                 btDefaultSerializer(int totalSize)
     377                btDefaultSerializer(int totalSize=0)
    375378                        :m_totalSize(totalSize),
    376379                        m_currentSize(0),
     
    379382                        m_serializationFlags(0)
    380383                {
    381                         m_buffer = (unsigned char*)btAlignedAlloc(totalSize, 16);
     384                        m_buffer = m_totalSize?(unsigned char*)btAlignedAlloc(totalSize,16):0;
    382385                       
    383386                        const bool VOID_IS_8 = ((sizeof(void*)==8));
     
    420423                }
    421424
    422                 virtual void    startSerialization()
    423                 {
    424                         m_uniqueIdGenerator= 1;
    425 
    426                         m_currentSize = BT_HEADER_LENGTH;
     425                void    writeHeader(unsigned char* buffer) const
     426                {
     427                       
    427428
    428429#ifdef  BT_USE_DOUBLE_PRECISION
    429                         memcpy(m_buffer, "BULLETd", 7);
     430                        memcpy(buffer, "BULLETd", 7);
    430431#else
    431                         memcpy(m_buffer, "BULLETf", 7);
     432                        memcpy(buffer, "BULLETf", 7);
    432433#endif //BT_USE_DOUBLE_PRECISION
    433434       
     
    437438                        if (sizeof(void*)==8)
    438439                        {
    439                                 m_buffer[7] = '-';
     440                                buffer[7] = '-';
    440441                        } else
    441442                        {
    442                                 m_buffer[7] = '_';
     443                                buffer[7] = '_';
    443444                        }
    444445
    445446                        if (littleEndian)
    446447                        {
    447                                 m_buffer[8]='v';                               
     448                                buffer[8]='v';                         
    448449                        } else
    449450                        {
    450                                 m_buffer[8]='V';
    451                         }
    452 
    453 
    454                         m_buffer[9] = '2';
    455                         m_buffer[10] = '7';
    456                         m_buffer[11] = '7';
    457 
     451                                buffer[8]='V';
     452                        }
     453
     454
     455                        buffer[9] = '2';
     456                        buffer[10] = '7';
     457                        buffer[11] = '8';
     458
     459                }
     460
     461                virtual void    startSerialization()
     462                {
     463                        m_uniqueIdGenerator= 1;
     464                        if (m_totalSize)
     465                        {
     466                                unsigned char* buffer = internalAlloc(BT_HEADER_LENGTH);
     467                                writeHeader(buffer);
     468                        }
    458469                       
    459470                }
     
    463474                        writeDNA();
    464475
     476                        //if we didn't pre-allocate a buffer, we need to create a contiguous buffer now
     477                        int mysize = 0;
     478                        if (!m_totalSize)
     479                        {
     480                                if (m_buffer)
     481                                        btAlignedFree(m_buffer);
     482
     483                                m_currentSize += BT_HEADER_LENGTH;
     484                                m_buffer = (unsigned char*)btAlignedAlloc(m_currentSize,16);
     485
     486                                unsigned char* currentPtr = m_buffer;
     487                                writeHeader(m_buffer);
     488                                currentPtr += BT_HEADER_LENGTH;
     489                                mysize+=BT_HEADER_LENGTH;
     490                                for (int i=0;i< m_chunkPtrs.size();i++)
     491                                {
     492                                        int curLength = sizeof(btChunk)+m_chunkPtrs[i]->m_length;
     493                                        memcpy(currentPtr,m_chunkPtrs[i], curLength);
     494                                        btAlignedFree(m_chunkPtrs[i]);
     495                                        currentPtr+=curLength;
     496                                        mysize+=curLength;
     497                                }
     498                        }
    465499
    466500                        mTypes.clear();
     
    472506                        m_nameMap.clear();
    473507                        m_uniquePointers.clear();
     508                        m_chunkPtrs.clear();
    474509                }
    475510
     
    523558
    524559               
     560                virtual unsigned char* internalAlloc(size_t size)
     561                {
     562                        unsigned char* ptr = 0;
     563
     564                        if (m_totalSize)
     565                        {
     566                                ptr = m_buffer+m_currentSize;
     567                                m_currentSize += int(size);
     568                                btAssert(m_currentSize<m_totalSize);
     569                        } else
     570                        {
     571                                ptr = (unsigned char*)btAlignedAlloc(size,16);
     572                                m_currentSize += int(size);
     573                        }
     574                        return ptr;
     575                }
    525576
    526577               
     
    529580                {
    530581
    531                         unsigned char* ptr = m_buffer+m_currentSize;
    532                         m_currentSize += int(size)*numElements+sizeof(btChunk);
    533                         btAssert(m_currentSize<m_totalSize);
     582                        unsigned char* ptr = internalAlloc(int(size)*numElements+sizeof(btChunk));
    534583
    535584                        unsigned char* data = ptr + sizeof(btChunk);
  • code/trunk/src/external/bullet/LinearMath/btTransform.h

    r8351 r8393  
    1515
    1616
    17 #ifndef btTransform_H
    18 #define btTransform_H
     17#ifndef BT_TRANSFORM_H
     18#define BT_TRANSFORM_H
    1919
    2020
     
    299299
    300300
    301 #endif
    302 
    303 
    304 
    305 
    306 
    307 
     301#endif //BT_TRANSFORM_H
     302
     303
     304
     305
     306
     307
  • code/trunk/src/external/bullet/LinearMath/btTransformUtil.h

    r8351 r8393  
    1414
    1515
    16 #ifndef SIMD_TRANSFORM_UTIL_H
    17 #define SIMD_TRANSFORM_UTIL_H
     16#ifndef BT_TRANSFORM_UTIL_H
     17#define BT_TRANSFORM_UTIL_H
    1818
    1919#include "btTransform.h"
     
    225225
    226226
    227 #endif //SIMD_TRANSFORM_UTIL_H
    228 
     227#endif //BT_TRANSFORM_UTIL_H
     228
  • code/trunk/src/external/bullet/LinearMath/btVector3.h

    r8351 r8393  
    1515
    1616
    17 #ifndef SIMD__VECTOR3_H
    18 #define SIMD__VECTOR3_H
     17#ifndef BT_VECTOR3_H
     18#define BT_VECTOR3_H
    1919
    2020
     
    764764
    765765
    766 #endif //SIMD__VECTOR3_H
     766#endif //BT_VECTOR3_H
  • code/trunk/src/external/bullet/VERSION

    r8351 r8393  
    1 2.77
     12.78
  • code/trunk/src/external/bullet/btBulletCollisionCommon.h

    r8351 r8393  
    3434#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
    3535#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
     36#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
    3637#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
    3738#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
  • code/trunk/src/external/bullet/changes_orxonox.diff

    r8351 r8393  
    1 --- LinearMath/btScalar.h       Tue Aug 10 13:19:44 2010
    2 +++ LinearMath/btScalar.h       Sun Feb 27 01:27:34 2011
    3 @@ -286,7 +286,11 @@
    4  SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2f(x, y); }
    5  SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return expf(x); }
    6  SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return logf(x); }
    7 -SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); }
    8 +  #if defined( __MINGW32__ )
    9 +  SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return pow(x,y); }
    10 +  #else
    11 +  SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); }
    12 +  #endif
    13  SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmodf(x,y); }
    14        
    15  #endif
     1
Note: See TracChangeset for help on using the changeset viewer.