- Timestamp:
- May 3, 2011, 5:07:42 AM (14 years ago)
- 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 66 66 */ 67 67 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. 69 69 extern void plDeletePhysicsSdk(plPhysicsSdkHandle physicsSdk); 70 70 … … 117 117 extern plCollisionShapeHandle plNewConeShape(plReal radius, plReal height); 118 118 extern plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height); 119 extern plCollisionShapeHandle plNewCompoundShape( );119 extern plCollisionShapeHandle plNewCompoundShape(void); 120 120 extern void plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn); 121 121 … … 123 123 124 124 /* Convex Meshes */ 125 extern plCollisionShapeHandle plNewConvexHullShape( );125 extern plCollisionShapeHandle plNewConvexHullShape(void); 126 126 extern void plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z); 127 127 /* Concave static triangle meshes */ 128 extern plMeshInterfaceHandle plNewMeshInterface( );128 extern plMeshInterfaceHandle plNewMeshInterface(void); 129 129 extern void plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2); 130 130 extern plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle); -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h
r8351 r8393 17 17 // 3. This notice may not be removed or altered from any source distribution. 18 18 19 #ifndef AXIS_SWEEP_3_H20 #define AXIS_SWEEP_3_H19 #ifndef BT_AXIS_SWEEP_3_H 20 #define BT_AXIS_SWEEP_3_H 21 21 22 22 #include "LinearMath/btVector3.h" -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
r8351 r8393 14 14 */ 15 15 16 #ifndef B ROADPHASE_INTERFACE_H17 #define B ROADPHASE_INTERFACE_H16 #ifndef BT_BROADPHASE_INTERFACE_H 17 #define BT_BROADPHASE_INTERFACE_H 18 18 19 19 … … 80 80 }; 81 81 82 #endif //B ROADPHASE_INTERFACE_H82 #endif //BT_BROADPHASE_INTERFACE_H -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
r8351 r8393 14 14 */ 15 15 16 #ifndef B ROADPHASE_PROXY_H17 #define B ROADPHASE_PROXY_H16 #ifndef BT_BROADPHASE_PROXY_H 17 #define BT_BROADPHASE_PROXY_H 18 18 19 19 #include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE … … 267 267 268 268 269 #endif //B ROADPHASE_PROXY_H270 269 #endif //BT_BROADPHASE_PROXY_H 270 -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef COLLISION_ALGORITHM_H17 #define COLLISION_ALGORITHM_H16 #ifndef BT_COLLISION_ALGORITHM_H 17 #define BT_COLLISION_ALGORITHM_H 18 18 19 19 #include "LinearMath/btScalar.h" … … 45 45 btPersistentManifold* m_manifold; 46 46 47 int getDispatcherId();47 // int getDispatcherId(); 48 48 49 49 }; … … 60 60 61 61 protected: 62 int getDispatcherId();62 // int getDispatcherId(); 63 63 64 64 public: … … 78 78 79 79 80 #endif // COLLISION_ALGORITHM_H80 #endif //BT_COLLISION_ALGORITHM_H -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDispatcher.h
r8351 r8393 14 14 */ 15 15 16 #ifndef _DISPATCHER_H 17 #define _DISPATCHER_H 18 16 #ifndef BT_DISPATCHER_H 17 #define BT_DISPATCHER_H 19 18 #include "LinearMath/btScalar.h" 20 19 … … 28 27 class btPersistentManifold; 29 28 class btStackAlloc; 29 class btPoolAllocator; 30 30 31 31 struct btDispatcherInfo … … 41 41 m_dispatchFunc(DISPATCH_DISCRETE), 42 42 m_timeOfImpact(btScalar(1.)), 43 m_useContinuous( false),43 m_useContinuous(true), 44 44 m_debugDraw(0), 45 45 m_enableSatConvex(false), … … 49 49 m_useConvexConservativeDistanceUtil(false), 50 50 m_convexConservativeDistanceThreshold(0.0f), 51 m_convexMaxDistanceUseCPT(false),52 51 m_stackAllocator(0) 53 52 { … … 66 65 bool m_useConvexConservativeDistanceUtil; 67 66 btScalar m_convexConservativeDistanceThreshold; 68 bool m_convexMaxDistanceUseCPT;69 67 btStackAlloc* m_stackAllocator; 70 68 }; … … 99 97 virtual btPersistentManifold** getInternalManifoldPointer() = 0; 100 98 99 virtual btPoolAllocator* getInternalManifoldPool() = 0; 100 101 virtual const btPoolAllocator* getInternalManifoldPool() const = 0; 102 101 103 virtual void* allocateCollisionAlgorithm(int size) = 0; 102 104 … … 106 108 107 109 108 #endif // _DISPATCHER_H110 #endif //BT_DISPATCHER_H -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
r8351 r8393 14 14 */ 15 15 16 #ifndef OVERLAPPING_PAIR_CACHE_H17 #define OVERLAPPING_PAIR_CACHE_H16 #ifndef BT_OVERLAPPING_PAIR_CACHE_H 17 #define BT_OVERLAPPING_PAIR_CACHE_H 18 18 19 19 … … 465 465 466 466 467 #endif // OVERLAPPING_PAIR_CACHE_H468 469 467 #endif //BT_OVERLAPPING_PAIR_CACHE_H 468 469 -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
r8351 r8393 14 14 */ 15 15 16 #ifndef QUANTIZED_BVH_H17 #define QUANTIZED_BVH_H16 #ifndef BT_QUANTIZED_BVH_H 17 #define BT_QUANTIZED_BVH_H 18 18 19 19 class btSerializer; … … 577 577 578 578 579 #endif // QUANTIZED_BVH_H579 #endif //BT_QUANTIZED_BVH_H -
code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
r8351 r8393 14 14 */ 15 15 16 #ifndef SIMPLE_BROADPHASE_H17 #define SIMPLE_BROADPHASE_H16 #ifndef BT_SIMPLE_BROADPHASE_H 17 #define BT_SIMPLE_BROADPHASE_H 18 18 19 19 … … 168 168 169 169 170 #endif // SIMPLE_BROADPHASE_H170 #endif //BT_SIMPLE_BROADPHASE_H 171 171 -
code/trunk/src/external/bullet/BulletCollision/CMakeLists.txt
r8351 r8393 50 50 CollisionShapes/btConvexInternalShape.cpp 51 51 CollisionShapes/btConvexPointCloudShape.cpp 52 CollisionShapes/btConvexPolyhedron.cpp 52 53 CollisionShapes/btConvexShape.cpp 53 54 CollisionShapes/btConvex2dShape.cpp … … 88 89 89 90 COMPILATION_END 91 92 # Raises compiler errors when compiled inside the compilation 93 NarrowPhaseCollision/btPolyhedralContactClipping.cpp 90 94 91 95 # Headers … … 140 144 CollisionShapes/btConvexInternalShape.h 141 145 CollisionShapes/btConvexPointCloudShape.h 146 CollisionShapes/btConvexPolyhedron.h 142 147 CollisionShapes/btConvexShape.h 143 148 CollisionShapes/btConvex2dShape.h … … 184 189 NarrowPhaseCollision/btSubSimplexConvexCast.h 185 190 NarrowPhaseCollision/btVoronoiSimplexSolver.h 191 NarrowPhaseCollision/btPolyhedralContactClipping.h 186 192 ) -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
r8351 r8393 58 58 } 59 59 60 #define MAX_OVERLAP btScalar(0.)61 62 60 63 61 … … 94 92 } 95 93 96 ///combined discrete/continuous sphere-triangle97 94 bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold) 98 95 { 99 96 100 97 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; 105 101 106 102 btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]); 107 103 normal.normalize(); 108 btVector3 p1ToCentre = c- vertices[0];104 btVector3 p1ToCentre = sphereCenter - vertices[0]; 109 105 btScalar distanceFromPlane = p1ToCentre.dot(normal); 110 106 … … 112 108 { 113 109 //triangle facing the other way 114 115 110 distanceFromPlane *= btScalar(-1.); 116 111 normal *= btScalar(-1.); 117 112 } 118 113 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 127 116 // Check for contact / intersection 128 117 bool hasContact = false; 129 118 btVector3 contactPoint; 130 119 if (isInsideContactPlane) { 131 if (facecontains( c,vertices,normal)) {120 if (facecontains(sphereCenter,vertices,normal)) { 132 121 // Inside the contact wedge - touches a point on the shell plane 133 122 hasContact = true; 134 contactPoint = c- normal*distanceFromPlane;123 contactPoint = sphereCenter - normal*distanceFromPlane; 135 124 } else { 136 125 // Could be inside one of the contact capsules 137 btScalar contactCapsuleRadiusSqr = (r + contactMargin) * (r + contactMargin);126 btScalar contactCapsuleRadiusSqr = radiusWithThreshold*radiusWithThreshold; 138 127 btVector3 nearestOnEdge; 139 128 for (int i = 0; i < m_triangle->getNumEdges(); i++) { … … 144 133 m_triangle->getEdge(i,pa,pb); 145 134 146 btScalar distanceSqr = SegmentSqrDistance(pa,pb, c, nearestOnEdge);135 btScalar distanceSqr = SegmentSqrDistance(pa,pb,sphereCenter, nearestOnEdge); 147 136 if (distanceSqr < contactCapsuleRadiusSqr) { 148 137 // Yep, we're inside a capsule … … 156 145 157 146 if (hasContact) { 158 btVector3 contactToCentre = c- contactPoint;147 btVector3 contactToCentre = sphereCenter - contactPoint; 159 148 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 } 166 166 return true; 167 167 } 168 169 if (delta.dot(contactToCentre) >= btScalar(0.0))170 return false;171 172 // Moving towards the contact point -> collision173 point = contactPoint;174 timeOfImpact = btScalar(0.0);175 return true;176 168 } 177 169 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
r8351 r8393 14 14 */ 15 15 16 #ifndef SPHERE_TRIANGLE_DETECTOR_H17 #define SPHERE_TRIANGLE_DETECTOR_H16 #ifndef BT_SPHERE_TRIANGLE_DETECTOR_H 17 #define BT_SPHERE_TRIANGLE_DETECTOR_H 18 18 19 19 #include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h" … … 48 48 49 49 }; 50 #endif // SPHERE_TRIANGLE_DETECTOR_H50 #endif //BT_SPHERE_TRIANGLE_DETECTOR_H 51 51 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
r8351 r8393 14 14 */ 15 15 16 #ifndef B OX_2D_BOX_2D__COLLISION_ALGORITHM_H17 #define B OX_2D_BOX_2D__COLLISION_ALGORITHM_H16 #ifndef BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H 17 #define BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H 18 18 19 19 #include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h" … … 63 63 }; 64 64 65 #endif //B OX_2D_BOX_2D__COLLISION_ALGORITHM_H65 #endif //BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H 66 66 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef B OX_BOX__COLLISION_ALGORITHM_H17 #define B OX_BOX__COLLISION_ALGORITHM_H16 #ifndef BT_BOX_BOX__COLLISION_ALGORITHM_H 17 #define BT_BOX_BOX__COLLISION_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 63 63 }; 64 64 65 #endif //B OX_BOX__COLLISION_ALGORITHM_H65 #endif //BT_BOX_BOX__COLLISION_ALGORITHM_H 66 66 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.h
r5781 r8393 17 17 3. This notice may not be removed or altered from any source distribution. 18 18 */ 19 #ifndef B OX_BOX_DETECTOR_H20 #define B OX_BOX_DETECTOR_H19 #ifndef BT_BOX_BOX_DETECTOR_H 20 #define BT_BOX_BOX_DETECTOR_H 21 21 22 22 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionConfiguration.h
r5781 r8393 16 16 #ifndef BT_COLLISION_CONFIGURATION 17 17 #define BT_COLLISION_CONFIGURATION 18 18 19 struct btCollisionAlgorithmCreateFunc; 19 20 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
r5781 r8393 14 14 */ 15 15 16 #ifndef COLLISION_CREATE_FUNC17 #define COLLISION_CREATE_FUNC16 #ifndef BT_COLLISION_CREATE_FUNC 17 #define BT_COLLISION_CREATE_FUNC 18 18 19 19 #include "LinearMath/btAlignedObjectArray.h" … … 42 42 } 43 43 }; 44 #endif // COLLISION_CREATE_FUNC44 #endif //BT_COLLISION_CREATE_FUNC 45 45 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
r8351 r8393 93 93 } else 94 94 { 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 } 97 105 } 98 106 btPersistentManifold* manifold = new(mem) btPersistentManifold (body0,body1,0,contactBreakingThreshold,contactProcessingThreshold); … … 173 181 { 174 182 //broadphase filtering already deals with this 175 if ((body0->isStaticObject() || body0->isKinematicObject()) && 176 (body1->isStaticObject() || body1->isKinematicObject())) 183 if (body0->isStaticOrKinematicObject() && body1->isStaticOrKinematicObject()) 177 184 { 178 185 m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED; -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
r8351 r8393 14 14 */ 15 15 16 #ifndef COLLISION__DISPATCHER_H17 #define COLLISION__DISPATCHER_H16 #ifndef BT_COLLISION__DISPATCHER_H 17 #define BT_COLLISION__DISPATCHER_H 18 18 19 19 #include "BulletCollision/BroadphaseCollision/btDispatcher.h" … … 43 43 class btCollisionDispatcher : public btDispatcher 44 44 { 45 46 protected: 47 45 48 int m_dispatcherFlags; 46 49 47 50 btAlignedObjectArray<btPersistentManifold*> m_manifoldsPtr; 48 51 … … 65 68 { 66 69 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 68 72 }; 69 73 … … 75 79 void setDispatcherFlags(int flags) 76 80 { 77 (void) flags; 78 m_dispatcherFlags = 0; 81 m_dispatcherFlags = flags; 79 82 } 80 83 … … 154 157 } 155 158 159 virtual btPoolAllocator* getInternalManifoldPool() 160 { 161 return m_persistentManifoldPoolAllocator; 162 } 163 164 virtual const btPoolAllocator* getInternalManifoldPool() const 165 { 166 return m_persistentManifoldPoolAllocator; 167 } 168 156 169 }; 157 170 158 #endif // COLLISION__DISPATCHER_H171 #endif //BT_COLLISION__DISPATCHER_H 159 172 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h
r8351 r8393 14 14 */ 15 15 16 #ifndef COLLISION_OBJECT_H17 #define COLLISION_OBJECT_H16 #ifndef BT_COLLISION_OBJECT_H 17 #define BT_COLLISION_OBJECT_H 18 18 19 19 #include "LinearMath/btTransform.h" … … 522 522 523 523 524 #endif // COLLISION_OBJECT_H524 #endif //BT_COLLISION_OBJECT_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
r8351 r8393 29 29 #include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" 30 30 #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h" 31 #include "BulletCollision/BroadphaseCollision/btDbvt.h" 31 32 #include "LinearMath/btAabbUtil2.h" 32 33 #include "LinearMath/btQuickprof.h" 33 34 #include "LinearMath/btStackAlloc.h" 34 35 #include "LinearMath/btSerializer.h" 36 #include "BulletCollision/CollisionShapes/btConvexPolyhedron.h" 37 38 //#define DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION 39 35 40 36 41 //#define USE_BRUTEFORCE_RAYBROADPHASE 1 … … 151 156 maxAabb += contactThreshold; 152 157 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 153 168 btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache; 154 169 … … 421 436 } else { 422 437 // BT_PROFILE("rayTestCompound"); 423 ///@todo: use AABB tree or other BVH acceleration structure, see btDbvt424 438 if (collisionShape->isCompound()) 425 439 { 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 426 524 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 } 468 549 } 469 550 } … … 577 658 BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,triangleMesh, colObjWorldTransform); 578 659 tccb.m_hitFraction = resultCallback.m_closestHitFraction; 660 tccb.m_allowedPenetration = allowedPenetration; 579 661 btVector3 boxMinLocal, boxMaxLocal; 580 662 castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal); … … 582 664 } else 583 665 { 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 } 606 696 } 607 697 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) 615 721 { 616 617 btCollisionWorld::LocalConvexResult convexResult618 (m_collisionObject,619 &shapeInfo,620 hitNormalLocal,621 hitPointLocal,622 hitFraction);623 624 bool normalInWorldSpace = false;625 626 return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);627 722 } 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 } 645 763 } 646 764 } else { … … 667 785 { 668 786 m_closestHitFraction = m_userCallback->m_closestHitFraction; 787 } 788 virtual bool needsCollision(btBroadphaseProxy* p) const 789 { 790 return m_userCallback->needsCollision(p); 669 791 } 670 792 virtual btScalar addSingleResult (btCollisionWorld::LocalConvexResult& r, bool b) … … 1152 1274 1153 1275 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); 1198 1277 break; 1199 1278 } … … 1203 1282 btScalar radius = coneShape->getRadius();//+coneShape->getMargin(); 1204 1283 btScalar height = coneShape->getHeight();//+coneShape->getMargin(); 1205 btVector3 start = worldTransform.getOrigin();1206 1284 1207 1285 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; 1229 1288 1230 1289 } … … 1235 1294 btScalar radius = cylinder->getRadius(); 1236 1295 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); 1252 1297 break; 1253 1298 } … … 1258 1303 btScalar planeConst = staticPlaneShape->getPlaneConstant(); 1259 1304 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); 1270 1306 break; 1271 1307 … … 1305 1341 1306 1342 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 } 1315 1381 } 1316 1382 … … 1381 1447 btVector3 colorvec(1,0,0); 1382 1448 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 1383 1464 m_debugDrawer->drawAabb(minAabb,maxAabb,colorvec); 1384 1465 } -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h
r8351 r8393 63 63 64 64 65 #ifndef COLLISION_WORLD_H66 #define COLLISION_WORLD_H65 #ifndef BT_COLLISION_WORLD_H 66 #define BT_COLLISION_WORLD_H 67 67 68 68 class btStackAlloc; … … 507 507 508 508 509 #endif // COLLISION_WORLD_H509 #endif //BT_COLLISION_WORLD_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
r8351 r8393 235 235 } 236 236 } 237 manifoldArray. clear();237 manifoldArray.resize(0); 238 238 } 239 239 } -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef COMPOUND_COLLISION_ALGORITHM_H17 #define COMPOUND_COLLISION_ALGORITHM_H16 #ifndef BT_COMPOUND_COLLISION_ALGORITHM_H 17 #define BT_COMPOUND_COLLISION_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 84 84 }; 85 85 86 #endif // COMPOUND_COLLISION_ALGORITHM_H86 #endif //BT_COMPOUND_COLLISION_ALGORITHM_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONVEX_2D_CONVEX_2D_ALGORITHM_H17 #define CONVEX_2D_CONVEX_2D_ALGORITHM_H16 #ifndef BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H 17 #define BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H 18 18 19 19 #include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h" … … 93 93 }; 94 94 95 #endif // CONVEX_2D_CONVEX_2D_ALGORITHM_H95 #endif //BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
r8351 r8393 92 92 93 93 94 94 #if 0 95 95 ///debug drawing of the overlapping triangles 96 96 if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe )) … … 101 101 m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(triangle[2]),color); 102 102 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 114 105 115 106 if (m_convexBody->getCollisionShape()->isConvex()) … … 120 111 btCollisionShape* tmpShape = ob->getCollisionShape(); 121 112 ob->internalSetTemporaryCollisionShape( &tm ); 122 113 123 114 btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr); 124 115 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef CONVEX_CONCAVE_COLLISION_ALGORITHM_H17 #define CONVEX_CONCAVE_COLLISION_ALGORITHM_H16 #ifndef BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H 17 #define BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 114 114 }; 115 115 116 #endif // CONVEX_CONCAVE_COLLISION_ALGORITHM_H116 #endif //BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
r8351 r8393 27 27 #include "BulletCollision/CollisionShapes/btConvexShape.h" 28 28 #include "BulletCollision/CollisionShapes/btCapsuleShape.h" 29 #include "BulletCollision/CollisionShapes/btTriangleShape.h" 30 29 31 30 32 … … 49 51 #include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h" 50 52 #include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h" 51 53 #include "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h" 52 54 53 55 … … 332 334 333 335 336 337 334 338 #ifdef USE_SEPDISTANCE_UTIL2 335 339 if (dispatchInfo.m_useConvexConservativeDistanceUtil) … … 358 362 #endif //USE_SEPDISTANCE_UTIL2 359 363 { 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 367 372 input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared; 368 373 } … … 372 377 input.m_transformB = body1->getWorldTransform(); 373 378 374 gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw); 379 375 380 376 381 … … 389 394 } 390 395 #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); 391 490 392 491 //now perform 'm_numPerturbationIterations' collision queries with the perturbated collision objects -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONVEX_CONVEX_ALGORITHM_H17 #define CONVEX_CONVEX_ALGORITHM_H16 #ifndef BT_CONVEX_CONVEX_ALGORITHM_H 17 #define BT_CONVEX_CONVEX_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 107 107 }; 108 108 109 #endif // CONVEX_CONVEX_ALGORITHM_H109 #endif //BT_CONVEX_CONVEX_ALGORITHM_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONVEX_PLANE_COLLISION_ALGORITHM_H17 #define CONVEX_PLANE_COLLISION_ALGORITHM_H16 #ifndef BT_CONVEX_PLANE_COLLISION_ALGORITHM_H 17 #define BT_CONVEX_PLANE_COLLISION_ALGORITHM_H 18 18 19 19 #include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" … … 81 81 }; 82 82 83 #endif // CONVEX_PLANE_COLLISION_ALGORITHM_H83 #endif //BT_CONVEX_PLANE_COLLISION_ALGORITHM_H 84 84 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef EMPTY_ALGORITH17 #define EMPTY_ALGORITH16 #ifndef BT_EMPTY_ALGORITH 17 #define BT_EMPTY_ALGORITH 18 18 #include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" 19 19 #include "btCollisionCreateFunc.h" … … 52 52 } ATTRIBUTE_ALIGNED(16); 53 53 54 #endif // EMPTY_ALGORITH54 #endif //BT_EMPTY_ALGORITH -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
r8351 r8393 2 2 3 3 #include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" 4 #include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h" 4 5 #include "BulletCollision/CollisionShapes/btTriangleShape.h" 5 6 #include "BulletCollision/CollisionDispatch/btCollisionObject.h" … … 9 10 10 11 //#define DEBUG_INTERNAL_EDGE 11 12 12 13 13 #ifdef DEBUG_INTERNAL_EDGE … … 457 457 return; 458 458 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(); 461 467 if (!triangleInfoMapPtr) 462 468 return; … … 502 508 btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB; 503 509 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) 506 560 { 507 561 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW … … 510 564 btScalar len = (contact-nearest).length(); 511 565 if(len<triangleInfoMapPtr->m_edgeDistanceThreshold) 566 if( bestedge==0 ) 512 567 { 513 568 btVector3 edge(v0-v1); … … 578 633 #endif //BT_INTERNAL_EDGE_DEBUG_DRAW 579 634 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) 581 640 { 582 641 #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW … … 588 647 btScalar len = (contact-nearest).length(); 589 648 if(len<triangleInfoMapPtr->m_edgeDistanceThreshold) 649 if( bestedge==1 ) 590 650 { 591 651 isNearEdge = true; … … 659 719 btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,blue); 660 720 #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) 663 726 { 664 727 … … 669 732 btScalar len = (contact-nearest).length(); 670 733 if(len<triangleInfoMapPtr->m_edgeDistanceThreshold) 734 if( bestedge==2 ) 671 735 { 672 736 isNearEdge = true; … … 760 824 } else 761 825 { 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 } 762 833 //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 767 837 // Reproject collision point along normal. 768 838 cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1; -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btManifoldResult.cpp
r8351 r8393 64 64 btAssert(m_manifoldPtr); 65 65 //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()) 68 69 return; 69 70 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btManifoldResult.h
r8351 r8393 15 15 16 16 17 #ifndef MANIFOLD_RESULT_H18 #define MANIFOLD_RESULT_H17 #ifndef BT_MANIFOLD_RESULT_H 18 #define BT_MANIFOLD_RESULT_H 19 19 20 20 class btCollisionObject; … … 126 126 }; 127 127 128 #endif // MANIFOLD_RESULT_H128 #endif //BT_MANIFOLD_RESULT_H -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
r8351 r8393 393 393 394 394 395 bool islandSleeping = false;395 bool islandSleeping = true; 396 396 397 397 for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) … … 400 400 btCollisionObject* colObj0 = collisionObjects[i]; 401 401 m_islandBodies.push_back(colObj0); 402 if ( !colObj0->isActive())403 islandSleeping = true;402 if (colObj0->isActive()) 403 islandSleeping = false; 404 404 } 405 405 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
r5781 r8393 14 14 */ 15 15 16 #ifndef SIMULATION_ISLAND_MANAGER_H17 #define SIMULATION_ISLAND_MANAGER_H16 #ifndef BT_SIMULATION_ISLAND_MANAGER_H 17 #define BT_SIMULATION_ISLAND_MANAGER_H 18 18 19 19 #include "BulletCollision/CollisionDispatch/btUnionFind.h" … … 78 78 }; 79 79 80 #endif // SIMULATION_ISLAND_MANAGER_H80 #endif //BT_SIMULATION_ISLAND_MANAGER_H 81 81 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef SPHERE_BOX_COLLISION_ALGORITHM_H17 #define SPHERE_BOX_COLLISION_ALGORITHM_H16 #ifndef BT_SPHERE_BOX_COLLISION_ALGORITHM_H 17 #define BT_SPHERE_BOX_COLLISION_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 72 72 }; 73 73 74 #endif // SPHERE_BOX_COLLISION_ALGORITHM_H74 #endif //BT_SPHERE_BOX_COLLISION_ALGORITHM_H 75 75 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef SPHERE_SPHERE_COLLISION_ALGORITHM_H17 #define SPHERE_SPHERE_COLLISION_ALGORITHM_H16 #ifndef BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H 17 #define BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 63 63 }; 64 64 65 #endif // SPHERE_SPHERE_COLLISION_ALGORITHM_H65 #endif //BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H 66 66 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
r5781 r8393 14 14 */ 15 15 16 #ifndef SPHERE_TRIANGLE_COLLISION_ALGORITHM_H17 #define SPHERE_TRIANGLE_COLLISION_ALGORITHM_H16 #ifndef BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H 17 #define BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H 18 18 19 19 #include "btActivatingCollisionAlgorithm.h" … … 66 66 }; 67 67 68 #endif // SPHERE_TRIANGLE_COLLISION_ALGORITHM_H68 #endif //BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H 69 69 -
code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btUnionFind.h
r8351 r8393 14 14 */ 15 15 16 #ifndef UNION_FIND_H17 #define UNION_FIND_H16 #ifndef BT_UNION_FIND_H 17 #define BT_UNION_FIND_H 18 18 19 19 #include "LinearMath/btAlignedObjectArray.h" … … 127 127 128 128 129 #endif // UNION_FIND_H129 #endif //BT_UNION_FIND_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBox2dShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef OBB_BOX_2D_SHAPE_H17 #define OBB_BOX_2D_SHAPE_H16 #ifndef BT_OBB_BOX_2D_SHAPE_H 17 #define BT_OBB_BOX_2D_SHAPE_H 18 18 19 19 #include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h" … … 359 359 }; 360 360 361 #endif // OBB_BOX_2D_SHAPE_H362 363 361 #endif //BT_OBB_BOX_2D_SHAPE_H 362 363 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBoxShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef OBB_BOX_MINKOWSKI_H17 #define OBB_BOX_MINKOWSKI_H16 #ifndef BT_OBB_BOX_MINKOWSKI_H 17 #define BT_OBB_BOX_MINKOWSKI_H 18 18 19 19 #include "btPolyhedralConvexShape.h" … … 146 146 virtual void getVertex(int i,btVector3& vtx) const 147 147 { 148 btVector3 halfExtents = getHalfExtentsWith outMargin();148 btVector3 halfExtents = getHalfExtentsWithMargin(); 149 149 150 150 vtx = btVector3( … … 314 314 315 315 316 #endif // OBB_BOX_MINKOWSKI_H317 318 316 #endif //BT_OBB_BOX_MINKOWSKI_H 317 318 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
r8351 r8393 278 278 279 279 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); 281 281 282 282 const btVector3& meshScaling = m_meshInterface->getScaling(); … … 284 284 { 285 285 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]; 287 287 288 288 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef B VH_TRIANGLE_MESH_SHAPE_H17 #define B VH_TRIANGLE_MESH_SHAPE_H16 #ifndef BT_BVH_TRIANGLE_MESH_SHAPE_H 17 #define BT_BVH_TRIANGLE_MESH_SHAPE_H 18 18 19 19 #include "btTriangleMeshShape.h" … … 40 40 BT_DECLARE_ALIGNED_ALLOCATOR(); 41 41 42 btBvhTriangleMeshShape() : btTriangleMeshShape(0),m_bvh(0),m_triangleInfoMap(0),m_ownsBvh(false) {m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;};42 43 43 btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true); 44 44 … … 137 137 138 138 139 #endif //B VH_TRIANGLE_MESH_SHAPE_H139 #endif //BT_BVH_TRIANGLE_MESH_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCollisionMargin.h
r8351 r8393 14 14 */ 15 15 16 #ifndef COLLISION_MARGIN_H17 #define COLLISION_MARGIN_H16 #ifndef BT_COLLISION_MARGIN_H 17 #define BT_COLLISION_MARGIN_H 18 18 19 19 //used by Gjk and some other algorithms … … 23 23 24 24 25 #endif // COLLISION_MARGIN_H25 #endif //BT_COLLISION_MARGIN_H 26 26 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCollisionShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef COLLISION_SHAPE_H17 #define COLLISION_SHAPE_H16 #ifndef BT_COLLISION_SHAPE_H 17 #define BT_COLLISION_SHAPE_H 18 18 19 19 #include "LinearMath/btTransform.h" … … 147 147 148 148 149 #endif // COLLISION_SHAPE_H149 #endif //BT_COLLISION_SHAPE_H 150 150 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.cpp
r8351 r8393 86 86 } 87 87 88 void btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform )88 void btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform,bool shouldRecalculateLocalAabb) 89 89 { 90 90 m_children[childIndex].m_transform = newChildTransform; … … 100 100 } 101 101 102 recalculateLocalAabb(); 102 if (shouldRecalculateLocalAabb) 103 { 104 recalculateLocalAabb(); 105 } 103 106 } 104 107 … … 284 287 m_children[i].m_childShape->setLocalScaling(childScale); 285 288 childTrans.setOrigin((childTrans.getOrigin())*scaling); 286 updateChildTransform(i, childTrans );287 recalculateLocalAabb();288 }289 updateChildTransform(i, childTrans,false); 290 } 291 289 292 m_localScaling = scaling; 293 recalculateLocalAabb(); 294 290 295 } 291 296 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef COMPOUND_SHAPE_H17 #define COMPOUND_SHAPE_H16 #ifndef BT_COMPOUND_SHAPE_H 17 #define BT_COMPOUND_SHAPE_H 18 18 19 19 #include "btCollisionShape.h" … … 107 107 108 108 ///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); 110 110 111 111 … … 144 144 } 145 145 146 147 btDbvt* getDynamicAabbTree() 146 const btDbvt* getDynamicAabbTree() const 147 { 148 return m_dynamicAabbTree; 149 } 150 151 btDbvt* getDynamicAabbTree() 148 152 { 149 153 return m_dynamicAabbTree; … … 206 210 207 211 208 #endif // COMPOUND_SHAPE_H212 #endif //BT_COMPOUND_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConcaveShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONCAVE_SHAPE_H17 #define CONCAVE_SHAPE_H16 #ifndef BT_CONCAVE_SHAPE_H 17 #define BT_CONCAVE_SHAPE_H 18 18 19 19 #include "btCollisionShape.h" … … 58 58 }; 59 59 60 #endif // CONCAVE_SHAPE_H60 #endif //BT_CONCAVE_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConeShape.cpp
r8351 r8393 132 132 133 133 134 void 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 14 14 */ 15 15 16 #ifndef CONE_MINKOWSKI_H17 #define CONE_MINKOWSKI_H16 #ifndef BT_CONE_MINKOWSKI_H 17 #define BT_CONE_MINKOWSKI_H 18 18 19 19 #include "btConvexInternalShape.h" … … 82 82 return m_coneIndices[1]; 83 83 } 84 85 virtual void setLocalScaling(const btVector3& scaling); 86 84 87 }; 85 88 … … 97 100 btConeShapeZ(btScalar radius,btScalar height); 98 101 }; 99 #endif // CONE_MINKOWSKI_H102 #endif //BT_CONE_MINKOWSKI_H 100 103 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvex2dShape.h
r8351 r8393 20 20 #include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types 21 21 22 ///The btConvex2dShape allows to use arbitrary convex shapes a re2d 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. 23 23 ///For 2d boxes, the btBox2dShape is recommended. 24 24 class btConvex2dShape : public btConvexShape -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvexHullShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONVEX_HULL_SHAPE_H17 #define CONVEX_HULL_SHAPE_H16 #ifndef BT_CONVEX_HULL_SHAPE_H 17 #define BT_CONVEX_HULL_SHAPE_H 18 18 19 19 #include "btPolyhedralConvexShape.h" … … 117 117 118 118 119 #endif // CONVEX_HULL_SHAPE_H119 #endif //BT_CONVEX_HULL_SHAPE_H 120 120 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvexShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONVEX_SHAPE_INTERFACE117 #define CONVEX_SHAPE_INTERFACE116 #ifndef BT_CONVEX_SHAPE_INTERFACE1 17 #define BT_CONVEX_SHAPE_INTERFACE1 18 18 19 19 #include "btCollisionShape.h" … … 80 80 81 81 82 #endif // CONVEX_SHAPE_INTERFACE182 #endif //BT_CONVEX_SHAPE_INTERFACE1 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h
r8351 r8393 13 13 3. This notice may not be removed or altered from any source distribution. 14 14 */ 15 #ifndef CONVEX_TRIANGLEMESH_SHAPE_H16 #define CONVEX_TRIANGLEMESH_SHAPE_H15 #ifndef BT_CONVEX_TRIANGLEMESH_SHAPE_H 16 #define BT_CONVEX_TRIANGLEMESH_SHAPE_H 17 17 18 18 … … 70 70 71 71 72 #endif // CONVEX_TRIANGLEMESH_SHAPE_H72 #endif //BT_CONVEX_TRIANGLEMESH_SHAPE_H 73 73 74 74 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCylinderShape.cpp
r8351 r8393 48 48 void btCylinderShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const 49 49 { 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 51 108 btVector3 halfExtents = getHalfExtentsWithMargin(); 52 109 … … 58 115 mass/(btScalar(12.0)) * (lx*lx + lz*lz), 59 116 mass/(btScalar(12.0)) * (lx*lx + ly*ly)); 60 117 #endif //USE_BOX_INERTIA_APPROXIMATION 61 118 } 62 119 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btCylinderShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CYLINDER_MINKOWSKI_H17 #define CYLINDER_MINKOWSKI_H16 #ifndef BT_CYLINDER_MINKOWSKI_H 17 #define BT_CYLINDER_MINKOWSKI_H 18 18 19 19 #include "btBoxShape.h" … … 197 197 198 198 199 #endif // CYLINDER_MINKOWSKI_H200 199 #endif //BT_CYLINDER_MINKOWSKI_H 200 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btEmptyShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef EMPTY_SHAPE_H17 #define EMPTY_SHAPE_H16 #ifndef BT_EMPTY_SHAPE_H 17 #define BT_EMPTY_SHAPE_H 18 18 19 19 #include "btConcaveShape.h" … … 68 68 69 69 70 #endif // EMPTY_SHAPE_H70 #endif //BT_EMPTY_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef HEIGHTFIELD_TERRAIN_SHAPE_H17 #define HEIGHTFIELD_TERRAIN_SHAPE_H16 #ifndef BT_HEIGHTFIELD_TERRAIN_SHAPE_H 17 #define BT_HEIGHTFIELD_TERRAIN_SHAPE_H 18 18 19 19 #include "btConcaveShape.h" … … 159 159 }; 160 160 161 #endif // HEIGHTFIELD_TERRAIN_SHAPE_H161 #endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMaterial.h
r8351 r8393 16 16 /// This file was created by Alex Silverman 17 17 18 #ifndef MATERIAL_H19 #define MATERIAL_H18 #ifndef BT_MATERIAL_H 19 #define BT_MATERIAL_H 20 20 21 21 // Material class to be used by btMultimaterialTriangleMeshShape to store triangle properties … … 32 32 }; 33 33 34 #endif // MATERIAL_H34 #endif // BT_MATERIAL_H 35 35 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef MINKOWSKI_SUM_SHAPE_H17 #define MINKOWSKI_SUM_SHAPE_H16 #ifndef BT_MINKOWSKI_SUM_SHAPE_H 17 #define BT_MINKOWSKI_SUM_SHAPE_H 18 18 19 19 #include "btConvexInternalShape.h" … … 58 58 }; 59 59 60 #endif // MINKOWSKI_SUM_SHAPE_H60 #endif //BT_MINKOWSKI_SUM_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMultiSphereShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef MULTI_SPHERE_MINKOWSKI_H17 #define MULTI_SPHERE_MINKOWSKI_H16 #ifndef BT_MULTI_SPHERE_MINKOWSKI_H 17 #define BT_MULTI_SPHERE_MINKOWSKI_H 18 18 19 19 #include "btConvexInternalShape.h" … … 97 97 98 98 99 #endif // MULTI_SPHERE_MINKOWSKI_H99 #endif //BT_MULTI_SPHERE_MINKOWSKI_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h
r8351 r8393 16 16 /// This file was created by Alex Silverman 17 17 18 #ifndef B VH_TRIANGLE_MATERIAL_MESH_SHAPE_H19 #define B VH_TRIANGLE_MATERIAL_MESH_SHAPE_H18 #ifndef BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H 19 #define BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H 20 20 21 21 #include "btBvhTriangleMeshShape.h" … … 32 32 BT_DECLARE_ALIGNED_ALLOCATOR(); 33 33 34 btMultimaterialTriangleMeshShape(): btBvhTriangleMeshShape() {m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;}35 34 btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true): 36 35 btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, buildBvh) … … 119 118 ; 120 119 121 #endif //B VH_TRIANGLE_MATERIAL_MESH_SHAPE_H120 #endif //BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btOptimizedBvh.h
r8351 r8393 16 16 ///Contains contributions from Disney Studio's 17 17 18 #ifndef OPTIMIZED_BVH_H19 #define OPTIMIZED_BVH_H18 #ifndef BT_OPTIMIZED_BVH_H 19 #define BT_OPTIMIZED_BVH_H 20 20 21 21 #include "BulletCollision/BroadphaseCollision/btQuantizedBvh.h" … … 61 61 62 62 63 #endif // OPTIMIZED_BVH_H63 #endif //BT_OPTIMIZED_BVH_H 64 64 65 65 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
r8351 r8393 15 15 16 16 #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 21 btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape(), 22 m_polyhedron(0) 23 { 24 25 } 26 27 btPolyhedralConvexShape::~btPolyhedralConvexShape() 28 { 29 if (m_polyhedron) 30 { 31 btAlignedFree(m_polyhedron); 32 } 33 } 34 35 bool 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; 21 163 } 22 164 … … 192 334 } 193 335 336 337 338 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef B U_SHAPE17 #define B U_SHAPE16 #ifndef BT_POLYHEDRAL_CONVEX_SHAPE_H 17 #define BT_POLYHEDRAL_CONVEX_SHAPE_H 18 18 19 19 #include "LinearMath/btMatrix3x3.h" 20 20 #include "btConvexInternalShape.h" 21 class btConvexPolyhedron; 21 22 22 23 … … 24 25 class btPolyhedralConvexShape : public btConvexInternalShape 25 26 { 27 26 28 27 29 protected: 28 30 31 btConvexPolyhedron* m_polyhedron; 32 29 33 public: 30 34 31 35 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 } 32 46 33 47 //brute force implementations … … 96 110 }; 97 111 98 #endif //B U_SHAPE112 #endif //BT_POLYHEDRAL_CONVEX_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
r8351 r8393 63 63 scaledAabbMin[1] = m_localScaling.getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1]; 64 64 scaledAabbMin[2] = m_localScaling.getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2]; 65 scaledAabbMin[3] = 0.f; 65 66 66 67 scaledAabbMax[0] = m_localScaling.getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0]; 67 68 scaledAabbMax[1] = m_localScaling.getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1]; 68 69 scaledAabbMax[2] = m_localScaling.getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2]; 70 scaledAabbMax[3] = 0.f; 69 71 70 72 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef SCALED_BVH_TRIANGLE_MESH_SHAPE_H17 #define SCALED_BVH_TRIANGLE_MESH_SHAPE_H16 #ifndef BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H 17 #define BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H 18 18 19 19 #include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" … … 58 58 virtual const char* getName()const {return "SCALEDBVHTRIANGLEMESH";} 59 59 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 60 65 }; 61 66 62 #endif //BVH_TRIANGLE_MESH_SHAPE_H 67 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 68 struct btScaledTriangleMeshShapeData 69 { 70 btTriangleMeshShapeData m_trimeshShapeData; 71 72 btVector3FloatData m_localScaling; 73 }; 74 75 76 SIMD_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) 83 SIMD_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 16 16 ///btShapeHull implemented by John McCutchan. 17 17 18 #ifndef _SHAPE_HULL_H19 #define _SHAPE_HULL_H18 #ifndef BT_SHAPE_HULL_H 19 #define BT_SHAPE_HULL_H 20 20 21 21 #include "LinearMath/btAlignedObjectArray.h" … … 57 57 }; 58 58 59 #endif // _SHAPE_HULL_H59 #endif //BT_SHAPE_HULL_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btSphereShape.h
r8351 r8393 13 13 3. This notice may not be removed or altered from any source distribution. 14 14 */ 15 #ifndef SPHERE_MINKOWSKI_H16 #define SPHERE_MINKOWSKI_H15 #ifndef BT_SPHERE_MINKOWSKI_H 16 #define BT_SPHERE_MINKOWSKI_H 17 17 18 18 #include "btConvexInternalShape.h" … … 71 71 72 72 73 #endif // SPHERE_MINKOWSKI_H73 #endif //BT_SPHERE_MINKOWSKI_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btStaticPlaneShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef STATIC_PLANE_SHAPE_H17 #define STATIC_PLANE_SHAPE_H16 #ifndef BT_STATIC_PLANE_SHAPE_H 17 #define BT_STATIC_PLANE_SHAPE_H 18 18 19 19 #include "btConcaveShape.h" … … 98 98 99 99 100 #endif // STATIC_PLANE_SHAPE_H100 #endif //BT_STATIC_PLANE_SHAPE_H 101 101 102 102 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
r8351 r8393 89 89 break; 90 90 } 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 } 91 106 default: 92 107 btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT)); … … 121 136 { 122 137 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); 123 153 graphicsbase = (double*)(vertexbase+tri_indices[0]*stride); 124 154 triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ()); … … 267 297 break; 268 298 } 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 } 269 317 default: 270 318 { -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h
r8351 r8393 14 14 */ 15 15 16 #ifndef STRIDING_MESHINTERFACE_H17 #define STRIDING_MESHINTERFACE_H16 #ifndef BT_STRIDING_MESHINTERFACE_H 17 #define BT_STRIDING_MESHINTERFACE_H 18 18 19 19 #include "LinearMath/btVector3.h" … … 117 117 }; 118 118 119 struct btCharIndexTripletData 120 { 121 unsigned char m_values[3]; 122 char m_pad; 123 }; 124 125 119 126 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 120 127 struct btMeshPartData … … 125 132 btIntIndexData *m_indices32; 126 133 btShortIntIndexTripletData *m_3indices16; 134 btCharIndexTripletData *m_3indices8; 127 135 128 136 btShortIntIndexData *m_indices16;//backwards compatibility … … 152 160 153 161 154 #endif // STRIDING_MESHINTERFACE_H162 #endif //BT_STRIDING_MESHINTERFACE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef B U_SIMPLEX_1TO4_SHAPE17 #define B U_SIMPLEX_1TO4_SHAPE16 #ifndef BT_SIMPLEX_1TO4_SHAPE 17 #define BT_SIMPLEX_1TO4_SHAPE 18 18 19 19 … … 72 72 }; 73 73 74 #endif //B U_SIMPLEX_1TO4_SHAPE74 #endif //BT_SIMPLEX_1TO4_SHAPE -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleCallback.h
r8351 r8393 14 14 */ 15 15 16 #ifndef TRIANGLE_CALLBACK_H17 #define TRIANGLE_CALLBACK_H16 #ifndef BT_TRIANGLE_CALLBACK_H 17 #define BT_TRIANGLE_CALLBACK_H 18 18 19 19 #include "LinearMath/btVector3.h" … … 40 40 41 41 42 #endif // TRIANGLE_CALLBACK_H42 #endif //BT_TRIANGLE_CALLBACK_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleInfoMap.h
r8351 r8393 62 62 btScalar m_equalVertexThreshold; ///used to compute connectivity: if the distance between two vertices is smaller than m_equalVertexThreshold, they are considered to be 'shared' 63 63 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 64 65 btScalar m_zeroAreaThreshold; ///used to determine if a triangle is degenerate (length squared of cross product of 2 triangle edges < threshold) 65 66 … … 72 73 m_edgeDistanceThreshold = btScalar(0.1); 73 74 m_zeroAreaThreshold = btScalar(0.0001)*btScalar(0.0001); 75 m_maxEdgeAngleThreshold = SIMD_2_PI; 74 76 } 75 77 virtual ~btTriangleInfoMap() {} -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleMesh.h
r8351 r8393 14 14 */ 15 15 16 #ifndef TRIANGLE_MESH_H17 #define TRIANGLE_MESH_H16 #ifndef BT_TRIANGLE_MESH_H 17 #define BT_TRIANGLE_MESH_H 18 18 19 19 #include "btTriangleIndexVertexArray.h" … … 66 66 }; 67 67 68 #endif // TRIANGLE_MESH_H68 #endif //BT_TRIANGLE_MESH_H 69 69 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleMeshShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef TRIANGLE_MESH_SHAPE_H17 #define TRIANGLE_MESH_SHAPE_H16 #ifndef BT_TRIANGLE_MESH_SHAPE_H 17 #define BT_TRIANGLE_MESH_SHAPE_H 18 18 19 19 #include "btConcaveShape.h" … … 87 87 88 88 89 #endif // TRIANGLE_MESH_SHAPE_H89 #endif //BT_TRIANGLE_MESH_SHAPE_H -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btTriangleShape.h
r8351 r8393 14 14 */ 15 15 16 #ifndef OBB_TRIANGLE_MINKOWSKI_H17 #define OBB_TRIANGLE_MINKOWSKI_H16 #ifndef BT_OBB_TRIANGLE_MINKOWSKI_H 17 #define BT_OBB_TRIANGLE_MINKOWSKI_H 18 18 19 19 #include "btConvexShape.h" … … 179 179 }; 180 180 181 #endif // OBB_TRIANGLE_MINKOWSKI_H181 #endif //BT_OBB_TRIANGLE_MINKOWSKI_H 182 182 -
code/trunk/src/external/bullet/BulletCollision/CollisionShapes/btUniformScalingShape.cpp
r8351 r8393 65 65 66 66 ///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) const67 void btUniformScalingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const 68 68 { 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); 75 70 76 71 } … … 78 73 void btUniformScalingShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const 79 74 { 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 }; 83 95 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 86 131 } 87 132 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
r8351 r8393 23 23 #include "btGjkPairDetector.h" 24 24 #include "btPointCollector.h" 25 #include "BulletCollision/CollisionShapes/btStaticPlaneShape.h" 25 26 26 27 … … 29 30 :m_simplexSolver(simplexSolver), 30 31 m_penetrationDepthSolver(penetrationDepthSolver), 31 m_convexA(convexA),m_convexB(convexB) 32 { 33 } 32 m_convexA(convexA),m_convexB1(convexB),m_planeShape(0) 33 { 34 } 35 36 37 btContinuousConvexCollision::btContinuousConvexCollision( const btConvexShape* convexA,const btStaticPlaneShape* plane) 38 :m_simplexSolver(0), 39 m_penetrationDepthSolver(0), 40 m_convexA(convexA),m_convexB1(0),m_planeShape(plane) 41 { 42 } 43 34 44 35 45 /// This maximum should not be necessary. It allows for untested/degenerate cases in production code. 36 46 /// You don't want your game ever to lock-up. 37 47 #define MAX_ITERATIONS 64 48 49 void 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 } 38 90 39 91 bool btContinuousConvexCollision::calcTimeOfImpact( … … 45 97 { 46 98 47 m_simplexSolver->reset();48 99 49 100 /// compute linear and angular velocity for this interval, to interpolate … … 54 105 55 106 btScalar boundingRadiusA = m_convexA->getAngularMotionDisc(); 56 btScalar boundingRadiusB = m_convexB ->getAngularMotionDisc();107 btScalar boundingRadiusB = m_convexB1?m_convexB1->getAngularMotionDisc():0.f; 57 108 58 109 btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB; … … 65 116 66 117 67 btScalar radius = btScalar(0.001);68 118 69 119 btScalar lambda = btScalar(0.); … … 84 134 85 135 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; 93 137 // result.drawCoordSystem(sphereTr); 94 138 … … 96 140 97 141 { 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;101 142 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); 108 144 109 145 hasResult = pointCollector1.m_hasResult; … … 114 150 { 115 151 btScalar dist; 116 dist = pointCollector1.m_distance ;152 dist = pointCollector1.m_distance + result.m_allowedPenetration; 117 153 n = pointCollector1.m_normalOnBInWorld; 118 119 154 btScalar projectedLinearVelocity = relLinVel.dot(n); 120 155 if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON) 156 return false; 157 121 158 //not close enough 122 159 while (dist > radius) … … 126 163 result.m_debugDrawer->drawSphere(c,0.2f,btVector3(1,1,1)); 127 164 } 128 numIter++;129 if (numIter > maxIter)130 {131 return false; //todo: report a failure132 }133 165 btScalar dLambda = btScalar(0.); 134 166 135 167 projectedLinearVelocity = relLinVel.dot(n); 136 168 137 //calculate safe moving fraction from distance / (linear+rotational velocity)138 139 //btScalar clippedDist = GEN_min(angularConservativeRadius,dist);140 //btScalar clippedDist = dist;141 169 142 170 //don't report time of impact for motion away from the contact normal (or causes minor penetration) … … 183 211 184 212 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 190 215 if (pointCollector.m_hasResult) 191 216 { 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; 201 218 c = pointCollector.m_pointInWorld; 202 219 n = pointCollector.m_normalOnBInWorld; 203 dist = pointCollector.m_distance;204 220 } else 205 221 { 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 } 211 232 } 212 233 213 if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=result.m_allowedPenetration)//SIMD_EPSILON)214 return false;215 216 234 result.m_fraction = lambda; 217 235 result.m_normal = n; … … 222 240 return false; 223 241 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 15 15 16 16 17 #ifndef CONTINUOUS_COLLISION_CONVEX_CAST_H18 #define CONTINUOUS_COLLISION_CONVEX_CAST_H17 #ifndef BT_CONTINUOUS_COLLISION_CONVEX_CAST_H 18 #define BT_CONTINUOUS_COLLISION_CONVEX_CAST_H 19 19 20 20 #include "btConvexCast.h" … … 22 22 class btConvexPenetrationDepthSolver; 23 23 class btConvexShape; 24 class btStaticPlaneShape; 24 25 25 26 /// btContinuousConvexCollision implements angular and linear time of impact for convex objects. … … 32 33 btConvexPenetrationDepthSolver* m_penetrationDepthSolver; 33 34 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; 35 38 39 void computeClosestPoints( const btTransform& transA, const btTransform& transB,struct btPointCollector& pointCollector); 36 40 37 41 public: 38 42 39 43 btContinuousConvexCollision (const btConvexShape* shapeA,const btConvexShape* shapeB ,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver); 44 45 btContinuousConvexCollision(const btConvexShape* shapeA,const btStaticPlaneShape* plane ); 40 46 41 47 virtual bool calcTimeOfImpact( … … 49 55 }; 50 56 51 #endif //CONTINUOUS_COLLISION_CONVEX_CAST_H52 57 58 #endif //BT_CONTINUOUS_COLLISION_CONVEX_CAST_H 59 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btConvexCast.h
r8351 r8393 15 15 16 16 17 #ifndef CONVEX_CAST_H18 #define CONVEX_CAST_H17 #ifndef BT_CONVEX_CAST_H 18 #define BT_CONVEX_CAST_H 19 19 20 20 #include "LinearMath/btTransform.h" … … 40 40 virtual void DebugDraw(btScalar fraction) {(void)fraction;} 41 41 virtual void drawCoordSystem(const btTransform& trans) {(void)trans;} 42 42 virtual void reportFailure(int errNo, int numIterations) {(void)errNo;(void)numIterations;} 43 43 CastResult() 44 44 :m_fraction(btScalar(BT_LARGE_FLOAT)), … … 71 71 }; 72 72 73 #endif // CONVEX_CAST_H73 #endif //BT_CONVEX_CAST_H -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h
r8351 r8393 15 15 16 16 17 #ifndef __CONVEX_PENETRATION_DEPTH_H18 #define __CONVEX_PENETRATION_DEPTH_H17 #ifndef BT_CONVEX_PENETRATION_DEPTH_H 18 #define BT_CONVEX_PENETRATION_DEPTH_H 19 19 20 20 class btStackAlloc; … … 39 39 40 40 }; 41 #endif // CONVEX_PENETRATION_DEPTH_H41 #endif //BT_CONVEX_PENETRATION_DEPTH_H 42 42 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h
r8351 r8393 15 15 16 16 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 19 20 #include "LinearMath/btTransform.h" 20 21 #include "LinearMath/btVector3.h" … … 87 88 }; 88 89 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 16 16 17 17 18 #ifndef GJK_CONVEX_CAST_H19 #define GJK_CONVEX_CAST_H18 #ifndef BT_GJK_CONVEX_CAST_H 19 #define BT_GJK_CONVEX_CAST_H 20 20 21 21 #include "BulletCollision/CollisionShapes/btCollisionMargin.h" … … 48 48 }; 49 49 50 #endif // GJK_CONVEX_CAST_H50 #endif //BT_GJK_CONVEX_CAST_H -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h
r8351 r8393 23 23 GJK-EPA collision solver by Nathanael Presson, 2008 24 24 */ 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 27 28 #include "BulletCollision/CollisionShapes/btConvexShape.h" 28 29 … … 71 72 }; 72 73 73 #endif 74 #endif //BT_GJK_EPA2_H 75 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
r8351 r8393 255 255 #endif // 256 256 257 m_cachedSeparatingAxis = newCachedSeparatingAxis;258 257 259 258 //redundant m_simplexSolver->compute_points(pointOnA, pointOnB); … … 262 261 if (previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance) 263 262 { 264 m_simplexSolver->backup_closest(m_cachedSeparatingAxis);263 // m_simplexSolver->backup_closest(m_cachedSeparatingAxis); 265 264 checkSimplex = true; 266 265 m_degenerateSimplex = 12; … … 268 267 break; 269 268 } 269 270 m_cachedSeparatingAxis = newCachedSeparatingAxis; 270 271 271 272 //degeneracy, this is typically due to invalid/uninitialized worldtransforms for a btCollisionObject … … 295 296 { 296 297 //do we need this backup_closest here ? 297 m_simplexSolver->backup_closest(m_cachedSeparatingAxis);298 // m_simplexSolver->backup_closest(m_cachedSeparatingAxis); 298 299 m_degenerateSimplex = 13; 299 300 break; … … 304 305 { 305 306 m_simplexSolver->compute_points(pointOnA, pointOnB); 306 normalInB = pointOnA-pointOnB;307 normalInB = m_cachedSeparatingAxis; 307 308 btScalar lenSqr =m_cachedSeparatingAxis.length2(); 308 309 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h
r8351 r8393 17 17 18 18 19 #ifndef GJK_PAIR_DETECTOR_H20 #define GJK_PAIR_DETECTOR_H19 #ifndef BT_GJK_PAIR_DETECTOR_H 20 #define BT_GJK_PAIR_DETECTOR_H 21 21 22 22 #include "btDiscreteCollisionDetectorInterface.h" … … 101 101 }; 102 102 103 #endif // GJK_PAIR_DETECTOR_H103 #endif //BT_GJK_PAIR_DETECTOR_H -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
r8351 r8393 14 14 */ 15 15 16 #ifndef MANIFOLD_CONTACT_POINT_H17 #define MANIFOLD_CONTACT_POINT_H16 #ifndef BT_MANIFOLD_CONTACT_POINT_H 17 #define BT_MANIFOLD_CONTACT_POINT_H 18 18 19 19 #include "LinearMath/btVector3.h" 20 20 #include "LinearMath/btTransformUtil.h" 21 21 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" 24 typedef 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 32 37 33 38 … … 72 77 m_lifeTime(0) 73 78 { 74 mConstraintRow[0].m AccumImpulse = 0.f;75 mConstraintRow[1].m AccumImpulse = 0.f;76 mConstraintRow[2].m AccumImpulse = 0.f;79 mConstraintRow[0].m_accumImpulse = 0.f; 80 mConstraintRow[1].m_accumImpulse = 0.f; 81 mConstraintRow[2].m_accumImpulse = 0.f; 77 82 } 78 83 … … 114 119 115 120 116 PfxConstraintRow mConstraintRow[3];121 btConstraintRow mConstraintRow[3]; 117 122 118 123 … … 151 156 }; 152 157 153 #endif // MANIFOLD_CONTACT_POINT_H158 #endif //BT_MANIFOLD_CONTACT_POINT_H -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h
r8351 r8393 14 14 */ 15 15 16 #ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H17 #define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H16 #ifndef BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 17 #define BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 18 18 19 19 #include "btConvexPenetrationDepthSolver.h" … … 37 37 }; 38 38 39 #endif // MINKOWSKI_PENETRATION_DEPTH_SOLVER_H39 #endif //BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H 40 40 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
r8351 r8393 14 14 */ 15 15 16 #ifndef PERSISTENT_MANIFOLD_H17 #define PERSISTENT_MANIFOLD_H16 #ifndef BT_PERSISTENT_MANIFOLD_H 17 #define BT_PERSISTENT_MANIFOLD_H 18 18 19 19 … … 33 33 extern ContactProcessedCallback gContactProcessedCallback; 34 34 35 35 //the enum starts at 1024 to avoid type conflicts with btTypedConstraint 36 36 enum btContactManifoldTypes 37 37 { 38 BT_PERSISTENT_MANIFOLD_TYPE = 1,39 MAX_CONTACT_MANIFOLD_TYPE38 MIN_CONTACT_MANIFOLD_TYPE = 1024, 39 BT_PERSISTENT_MANIFOLD_TYPE 40 40 }; 41 41 … … 147 147 //get rid of duplicated userPersistentData pointer 148 148 m_pointCache[lastUsedIndex].m_userPersistentData = 0; 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;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; 152 152 153 153 m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f; … … 168 168 #ifdef MAINTAIN_PERSISTENCY 169 169 int lifeTime = m_pointCache[insertIndex].getLifeTime(); 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;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; 173 173 // bool isLateralFrictionInitialized = m_pointCache[insertIndex].m_lateralFrictionInitialized; 174 174 … … 185 185 m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2; 186 186 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;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; 190 190 191 191 … … 200 200 bool validContactDistance(const btManifoldPoint& pt) const 201 201 { 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 203 208 } 204 209 /// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin … … 225 230 226 231 227 #endif // PERSISTENT_MANIFOLD_H232 #endif //BT_PERSISTENT_MANIFOLD_H -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btPointCollector.h
r8351 r8393 14 14 */ 15 15 16 #ifndef POINT_COLLECTOR_H17 #define POINT_COLLECTOR_H16 #ifndef BT_POINT_COLLECTOR_H 17 #define BT_POINT_COLLECTOR_H 18 18 19 19 #include "btDiscreteCollisionDetectorInterface.h" … … 61 61 }; 62 62 63 #endif // POINT_COLLECTOR_H63 #endif //BT_POINT_COLLECTOR_H 64 64 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
r5781 r8393 125 125 m_convexShapeTo = convexShapeTo; 126 126 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; 129 130 } 130 131 … … 149 150 btConvexCast::CastResult castResult; 150 151 castResult.m_fraction = btScalar(1.); 152 castResult.m_allowedPenetration = m_allowedPenetration; 151 153 if (convexCaster.calcTimeOfImpact(m_convexShapeFrom,m_convexShapeTo,m_triangleToWorld, m_triangleToWorld, castResult)) 152 154 { -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
r5781 r8393 14 14 */ 15 15 16 #ifndef RAYCAST_TRI_CALLBACK_H17 #define RAYCAST_TRI_CALLBACK_H16 #ifndef BT_RAYCAST_TRI_CALLBACK_H 17 #define BT_RAYCAST_TRI_CALLBACK_H 18 18 19 19 #include "BulletCollision/CollisionShapes/btTriangleCallback.h" … … 59 59 btTransform m_triangleToWorld; 60 60 btScalar m_hitFraction; 61 btScalar m_triangleCollisionMargin; 61 btScalar m_triangleCollisionMargin; 62 btScalar m_allowedPenetration; 62 63 63 64 btTriangleConvexcastCallback (const btConvexShape* convexShape, const btTransform& convexShapeFrom, const btTransform& convexShapeTo, const btTransform& triangleToWorld, const btScalar triangleCollisionMargin); … … 68 69 }; 69 70 70 #endif // RAYCAST_TRI_CALLBACK_H71 #endif //BT_RAYCAST_TRI_CALLBACK_H 71 72 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
r5781 r8393 16 16 17 17 18 #ifndef SIMPLEX_SOLVER_INTERFACE_H19 #define SIMPLEX_SOLVER_INTERFACE_H18 #ifndef BT_SIMPLEX_SOLVER_INTERFACE_H 19 #define BT_SIMPLEX_SOLVER_INTERFACE_H 20 20 21 21 #include "LinearMath/btVector3.h" … … 60 60 }; 61 61 #endif 62 #endif // SIMPLEX_SOLVER_INTERFACE_H62 #endif //BT_SIMPLEX_SOLVER_INTERFACE_H 63 63 -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
r5781 r8393 15 15 16 16 17 #ifndef SUBSIMPLEX_CONVEX_CAST_H18 #define SUBSIMPLEX_CONVEX_CAST_H17 #ifndef BT_SUBSIMPLEX_CONVEX_CAST_H 18 #define BT_SUBSIMPLEX_CONVEX_CAST_H 19 19 20 20 #include "btConvexCast.h" … … 48 48 }; 49 49 50 #endif // SUBSIMPLEX_CONVEX_CAST_H50 #endif //BT_SUBSIMPLEX_CONVEX_CAST_H -
code/trunk/src/external/bullet/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h
r8351 r8393 16 16 17 17 18 #ifndef btVoronoiSimplexSolver_H19 #define btVoronoiSimplexSolver_H18 #ifndef BT_VORONOI_SIMPLEX_SOLVER_H 19 #define BT_VORONOI_SIMPLEX_SOLVER_H 20 20 21 21 #include "btSimplexSolverInterface.h" … … 176 176 }; 177 177 178 #endif //VoronoiSimplexSolver 178 #endif //BT_VORONOI_SIMPLEX_SOLVER_H 179 -
code/trunk/src/external/bullet/BulletDynamics/Character/btCharacterControllerInterface.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CHARACTER_CONTROLLER_INTERFACE_H17 #define CHARACTER_CONTROLLER_INTERFACE_H16 #ifndef BT_CHARACTER_CONTROLLER_INTERFACE_H 17 #define BT_CHARACTER_CONTROLLER_INTERFACE_H 18 18 19 19 #include "LinearMath/btVector3.h" … … 43 43 }; 44 44 45 #endif 45 #endif //BT_CHARACTER_CONTROLLER_INTERFACE_H 46 -
code/trunk/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.cpp
r8351 r8393 85 85 { 86 86 ///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; 88 88 } 89 89 -
code/trunk/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.h
r8351 r8393 15 15 16 16 17 #ifndef KINEMATIC_CHARACTER_CONTROLLER_H18 #define KINEMATIC_CHARACTER_CONTROLLER_H17 #ifndef BT_KINEMATIC_CHARACTER_CONTROLLER_H 18 #define BT_KINEMATIC_CHARACTER_CONTROLLER_H 19 19 20 20 #include "LinearMath/btVector3.h" … … 160 160 }; 161 161 162 #endif // KINEMATIC_CHARACTER_CONTROLLER_H162 #endif // BT_KINEMATIC_CHARACTER_CONTROLLER_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
r8351 r8393 1115 1115 1116 1116 1117 1117 void 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 34 34 35 35 36 #ifndef CONETWISTCONSTRAINT_H37 #define CONETWISTCONSTRAINT_H36 #ifndef BT_CONETWISTCONSTRAINT_H 37 #define BT_CONETWISTCONSTRAINT_H 38 38 39 39 #include "LinearMath/btVector3.h" … … 144 144 145 145 void updateRHS(btScalar timeStep); 146 146 147 147 148 const btRigidBody& getRigidBodyA() const … … 245 246 bool isPastSwingLimit() { return m_solveSwingLimit; } 246 247 247 248 248 void setDamping(btScalar damping) { m_damping = damping; } 249 249 … … 269 269 ///If no axis is provided, it uses the default axis for this constraint. 270 270 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 271 285 ///return the local value of parameter 272 286 virtual btScalar getParam(int num, int axis = -1) const; … … 330 344 331 345 332 #endif // CONETWISTCONSTRAINT_H346 #endif //BT_CONETWISTCONSTRAINT_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btConstraintSolver.h
r5781 r8393 14 14 */ 15 15 16 #ifndef CONSTRAINT_SOLVER_H17 #define CONSTRAINT_SOLVER_H16 #ifndef BT_CONSTRAINT_SOLVER_H 17 #define BT_CONSTRAINT_SOLVER_H 18 18 19 19 #include "LinearMath/btScalar.h" … … 50 50 51 51 52 #endif // CONSTRAINT_SOLVER_H52 #endif //BT_CONSTRAINT_SOLVER_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactConstraint.cpp
r8351 r8393 69 69 #include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h" 70 70 71 #define ASSERT2 btAssert72 71 73 #define USE_INTERNAL_APPLY_IMPULSE 1 72 73 //response between two dynamic objects without friction, assuming 0 penetration depth 74 btScalar 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 } 74 118 75 119 … … 84 128 85 129 btScalar normalLenSqr = normal.length2(); 86 ASSERT2(btFabs(normalLenSqr) < btScalar(1.1));130 btAssert(btFabs(normalLenSqr) < btScalar(1.1)); 87 131 if (normalLenSqr > btScalar(1.1)) 88 132 { -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactConstraint.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONTACT_CONSTRAINT_H17 #define CONTACT_CONSTRAINT_H16 #ifndef BT_CONTACT_CONSTRAINT_H 17 #define BT_CONTACT_CONSTRAINT_H 18 18 19 19 #include "LinearMath/btVector3.h" … … 58 58 }; 59 59 60 ///very basic collision resolution without friction 61 btScalar resolveSingleCollision(btRigidBody* body1, class btCollisionObject* colObj2, const btVector3& contactPositionWorld,const btVector3& contactNormalOnB, const struct btContactSolverInfo& solverInfo,btScalar distance); 62 60 63 61 64 ///resolveSingleBilateral is an obsolete methods used for vehicle friction between two dynamic objects … … 66 69 67 70 68 #endif // CONTACT_CONSTRAINT_H71 #endif //BT_CONTACT_CONSTRAINT_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
r8351 r8393 14 14 */ 15 15 16 #ifndef CONTACT_SOLVER_INFO17 #define CONTACT_SOLVER_INFO16 #ifndef BT_CONTACT_SOLVER_INFO 17 #define BT_CONTACT_SOLVER_INFO 18 18 19 19 enum btSolverMode … … 85 85 }; 86 86 87 #endif // CONTACT_SOLVER_INFO87 #endif //BT_CONTACT_SOLVER_INFO -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
r8351 r8393 711 711 (void)timeStep; 712 712 713 } 714 715 716 void btGeneric6DofConstraint::setFrames(const btTransform& frameA, const btTransform& frameB) 717 { 718 m_frameInA = frameA; 719 m_frameInB = frameB; 720 buildJacobian(); 721 calculateTransforms(); 713 722 } 714 723 … … 1039 1048 return retVal; 1040 1049 } 1050 1051 1052 1053 void 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 25 25 26 26 27 #ifndef GENERIC_6DOF_CONSTRAINT_H28 #define GENERIC_6DOF_CONSTRAINT_H27 #ifndef BT_GENERIC_6DOF_CONSTRAINT_H 28 #define BT_GENERIC_6DOF_CONSTRAINT_H 29 29 30 30 #include "LinearMath/btVector3.h" … … 434 434 btScalar getRelativePivotPosition(int axis_index) const; 435 435 436 void setFrames(const btTransform & frameA, const btTransform & frameB); 436 437 437 438 //! Test angular limit. … … 447 448 } 448 449 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 } 453 464 454 465 void setAngularLowerLimit(const btVector3& angularLower) … … 458 469 } 459 470 471 void getAngularLowerLimit(btVector3& angularLower) 472 { 473 for(int i = 0; i < 3; i++) 474 angularLower[i] = m_angularLimits[i].m_loLimit; 475 } 476 460 477 void setAngularUpperLimit(const btVector3& angularUpper) 461 478 { … … 463 480 m_angularLimits[i].m_hiLimit = btNormalizeAngle(angularUpper[i]); 464 481 } 482 483 void getAngularUpperLimit(btVector3& angularUpper) 484 { 485 for(int i = 0; i < 3; i++) 486 angularUpper[i] = m_angularLimits[i].m_hiLimit; 487 } 465 488 466 489 //! Retrieves the angular limit informacion … … 526 549 virtual btScalar getParam(int num, int axis = -1) const; 527 550 551 void setAxis( const btVector3& axis1, const btVector3& axis2); 552 553 528 554 virtual int calculateSerializeBufferSize() const; 529 555 … … 586 612 587 613 588 #endif // GENERIC_6DOF_CONSTRAINT_H614 #endif //BT_GENERIC_6DOF_CONSTRAINT_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
r8351 r8393 22 22 : btGeneric6DofConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA) 23 23 { 24 m_objectType = D6_SPRING_CONSTRAINT_TYPE; 25 24 26 for(int i = 0; i < 6; i++) 25 27 { … … 148 150 149 151 152 void 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 } 150 170 151 171 172 -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
r8351 r8393 14 14 */ 15 15 16 #ifndef GENERIC_6DOF_SPRING_CONSTRAINT_H17 #define GENERIC_6DOF_SPRING_CONSTRAINT_H16 #ifndef BT_GENERIC_6DOF_SPRING_CONSTRAINT_H 17 #define BT_GENERIC_6DOF_SPRING_CONSTRAINT_H 18 18 19 19 … … 49 49 void setEquilibriumPoint(int index); // set the current constraint position/orientation as an equilibrium point for given DOF 50 50 void setEquilibriumPoint(int index, btScalar val); 51 52 virtual void setAxis( const btVector3& axis1, const btVector3& axis2); 53 51 54 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 52 60 }; 53 61 54 #endif // GENERIC_6DOF_SPRING_CONSTRAINT_H55 62 63 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 64 struct 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 74 SIMD_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) 80 SIMD_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 14 14 */ 15 15 16 #ifndef HINGE2_CONSTRAINT_H17 #define HINGE2_CONSTRAINT_H16 #ifndef BT_HINGE2_CONSTRAINT_H 17 #define BT_HINGE2_CONSTRAINT_H 18 18 19 19 … … 55 55 56 56 57 #endif // HINGE2_CONSTRAINT_H57 #endif // BT_HINGE2_CONSTRAINT_H 58 58 -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
r8351 r8393 44 44 m_useReferenceFrameA(useReferenceFrameA), 45 45 m_flags(0) 46 #ifdef _BT_USE_CENTER_LIMIT_ 47 ,m_limit() 48 #endif 46 49 { 47 50 m_rbAFrame.getOrigin() = pivotInA; … … 76 79 rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() ); 77 80 81 #ifndef _BT_USE_CENTER_LIMIT_ 78 82 //start with free 79 83 m_lowerLimit = btScalar(1.0f); … … 83 87 m_limitSoftness = 0.9f; 84 88 m_solveLimit = false; 89 #endif 85 90 m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f); 86 91 } … … 94 99 m_useReferenceFrameA(useReferenceFrameA), 95 100 m_flags(0) 101 #ifdef _BT_USE_CENTER_LIMIT_ 102 ,m_limit() 103 #endif 96 104 { 97 105 … … 118 126 rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() ); 119 127 128 #ifndef _BT_USE_CENTER_LIMIT_ 120 129 //start with free 121 130 m_lowerLimit = btScalar(1.0f); … … 125 134 m_limitSoftness = 0.9f; 126 135 m_solveLimit = false; 136 #endif 127 137 m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f); 128 138 } … … 139 149 m_useReferenceFrameA(useReferenceFrameA), 140 150 m_flags(0) 141 { 151 #ifdef _BT_USE_CENTER_LIMIT_ 152 ,m_limit() 153 #endif 154 { 155 #ifndef _BT_USE_CENTER_LIMIT_ 142 156 //start with free 143 157 m_lowerLimit = btScalar(1.0f); … … 147 161 m_limitSoftness = 0.9f; 148 162 m_solveLimit = false; 163 #endif 149 164 m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f); 150 165 } … … 160 175 m_useReferenceFrameA(useReferenceFrameA), 161 176 m_flags(0) 177 #ifdef _BT_USE_CENTER_LIMIT_ 178 ,m_limit() 179 #endif 162 180 { 163 181 ///not providing rigidbody B means implicitly using worldspace for body B 164 182 165 183 m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(m_rbAFrame.getOrigin()); 166 184 #ifndef _BT_USE_CENTER_LIMIT_ 167 185 //start with free 168 186 m_lowerLimit = btScalar(1.0f); … … 172 190 m_limitSoftness = 0.9f; 173 191 m_solveLimit = false; 192 #endif 174 193 m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f); 175 194 } … … 450 469 if(getSolveLimit()) 451 470 { 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 454 478 } 455 479 // if the hinge has joint limits or motor, add in the extra row … … 515 539 } 516 540 // 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 517 544 btScalar bounce = m_relaxationFactor; 545 #endif 518 546 if(bounce > btScalar(0.0)) 519 547 { … … 545 573 } 546 574 } 575 #ifdef _BT_USE_CENTER_LIMIT_ 576 info->m_constraintError[srow] *= m_limit.getBiasFactor(); 577 #else 547 578 info->m_constraintError[srow] *= m_biasFactor; 579 #endif 548 580 } // if(limit) 549 581 } // if angular limit or powered … … 551 583 552 584 553 554 585 void btHingeConstraint::setFrames(const btTransform & frameA, const btTransform & frameB) 586 { 587 m_rbAFrame = frameA; 588 m_rbBFrame = frameB; 589 buildJacobian(); 590 } 555 591 556 592 … … 578 614 579 615 580 #if 0581 void btHingeConstraint::testLimit()582 {583 // Compute limit information584 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 #else606 607 616 608 617 void btHingeConstraint::testLimit(const btTransform& transA,const btTransform& transB) … … 610 619 // Compute limit information 611 620 m_hingeAngle = getHingeAngle(transA,transB); 621 #ifdef _BT_USE_CENTER_LIMIT_ 622 m_limit.test(m_hingeAngle); 623 #else 612 624 m_correction = btScalar(0.); 613 625 m_limitSign = btScalar(0.); … … 629 641 } 630 642 } 643 #endif 631 644 return; 632 645 } 633 #endif 646 634 647 635 648 static btVector3 vHinge(0, 0, btScalar(1)); … … 662 675 void btHingeConstraint::setMotorTarget(btScalar targetAngle, btScalar dt) 663 676 { 677 #ifdef _BT_USE_CENTER_LIMIT_ 678 m_limit.fit(targetAngle); 679 #else 664 680 if (m_lowerLimit < m_upperLimit) 665 681 { … … 669 685 targetAngle = m_upperLimit; 670 686 } 671 687 #endif 672 688 // compute angular velocity 673 689 btScalar curAngle = getHingeAngle(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform()); … … 840 856 if(getSolveLimit()) 841 857 { 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 844 865 } 845 866 // if the hinge has joint limits or motor, add in the extra row … … 905 926 } 906 927 // 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 907 931 btScalar bounce = m_relaxationFactor; 932 #endif 908 933 if(bounce > btScalar(0.0)) 909 934 { … … 935 960 } 936 961 } 962 #ifdef _BT_USE_CENTER_LIMIT_ 963 info->m_constraintError[srow] *= m_limit.getBiasFactor(); 964 #else 937 965 info->m_constraintError[srow] *= m_biasFactor; 966 #endif 938 967 } // if(limit) 939 968 } // if angular limit or powered -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btHingeConstraint.h
r8351 r8393 16 16 /* Hinge Constraint by Dirk Gregorius. Limits added by Marcus Hennix at Starbreeze Studios */ 17 17 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 20 23 21 24 #include "LinearMath/btVector3.h" … … 32 35 #define btHingeConstraintDataName "btHingeConstraintFloatData" 33 36 #endif //BT_USE_DOUBLE_PRECISION 37 34 38 35 39 … … 58 62 btScalar m_maxMotorImpulse; 59 63 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 60 73 btScalar m_limitSoftness; 61 74 btScalar m_biasFactor; 62 btScalar 63 64 b tScalar m_lowerLimit;65 btScalar m_upperLimit; 66 75 btScalar m_relaxationFactor; 76 77 bool m_solveLimit; 78 #endif 79 67 80 btScalar m_kHinge; 68 81 69 btScalar m_limitSign;70 btScalar m_correction;71 82 72 83 btScalar m_accLimitImpulse; 73 84 btScalar m_hingeAngle; 74 btScalar 85 btScalar m_referenceSign; 75 86 76 87 bool m_angularOnly; 77 88 bool m_enableAngularMotor; 78 bool m_solveLimit;79 89 bool m_useSolveConstraintObsolete; 80 90 bool m_useOffsetForConstraintFrame; … … 133 143 { 134 144 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); 136 158 137 159 void setAngularOnly(bool angularOnly) … … 158 180 void setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f) 159 181 { 182 #ifdef _BT_USE_CENTER_LIMIT_ 183 m_limit.set(low, high, _softness, _biasFactor, _relaxationFactor); 184 #else 160 185 m_lowerLimit = btNormalizeAngle(low); 161 186 m_upperLimit = btNormalizeAngle(high); 162 163 187 m_limitSoftness = _softness; 164 188 m_biasFactor = _biasFactor; 165 189 m_relaxationFactor = _relaxationFactor; 166 190 #endif 167 191 } 168 192 … … 183 207 btVector3 rbAxisB2 = axisInB.cross(rbAxisB1); 184 208 185 186 m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(pivotInA); 209 m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA)); 210 187 211 m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(), 188 212 rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(), 189 213 rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() ); 214 m_rbBFrame.getBasis() = m_rbB.getCenterOfMassTransform().getBasis().inverse() * m_rbBFrame.getBasis(); 215 190 216 } 191 217 192 218 btScalar getLowerLimit() const 193 219 { 194 return m_lowerLimit; 220 #ifdef _BT_USE_CENTER_LIMIT_ 221 return m_limit.getLow(); 222 #else 223 return m_lowerLimit; 224 #endif 195 225 } 196 226 197 227 btScalar getUpperLimit() const 198 228 { 199 return m_upperLimit; 229 #ifdef _BT_USE_CENTER_LIMIT_ 230 return m_limit.getHigh(); 231 #else 232 return m_upperLimit; 233 #endif 200 234 } 201 235 … … 216 250 inline int getSolveLimit() 217 251 { 218 return m_solveLimit; 252 #ifdef _BT_USE_CENTER_LIMIT_ 253 return m_limit.isLimit(); 254 #else 255 return m_solveLimit; 256 #endif 219 257 } 220 258 221 259 inline btScalar getLimitSign() 222 260 { 261 #ifdef _BT_USE_CENTER_LIMIT_ 262 return m_limit.getSign(); 263 #else 223 264 return m_limitSign; 265 #endif 224 266 } 225 267 … … 320 362 hingeData->m_motorTargetVelocity = float(m_motorTargetVelocity); 321 363 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 323 371 hingeData->m_lowerLimit = float(m_lowerLimit); 324 372 hingeData->m_upperLimit = float(m_upperLimit); … … 326 374 hingeData->m_biasFactor = float(m_biasFactor); 327 375 hingeData->m_relaxationFactor = float(m_relaxationFactor); 376 #endif 328 377 329 378 return btHingeConstraintDataName; 330 379 } 331 380 332 #endif // HINGECONSTRAINT_H381 #endif //BT_HINGECONSTRAINT_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btJacobianEntry.h
r8351 r8393 14 14 */ 15 15 16 #ifndef JACOBIAN_ENTRY_H17 #define JACOBIAN_ENTRY_H16 #ifndef BT_JACOBIAN_ENTRY_H 17 #define BT_JACOBIAN_ENTRY_H 18 18 19 19 #include "LinearMath/btVector3.h" … … 154 154 }; 155 155 156 #endif // JACOBIAN_ENTRY_H156 #endif //BT_JACOBIAN_ENTRY_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
r8351 r8393 14 14 */ 15 15 16 #ifndef POINT2POINTCONSTRAINT_H17 #define POINT2POINTCONSTRAINT_H16 #ifndef BT_POINT2POINTCONSTRAINT_H 17 #define BT_POINT2POINTCONSTRAINT_H 18 18 19 19 #include "LinearMath/btVector3.h" … … 159 159 } 160 160 161 #endif // POINT2POINTCONSTRAINT_H161 #endif //BT_POINT2POINTCONSTRAINT_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
r8351 r8393 49 49 #ifdef USE_SIMD 50 50 #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)) 52 static inline __m128 btSimdDot3( __m128 vec0, __m128 vec1 ) 53 53 { 54 54 __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 ) ) ); 56 56 } 57 57 #endif//USE_SIMD … … 65 65 __m128 upperLimit1 = _mm_set1_ps(c.m_upperLimit); 66 66 __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)); 69 69 deltaImpulse = _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv))); 70 70 deltaImpulse = _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv))); … … 128 128 __m128 upperLimit1 = _mm_set1_ps(c.m_upperLimit); 129 129 __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)); 132 132 deltaImpulse = _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv))); 133 133 deltaImpulse = _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv))); … … 216 216 __m128 upperLimit1 = _mm_set1_ps(c.m_upperLimit); 217 217 __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)); 220 220 deltaImpulse = _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv))); 221 221 deltaImpulse = _mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv))); … … 558 558 559 559 btScalar positionalError = 0.f; 560 positionalError = -penetration * infoGlobal.m_erp/infoGlobal.m_timeStep;561 560 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 562 571 btScalar penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv; 563 572 btScalar velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv; … … 780 789 btTypedConstraint* constraint = constraints[j]; 781 790 constraint->buildJacobian(); 791 constraint->internalSetAppliedImpulse(0.0f); 782 792 } 783 793 } … … 796 806 { 797 807 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 } 799 816 totalNumRows += info1.m_numConstraintRows; 800 817 } … … 817 834 818 835 819 820 836 btRigidBody& rbA = constraint->getRigidBodyA(); 821 837 btRigidBody& rbB = constraint->getRigidBodyB(); … … 826 842 { 827 843 memset(¤tConstraintRow[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; 830 846 currentConstraintRow[j].m_appliedImpulse = 0.f; 831 847 currentConstraintRow[j].m_appliedPushImpulse = 0.f; … … 860 876 constraints[i]->getInfo2(&info2); 861 877 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 862 890 ///finalize the constraint setup 863 891 for ( j=0;j<info1.m_numConstraintRows;j++) … … 1107 1135 int iteration; 1108 1136 { 1137 solveGroupCacheFriendlySplitImpulseIterations(bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc); 1138 1109 1139 for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++) 1110 1140 { … … 1112 1142 } 1113 1143 1114 solveGroupCacheFriendlySplitImpulseIterations(bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);1115 1144 } 1116 1145 return 0.f; … … 1143 1172 const btSolverConstraint& solverConstr = m_tmpSolverNonContactConstraintPool[j]; 1144 1173 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 } 1148 1179 } 1149 1180 -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
r8351 r8393 14 14 */ 15 15 16 #ifndef SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H17 #define SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H16 #ifndef BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H 17 #define BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H 18 18 19 19 #include "btConstraintSolver.h" … … 125 125 126 126 127 #endif // SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H127 #endif //BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H 128 128 -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSliderConstraint.h
r8351 r8393 23 23 */ 24 24 25 #ifndef SLIDER_CONSTRAINT_H26 #define SLIDER_CONSTRAINT_H25 #ifndef BT_SLIDER_CONSTRAINT_H 26 #define BT_SLIDER_CONSTRAINT_H 27 27 28 28 … … 237 237 void setMaxAngMotorForce(btScalar maxAngMotorForce) { m_maxAngMotorForce = maxAngMotorForce; } 238 238 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 240 243 241 244 … … 256 259 void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; } 257 260 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 258 270 ///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 259 271 ///If no axis is provided, it uses the default axis for this constraint. … … 318 330 319 331 320 #endif // SLIDER_CONSTRAINT_H321 332 #endif //BT_SLIDER_CONSTRAINT_H 333 -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h
r5781 r8393 14 14 */ 15 15 16 #ifndef SOLVE_2LINEAR_CONSTRAINT_H17 #define SOLVE_2LINEAR_CONSTRAINT_H16 #ifndef BT_SOLVE_2LINEAR_CONSTRAINT_H 17 #define BT_SOLVE_2LINEAR_CONSTRAINT_H 18 18 19 19 #include "LinearMath/btMatrix3x3.h" … … 105 105 }; 106 106 107 #endif // SOLVE_2LINEAR_CONSTRAINT_H107 #endif //BT_SOLVE_2LINEAR_CONSTRAINT_H -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
r8351 r8393 30 30 m_rbB(getFixedBody()), 31 31 m_appliedImpulse(btScalar(0.)), 32 m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE) 32 m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE), 33 m_breakingImpulseThreshold(SIMD_INFINITY), 34 m_isEnabled(true) 33 35 { 34 36 } … … 43 45 m_rbB(rbB), 44 46 m_appliedImpulse(btScalar(0.)), 45 m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE) 47 m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE), 48 m_breakingImpulseThreshold(SIMD_INFINITY), 49 m_isEnabled(true) 46 50 { 47 51 } … … 141 145 } 142 146 147 148 void 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 157 void 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 182 btScalar btAngularLimit::getError() const 183 { 184 return m_correction * m_sign; 185 } 186 187 void 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 206 btScalar btAngularLimit::getLow() const 207 { 208 return btNormalizeAngle(m_center - m_halfRange); 209 } 210 211 btScalar btAngularLimit::getHigh() const 212 { 213 return btNormalizeAngle(m_center + m_halfRange); 214 } -
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h
r8351 r8393 14 14 */ 15 15 16 #ifndef TYPED_CONSTRAINT_H17 #define TYPED_CONSTRAINT_H16 #ifndef BT_TYPED_CONSTRAINT_H 17 #define BT_TYPED_CONSTRAINT_H 18 18 19 19 class btRigidBody; 20 20 #include "LinearMath/btScalar.h" 21 21 #include "btSolverConstraint.h" 22 #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"23 22 24 23 class btSerializer; 25 24 25 //Don't change any of the existing enum values, so add enum types at the end for serialization compatibility 26 26 enum btTypedConstraintType 27 27 { 28 POINT2POINT_CONSTRAINT_TYPE= MAX_CONTACT_MANIFOLD_TYPE+1,28 POINT2POINT_CONSTRAINT_TYPE=3, 29 29 HINGE_CONSTRAINT_TYPE, 30 30 CONETWIST_CONSTRAINT_TYPE, 31 31 D6_CONSTRAINT_TYPE, 32 32 SLIDER_CONSTRAINT_TYPE, 33 CONTACT_CONSTRAINT_TYPE 33 CONTACT_CONSTRAINT_TYPE, 34 D6_SPRING_CONSTRAINT_TYPE, 35 MAX_CONSTRAINT_TYPE 34 36 }; 35 37 … … 60 62 void* m_userConstraintPtr; 61 63 }; 64 65 btScalar m_breakingImpulseThreshold; 66 bool m_isEnabled; 67 62 68 63 69 bool m_needsFeedback; … … 154 160 } 155 161 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 156 184 ///internal method used by the constraint solver, don't use them directly 157 185 virtual void solveConstraintObsolete(btRigidBody& /*bodyA*/,btRigidBody& /*bodyB*/,btScalar /*timeStep*/) {}; … … 312 340 313 341 314 315 #endif //TYPED_CONSTRAINT_H 342 class btAngularLimit 343 { 344 private: 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 357 public: 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 62 62 } 63 63 64 void 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 14 14 */ 15 15 16 #ifndef UNIVERSAL_CONSTRAINT_H17 #define UNIVERSAL_CONSTRAINT_H16 #ifndef BT_UNIVERSAL_CONSTRAINT_H 17 #define BT_UNIVERSAL_CONSTRAINT_H 18 18 19 19 … … 53 53 void setUpperLimit(btScalar ang1max, btScalar ang2max) { setAngularUpperLimit(btVector3(0.f, ang1max, ang2max)); } 54 54 void setLowerLimit(btScalar ang1min, btScalar ang2min) { setAngularLowerLimit(btVector3(0.f, ang1min, ang2min)); } 55 56 void setAxis( const btVector3& axis1, const btVector3& axis2); 55 57 }; 56 58 57 59 58 60 59 #endif // UNIVERSAL_CONSTRAINT_H61 #endif // BT_UNIVERSAL_CONSTRAINT_H 60 62 -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
r8351 r8393 36 36 #include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h" 37 37 #include "BulletDynamics/ConstraintSolver/btSliderConstraint.h" 38 #include "BulletDynamics/ConstraintSolver/btContactConstraint.h" 39 38 40 39 41 #include "LinearMath/btIDebugDraw.h" … … 46 48 47 49 #include "LinearMath/btSerializer.h" 50 51 #if 0 52 btAlignedObjectArray<btVector3> debugContacts; 53 btAlignedObjectArray<btVector3> debugNormals; 54 int startHit=2; 55 int firstHit=startHit; 56 #endif 48 57 49 58 … … 315 324 dispatchInfo.m_debugDraw = getDebugDrawer(); 316 325 326 317 327 ///perform collision detection 318 328 performDiscreteCollisionDetection(); 329 330 if (getDispatchInfo().m_useContinuous) 331 addSpeculativeContacts(timeStep); 332 319 333 320 334 calculateSimulationIslands(); … … 746 760 class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback 747 761 { 762 public: 763 748 764 btCollisionObject* m_me; 749 765 btScalar m_allowedPenetration; 750 766 btOverlappingPairCache* m_pairCache; 751 767 btDispatcher* m_dispatcher; 752 753 768 754 769 public: … … 798 813 if (m_dispatcher->needsResponse(m_me,otherObj)) 799 814 { 815 #if 0 800 816 ///don't do CCD when there are already contact points (touching contact/penetration) 801 817 btAlignedObjectArray<btPersistentManifold*> manifoldArray; … … 815 831 } 816 832 } 817 } 818 return true; 833 #endif 834 return true; 835 } 836 837 return false; 819 838 } 820 839 … … 825 844 int gNumClampedCcdMotions=0; 826 845 827 //#include "stdio.h"828 846 void btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep) 829 847 { … … 837 855 if (body->isActive() && (!body->isStaticOrKinematicObject())) 838 856 { 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 949 void 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 { 839 960 body->predictIntegratedTransform(timeStep, predictedTrans); 840 961 btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2(); … … 842 963 if (body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion) 843 964 { 844 BT_PROFILE(" CCD motion clamping");965 BT_PROFILE("search speculative contacts"); 845 966 if (body->getCollisionShape()->isConvex()) 846 967 { … … 853 974 sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup; 854 975 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); 857 981 if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f)) 858 982 { 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 } 863 1050 } 864 1051 } 865 1052 } 866 1053 867 body->proceedToTransform( predictedTrans);868 1054 } 869 1055 } … … 1010 1196 } 1011 1197 break; 1198 case D6_SPRING_CONSTRAINT_TYPE: 1012 1199 case D6_CONSTRAINT_TYPE: 1013 1200 { -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
r8351 r8393 63 63 virtual void integrateTransforms(btScalar timeStep); 64 64 65 virtual void addSpeculativeContacts(btScalar timeStep); 66 65 67 virtual void calculateSimulationIslands(); 66 68 -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btDynamicsWorld.h
r8351 r8393 33 33 BT_SIMPLE_DYNAMICS_WORLD=1, 34 34 BT_DISCRETE_DYNAMICS_WORLD=2, 35 BT_CONTINUOUS_DYNAMICS_WORLD=3 35 BT_CONTINUOUS_DYNAMICS_WORLD=3, 36 BT_SOFT_RIGID_DYNAMICS_WORLD=4 36 37 }; 37 38 … … 86 87 87 88 virtual void addRigidBody(btRigidBody* body) = 0; 89 90 virtual void addRigidBody(btRigidBody* body, short group, short mask) = 0; 88 91 89 92 virtual void removeRigidBody(btRigidBody* body) = 0; -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btRigidBody.cpp
r8351 r8393 52 52 m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)); 53 53 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 56 56 m_linearSleepingThreshold = constructionInfo.m_linearSleepingThreshold; 57 57 m_angularSleepingThreshold = constructionInfo.m_angularSleepingThreshold; … … 85 85 86 86 setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia); 87 setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);88 87 updateInertiaTensor(); 89 88 -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btRigidBody.h
r8351 r8393 14 14 */ 15 15 16 #ifndef RIGIDBODY_H17 #define RIGIDBODY_H16 #ifndef BT_RIGIDBODY_H 17 #define BT_RIGIDBODY_H 18 18 19 19 #include "LinearMath/btAlignedObjectArray.h" … … 90 90 91 91 int m_debugBodyId; 92 92 93 93 94 94 protected: … … 271 271 } 272 272 273 const btVector3& getTotalForce() 273 const btVector3& getTotalForce() const 274 274 { 275 275 return m_totalForce; 276 276 }; 277 277 278 const btVector3& getTotalTorque() 278 const btVector3& getTotalTorque() const 279 279 { 280 280 return m_totalTorque; … … 505 505 } 506 506 507 int getNumConstraintRefs() 507 int getNumConstraintRefs() const 508 508 { 509 509 return m_constraintRefs.size(); … … 618 618 619 619 void internalWritebackVelocity(btScalar timeStep); 620 620 621 621 622 … … 687 688 688 689 689 #endif 690 690 #endif //BT_RIGIDBODY_H 691 -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
r8351 r8393 79 79 infoGlobal.m_timeStep = timeStep; 80 80 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); 82 82 m_constraintSolver->allSolved(infoGlobal,m_debugDrawer, m_stackAlloc); 83 83 } … … 155 155 } 156 156 } 157 158 void 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 169 void btSimpleDynamicsWorld::debugDrawWorld() 170 { 171 172 } 173 174 void btSimpleDynamicsWorld::addAction(btActionInterface* action) 175 { 176 177 } 178 179 void btSimpleDynamicsWorld::removeAction(btActionInterface* action) 180 { 181 182 } 183 157 184 158 185 void btSimpleDynamicsWorld::updateAabbs() -
code/trunk/src/external/bullet/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h
r8351 r8393 57 57 virtual void addRigidBody(btRigidBody* body); 58 58 59 virtual void addRigidBody(btRigidBody* body, short group, short mask); 60 59 61 virtual void removeRigidBody(btRigidBody* body); 62 63 virtual void debugDrawWorld(); 64 65 virtual void addAction(btActionInterface* action); 66 67 virtual void removeAction(btActionInterface* action); 60 68 61 69 ///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 22 22 #include "LinearMath/btIDebugDraw.h" 23 23 #include "BulletDynamics/ConstraintSolver/btContactConstraint.h" 24 25 #define ROLLING_INFLUENCE_FIX 26 24 27 25 28 btRigidBody& btActionInterface::getFixedBody() … … 695 698 btVector3 sideImp = m_axle[wheel] * m_sideImpulse[wheel]; 696 699 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 697 704 rel_pos[m_indexUpAxis] *= wheelInfo.m_rollInfluence; 705 #endif 698 706 m_chassisBody->applyImpulse(sideImp,rel_pos); 699 707 -
code/trunk/src/external/bullet/BulletDynamics/Vehicle/btRaycastVehicle.h
r8351 r8393 9 9 * It is provided "as is" without express or implied warranty. 10 10 */ 11 #ifndef RAYCASTVEHICLE_H12 #define RAYCASTVEHICLE_H11 #ifndef BT_RAYCASTVEHICLE_H 12 #define BT_RAYCASTVEHICLE_H 13 13 14 14 #include "BulletDynamics/Dynamics/btRigidBody.h" … … 113 113 void updateWheelTransform( int wheelIndex, bool interpolatedTransform = true ); 114 114 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); 116 116 117 117 btWheelInfo& addWheel( const btVector3& connectionPointCS0, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS,btScalar suspensionRestLength,btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel); … … 233 233 234 234 235 #endif // RAYCASTVEHICLE_H236 235 #endif //BT_RAYCASTVEHICLE_H 236 -
code/trunk/src/external/bullet/BulletDynamics/Vehicle/btVehicleRaycaster.h
r5781 r8393 1 1 /* 2 * Copyright (c) 2005 Erwin Coumans http:// continuousphysics.com/Bullet/2 * Copyright (c) 2005 Erwin Coumans http://bulletphysics.org 3 3 * 4 4 * Permission to use, copy, modify, distribute and sell this software … … 9 9 * It is provided "as is" without express or implied warranty. 10 10 */ 11 #ifndef VEHICLE_RAYCASTER_H12 #define VEHICLE_RAYCASTER_H11 #ifndef BT_VEHICLE_RAYCASTER_H 12 #define BT_VEHICLE_RAYCASTER_H 13 13 14 14 #include "LinearMath/btVector3.h" … … 32 32 }; 33 33 34 #endif // VEHICLE_RAYCASTER_H34 #endif //BT_VEHICLE_RAYCASTER_H 35 35 -
code/trunk/src/external/bullet/BulletDynamics/Vehicle/btWheelInfo.h
r8351 r8393 9 9 * It is provided "as is" without express or implied warranty. 10 10 */ 11 #ifndef WHEEL_INFO_H12 #define WHEEL_INFO_H11 #ifndef BT_WHEEL_INFO_H 12 #define BT_WHEEL_INFO_H 13 13 14 14 #include "LinearMath/btVector3.h" … … 116 116 }; 117 117 118 #endif // WHEEL_INFO_H118 #endif //BT_WHEEL_INFO_H 119 119 -
code/trunk/src/external/bullet/CMakeLists.txt
r8351 r8393 31 31 NO_DLL_INTERFACE 32 32 VERSION 33 2.7 733 2.78 34 34 SOURCE_FILES 35 35 ${BULLET_FILES} -
code/trunk/src/external/bullet/ChangeLog
r8351 r8393 5 5 using http://tinyurl.com/yabmjjj 6 6 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 7 2011 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 12 14 2010 September 7 13 15 - autotools now uses CamelCase naming for libraryes just like cmake: -
code/trunk/src/external/bullet/LinearMath/CMakeLists.txt
r8351 r8393 4 4 btAlignedAllocator.cpp 5 5 btConvexHull.cpp 6 btConvexHullComputer.cpp 6 7 btGeometryUtil.cpp 7 8 btQuickprof.cpp … … 14 15 btAlignedObjectArray.h 15 16 btConvexHull.h 17 btConvexHullComputer.h 16 18 btDefaultMotionState.h 17 19 btGeometryUtil.h -
code/trunk/src/external/bullet/LinearMath/btAabbUtil2.h
r5781 r8393 15 15 16 16 17 #ifndef AABB_UTIL218 #define AABB_UTIL217 #ifndef BT_AABB_UTIL2 18 #define BT_AABB_UTIL2 19 19 20 20 #include "btTransform.h" … … 232 232 #endif //USE_BANCHLESS 233 233 234 #endif 235 236 234 #endif //BT_AABB_UTIL2 235 236 -
code/trunk/src/external/bullet/LinearMath/btAlignedObjectArray.h
r8351 r8393 407 407 { 408 408 int first = 0; 409 int last = size() ;409 int last = size()-1; 410 410 411 411 //assume sorted array -
code/trunk/src/external/bullet/LinearMath/btConvexHull.h
r8351 r8393 17 17 ///includes modifications/improvements by John Ratcliff, see BringOutYourDead below. 18 18 19 #ifndef CD_HULL_H20 #define CD_HULL_H19 #ifndef BT_CD_HULL_H 20 #define BT_CD_HULL_H 21 21 22 22 #include "btVector3.h" … … 238 238 239 239 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_H2 #define DEFAULT_MOTION_STATE_H1 #ifndef BT_DEFAULT_MOTION_STATE_H 2 #define BT_DEFAULT_MOTION_STATE_H 3 3 4 4 #include "btMotionState.h" … … 38 38 }; 39 39 40 #endif // DEFAULT_MOTION_STATE_H40 #endif //BT_DEFAULT_MOTION_STATE_H -
code/trunk/src/external/bullet/LinearMath/btHashMap.h
r8351 r8393 1 /* 2 Bullet Continuous Collision Detection and Physics Library 3 Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org 4 5 This software is provided 'as-is', without any express or implied warranty. 6 In no event will the authors be held liable for any damages arising from the use of this software. 7 Permission is granted to anyone to use this software for any purpose, 8 including commercial applications, and to alter it and redistribute it freely, 9 subject to the following restrictions: 10 11 1. 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. 12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 13 3. This notice may not be removed or altered from any source distribution. 14 */ 15 16 1 17 #ifndef BT_HASH_MAP_H 2 18 #define BT_HASH_MAP_H -
code/trunk/src/external/bullet/LinearMath/btIDebugDraw.h
r8351 r8393 15 15 16 16 17 #ifndef IDEBUG_DRAW__H18 #define IDEBUG_DRAW__H17 #ifndef BT_IDEBUG_DRAW__H 18 #define BT_IDEBUG_DRAW__H 19 19 20 20 #include "btVector3.h" … … 310 310 drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color); 311 311 } 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 } 312 413 }; 313 414 314 415 315 #endif // IDEBUG_DRAW__H316 416 #endif //BT_IDEBUG_DRAW__H 417 -
code/trunk/src/external/bullet/LinearMath/btList.h
r5781 r8393 15 15 16 16 17 #ifndef GEN_LIST_H18 #define GEN_LIST_H17 #ifndef BT_GEN_LIST_H 18 #define BT_GEN_LIST_H 19 19 20 20 class btGEN_Link { … … 68 68 }; 69 69 70 #endif 70 #endif //BT_GEN_LIST_H 71 71 72 72 -
code/trunk/src/external/bullet/LinearMath/btMatrix3x3.h
r8351 r8393 111 111 btMatrix3x3& operator*=(const btMatrix3x3& m); 112 112 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*/ 115 125 void setFromOpenGLSubMatrix(const btScalar *m) 116 126 { … … 209 219 } 210 220 211 /**@brief Fill the values of the matrix into a 9 element array221 /**@brief Fill the rotational part of an OpenGL matrix and clear the shear/perspective 212 222 * @param m The array to be filled */ 213 223 void getOpenGLSubMatrix(btScalar *m) const … … 524 534 } 525 535 536 SIMD_FORCE_INLINE btMatrix3x3& 537 btMatrix3x3::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 552 SIMD_FORCE_INLINE btMatrix3x3 553 operator*(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 562 operator+(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 576 SIMD_FORCE_INLINE btMatrix3x3 577 operator-(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 592 SIMD_FORCE_INLINE btMatrix3x3& 593 btMatrix3x3::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 526 609 SIMD_FORCE_INLINE btScalar 527 610 btMatrix3x3::determinant() const -
code/trunk/src/external/bullet/LinearMath/btMinMax.h
r8351 r8393 15 15 16 16 17 #ifndef GEN_MINMAX_H18 #define GEN_MINMAX_H17 #ifndef BT_GEN_MINMAX_H 18 #define BT_GEN_MINMAX_H 19 19 20 20 #include "LinearMath/btScalar.h" … … 69 69 } 70 70 71 #endif 71 #endif //BT_GEN_MINMAX_H -
code/trunk/src/external/bullet/LinearMath/btPoolAllocator.h
r8351 r8393 63 63 } 64 64 65 int getMaxCount() const 66 { 67 return m_maxElements; 68 } 69 65 70 void* allocate(int size) 66 71 { -
code/trunk/src/external/bullet/LinearMath/btQuadWord.h
r5781 r8393 14 14 15 15 16 #ifndef SIMD_QUADWORD_H17 #define SIMD_QUADWORD_H16 #ifndef BT_SIMD_QUADWORD_H 17 #define BT_SIMD_QUADWORD_H 18 18 19 19 #include "btScalar.h" … … 178 178 }; 179 179 180 #endif // SIMD_QUADWORD_H180 #endif //BT_SIMD_QUADWORD_H -
code/trunk/src/external/bullet/LinearMath/btQuaternion.h
r8351 r8393 15 15 16 16 17 #ifndef SIMD__QUATERNION_H_18 #define SIMD__QUATERNION_H_17 #ifndef BT_SIMD__QUATERNION_H_ 18 #define BT_SIMD__QUATERNION_H_ 19 19 20 20 … … 427 427 } 428 428 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 13 13 14 14 15 #ifndef QUICK_PROF_H16 #define QUICK_PROF_H15 #ifndef BT_QUICK_PROF_H 16 #define BT_QUICK_PROF_H 17 17 18 18 //To disable built-in profiling, please comment out next line … … 192 192 193 193 194 #endif // QUICK_PROF_H194 #endif //BT_QUICK_PROF_H 195 195 196 196 -
code/trunk/src/external/bullet/LinearMath/btRandom.h
r5781 r8393 15 15 16 16 17 #ifndef GEN_RANDOM_H18 #define GEN_RANDOM_H17 #ifndef BT_GEN_RANDOM_H 18 #define BT_GEN_RANDOM_H 19 19 20 20 #ifdef MT19937 … … 39 39 #endif 40 40 41 #endif 41 #endif //BT_GEN_RANDOM_H 42 42 -
code/trunk/src/external/bullet/LinearMath/btScalar.h
r8351 r8393 15 15 16 16 17 #ifndef SIMD___SCALAR_H18 #define SIMD___SCALAR_H17 #ifndef BT_SCALAR_H 18 #define BT_SCALAR_H 19 19 20 20 #ifdef BT_MANAGED_CODE … … 26 26 #include <math.h> 27 27 #include <stdlib.h>//size_t for MSVC 6.0 28 #include <cstdlib>29 #include <cfloat>30 28 #include <float.h> 31 29 32 30 /* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/ 33 #define BT_BULLET_VERSION 27 731 #define BT_BULLET_VERSION 278 34 32 35 33 inline int btGetVersion() … … 287 285 SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return expf(x); } 288 286 SIMD_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 287 SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); } 294 288 SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmodf(x,y); } 295 289 … … 526 520 } 527 521 }; 528 #endif // SIMD___SCALAR_H522 #endif //BT_SCALAR_H -
code/trunk/src/external/bullet/LinearMath/btSerializer.cpp
r8351 r8393 1 unsigned char sBulletDNAstr 64[]= {2 83,68,78,65,78,65,77,69, -79,0,0,0,109,95,115,105,122,101,0,109,1 unsigned char sBulletDNAstr[]= { 2 83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109, 3 3 95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95, 4 4 99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111, … … 41 41 97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0, 42 42 109,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, 43 97,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101, 44 114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115, 45 51,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51, 46 105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101, 47 115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117, 48 109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116, 49 105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114, 50 0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104, 51 80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99, 52 101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66, 53 118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108, 54 101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111, 55 77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109, 56 101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115, 57 102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109, 58 95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104, 59 105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104, 60 97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97, 61 112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115, 62 0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101, 63 100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86, 64 50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108, 65 101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118, 66 97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65, 67 114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105, 68 108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0, 69 109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111, 70 108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114, 71 101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114, 72 101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95, 73 104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86, 74 97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105, 75 109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99, 76 97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42, 77 109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98, 78 108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80, 79 111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0, 80 42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0, 81 42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109, 82 95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0, 83 109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105, 84 110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97, 85 110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105, 86 111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105, 87 110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86, 88 101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105, 89 99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80, 90 114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109, 91 95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95, 92 102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105, 93 111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99, 94 99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0, 95 109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100, 96 0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105, 97 99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97, 98 103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111, 99 109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105, 100 111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84, 101 121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105, 102 116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116, 103 68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110, 104 115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108, 105 111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99, 106 105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0, 107 109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97, 108 118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108, 109 101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97, 110 76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109, 111 95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114, 112 115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105, 113 110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0, 114 109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70, 115 97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105, 116 110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100, 117 83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117, 118 108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83, 119 113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108, 120 97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105, 121 110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108, 122 100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84, 123 104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97, 124 108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114, 125 97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0, 126 42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0, 127 109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101, 128 0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0, 129 109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112, 130 112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114, 131 97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108, 132 105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66, 133 111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121, 134 112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112, 135 105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109, 136 95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101, 137 0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101, 138 65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110, 139 97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109, 140 111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109, 141 95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108, 142 111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109, 143 105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109, 144 95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97, 145 116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112, 146 97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116, 147 119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109, 148 95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95, 149 108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97, 150 110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97, 151 110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117, 152 115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97, 153 109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111, 154 110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102, 155 68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100, 156 91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105, 157 110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110, 158 101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105, 159 110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110, 160 101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101, 161 115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115, 162 0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116, 163 105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105, 164 111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117, 165 109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97, 166 108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95, 167 110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115, 168 116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109, 169 95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101, 170 115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100, 171 101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111, 172 108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0, 173 109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105, 174 100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95, 175 97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116, 176 101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114, 177 101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121, 178 110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101, 179 77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116, 180 72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111, 181 110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116, 182 67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110, 183 99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82, 184 105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0, 185 109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114, 186 72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67, 187 108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102, 188 116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101, 189 83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67, 190 108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109, 191 95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117, 192 108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101, 193 0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99, 194 105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105, 195 116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105, 196 102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116, 197 101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109, 198 95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42, 199 109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104, 200 116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95, 201 110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0, 202 109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114, 203 109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95, 204 118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117, 205 108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109, 206 95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110, 207 100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117, 208 109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101, 209 115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97, 210 115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108, 211 115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110, 212 100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109, 213 95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103, 214 0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73, 215 109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105, 216 111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111, 217 110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105, 218 100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109, 219 95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101, 220 102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95, 221 115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108, 222 80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116, 223 121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111, 224 105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95, 225 109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42, 226 109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95, 227 116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114, 228 115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105, 229 110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109, 230 95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115, 231 0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110, 232 117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116, 233 101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111, 234 110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114, 235 0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0, 236 105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116, 237 0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114, 238 65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101, 239 109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51, 240 70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68, 241 111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120, 242 51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51, 243 120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115, 244 102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110, 245 115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118, 246 104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79, 247 112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116, 165 248 68,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, 249 111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110, 250 116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81, 251 117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97, 252 0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108, 253 101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97, 254 112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101, 255 83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110, 256 116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111, 257 115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117, 258 108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98, 259 116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114, 260 116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114, 261 116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97, 262 0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68, 263 97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98, 264 116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97, 265 99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115, 266 104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108, 267 101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101, 268 100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97, 269 116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104, 270 105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104, 271 97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104, 272 97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97, 273 112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102, 274 111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83, 275 104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108, 276 108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105, 277 111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98, 278 116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97, 279 116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111, 280 97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111, 281 117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110, 282 116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114, 283 97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121, 284 68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111, 285 110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116, 286 80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110, 287 116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67, 288 111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0, 289 98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111, 290 97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111, 291 110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114, 292 105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97, 293 0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103, 294 67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105, 295 100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111, 296 102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83, 297 111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116, 298 66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100, 299 121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101, 300 116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99, 301 104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102, 302 105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68, 303 97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68, 304 97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68, 305 97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68, 306 97,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0, 307 4,0,4,0,8,0,0,0,12,0,36,0,8,0,16,0,32,0,48,0, 308 96,0,64,0,-128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0, 309 52,0,52,0,20,0,64,0,4,0,4,0,8,0,4,0,32,0,28,0, 310 60,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, 313 92,0,104,0,-64,0,92,1,104,0,-92,1,83,84,82,67,61,0,0,0, 314 10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0, 315 10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0, 316 9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0, 317 15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0, 318 15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0, 319 19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0, 320 20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0, 321 4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0, 322 4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0, 323 2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0, 324 13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0, 325 4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0, 326 4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0, 327 4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0, 328 22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0, 329 0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0, 330 13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0, 331 25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0, 332 28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0, 333 28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0, 334 31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0, 335 0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0, 336 13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0, 337 31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0, 338 13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0, 339 35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0, 340 0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0, 341 17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0, 342 25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0, 343 27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0, 344 4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0, 345 7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0, 346 43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0, 347 7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0, 348 4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0, 349 13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0, 350 13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0, 351 9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0, 352 18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0, 353 8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0, 354 8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0, 355 4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0, 356 9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0, 357 17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0, 358 7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0, 359 7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0, 360 4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0, 361 15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0, 362 13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0, 363 7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0, 364 7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0, 365 49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0, 366 14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0, 367 14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0, 368 8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0, 369 8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0, 370 4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0, 371 4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0, 372 7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0, 373 13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0, 374 14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0, 375 4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0, 376 7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0, 377 56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0, 378 4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0, 379 7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0, 380 51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0, 381 7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0, 382 0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0, 383 13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0, 384 4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0, 385 7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0, 386 17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0, 387 4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0, 388 7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0, 389 13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0, 390 7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0, 391 4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0, 392 61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0, 393 61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0, 394 4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0, 395 52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0, 396 7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0, 397 7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0, 398 7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0, 399 7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0, 400 4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0, 401 68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0, 402 13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0, 403 4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0, 404 15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0, 405 13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0, 406 4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1, 407 4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1, 408 7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1, 409 4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1, 410 7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1, 411 4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0, 412 47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1, 413 64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1, 414 4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1, 415 4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,}; 416 int sBulletDNAlen= sizeof(sBulletDNAstr); 417 unsigned char sBulletDNAstr64[]= { 418 83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109, 292 419 95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95, 293 420 99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111, … … 330 457 97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0, 331 458 109,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, 459 97,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101, 460 114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115, 461 51,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51, 462 105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101, 463 115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117, 464 109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116, 465 105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114, 466 0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104, 467 80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99, 468 101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66, 469 118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108, 470 101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111, 471 77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109, 472 101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115, 473 102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109, 474 95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104, 475 105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104, 476 97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97, 477 112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115, 478 0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101, 479 100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86, 480 50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108, 481 101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118, 482 97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65, 483 114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105, 484 108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0, 485 109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111, 486 108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114, 487 101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114, 488 101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95, 489 104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86, 490 97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105, 491 109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99, 492 97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42, 493 109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98, 494 108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80, 495 111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0, 496 42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0, 497 42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109, 498 95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0, 499 109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105, 500 110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97, 501 110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105, 502 111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105, 503 110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86, 504 101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105, 505 99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80, 506 114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109, 507 95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95, 508 102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105, 509 111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99, 510 99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0, 511 109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100, 512 0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105, 513 99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97, 514 103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111, 515 109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105, 516 111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84, 517 121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105, 518 116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116, 519 68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110, 520 115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108, 521 111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99, 522 105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0, 523 109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97, 524 118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108, 525 101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97, 526 76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109, 527 95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114, 528 115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105, 529 110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0, 530 109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70, 531 97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105, 532 110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100, 533 83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117, 534 108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83, 535 113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108, 536 97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105, 537 110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108, 538 100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84, 539 104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97, 540 108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114, 541 97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0, 542 42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0, 543 109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101, 544 0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0, 545 109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112, 546 112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114, 547 97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108, 548 105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66, 549 111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121, 550 112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112, 551 105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109, 552 95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101, 553 0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101, 554 65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110, 555 97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109, 556 111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109, 557 95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108, 558 111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109, 559 105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109, 560 95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97, 561 116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112, 562 97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116, 563 119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109, 564 95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95, 565 108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97, 566 110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97, 567 110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117, 568 115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97, 569 109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111, 570 110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102, 571 68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100, 572 91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105, 573 110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110, 574 101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105, 575 110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110, 576 101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101, 577 115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115, 578 0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116, 579 105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105, 580 111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117, 581 109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97, 582 108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95, 583 110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115, 584 116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109, 585 95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101, 586 115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100, 587 101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111, 588 108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0, 589 109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105, 590 100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95, 591 97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116, 592 101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114, 593 101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121, 594 110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101, 595 77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116, 596 72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111, 597 110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116, 598 67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110, 599 99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82, 600 105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0, 601 109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114, 602 72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67, 603 108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102, 604 116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101, 605 83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67, 606 108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109, 607 95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117, 608 108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101, 609 0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99, 610 105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105, 611 116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105, 612 102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116, 613 101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109, 614 95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42, 615 109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104, 616 116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95, 617 110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0, 618 109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114, 619 109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95, 620 118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117, 621 108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109, 622 95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110, 623 100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117, 624 109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101, 625 115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97, 626 115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108, 627 115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110, 628 100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109, 629 95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103, 630 0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73, 631 109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105, 632 111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111, 633 110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105, 634 100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109, 635 95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101, 636 102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95, 637 115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108, 638 80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116, 639 121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111, 640 105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95, 641 109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42, 642 109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95, 643 116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114, 644 115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105, 645 110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109, 646 95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115, 647 0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110, 648 117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116, 649 101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111, 650 110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114, 651 0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0, 652 105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116, 653 0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114, 654 65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101, 655 109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51, 656 70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68, 657 111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120, 658 51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51, 659 120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115, 660 102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110, 661 115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118, 662 104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79, 663 112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116, 454 664 68,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); 665 111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110, 666 116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81, 667 117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97, 668 0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108, 669 101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97, 670 112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101, 671 83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110, 672 116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111, 673 115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117, 674 108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98, 675 116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114, 676 116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114, 677 116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97, 678 0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68, 679 97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98, 680 116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97, 681 99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115, 682 104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108, 683 101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101, 684 100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97, 685 116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104, 686 105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104, 687 97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104, 688 97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97, 689 112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102, 690 111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83, 691 104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108, 692 108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105, 693 111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98, 694 116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97, 695 116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111, 696 97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111, 697 117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110, 698 116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114, 699 97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121, 700 68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111, 701 110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116, 702 80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110, 703 116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67, 704 111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0, 705 98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111, 706 97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111, 707 110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114, 708 105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97, 709 0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103, 710 67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105, 711 100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111, 712 102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83, 713 111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116, 714 66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100, 715 121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101, 716 116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99, 717 104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102, 718 105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68, 719 97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68, 720 97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68, 721 97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68, 722 97,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0, 723 4,0,4,0,8,0,0,0,16,0,48,0,16,0,16,0,32,0,48,0, 724 96,0,64,0,-128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0, 725 56,0,56,0,20,0,72,0,4,0,4,0,8,0,4,0,56,0,32,0, 726 80,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, 729 96,0,104,0,-56,0,104,1,112,0,-40,1,83,84,82,67,61,0,0,0, 730 10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0, 731 10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0, 732 9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0, 733 15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0, 734 15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0, 735 19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0, 736 20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0, 737 4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0, 738 4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0, 739 2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0, 740 13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0, 741 4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0, 742 4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0, 743 4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0, 744 22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0, 745 0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0, 746 13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0, 747 25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0, 748 28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0, 749 28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0, 750 31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0, 751 0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0, 752 13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0, 753 31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0, 754 13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0, 755 35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0, 756 0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0, 757 17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0, 758 25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0, 759 27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0, 760 4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0, 761 7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0, 762 43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0, 763 7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0, 764 4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0, 765 13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0, 766 13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0, 767 9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0, 768 18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0, 769 8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0, 770 8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0, 771 4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0, 772 9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0, 773 17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0, 774 7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0, 775 7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0, 776 4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0, 777 15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0, 778 13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0, 779 7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0, 780 7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0, 781 49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0, 782 14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0, 783 14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0, 784 8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0, 785 8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0, 786 4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0, 787 4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0, 788 7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0, 789 13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0, 790 14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0, 791 4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0, 792 7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0, 793 56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0, 794 4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0, 795 7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0, 796 51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0, 797 7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0, 798 0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0, 799 13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0, 800 4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0, 801 7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0, 802 17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0, 803 4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0, 804 7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0, 805 13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0, 806 7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0, 807 4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0, 808 61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0, 809 61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0, 810 4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0, 811 52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0, 812 7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0, 813 7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0, 814 7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0, 815 7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0, 816 4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0, 817 68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0, 818 13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0, 819 4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0, 820 15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0, 821 13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0, 822 4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1, 823 4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1, 824 7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1, 825 4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1, 826 7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1, 827 4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0, 828 47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1, 829 64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1, 830 4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1, 831 4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,}; 832 int sBulletDNAlen64= sizeof(sBulletDNAstr64); -
code/trunk/src/external/bullet/LinearMath/btSerializer.h
r8351 r8393 112 112 #endif 113 113 114 #define BT_SOFTBODY_CODE MAKE_ID('S','B','D','Y') 114 115 #define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J') 115 116 #define BT_RIGIDBODY_CODE MAKE_ID('R','B','D','Y') … … 120 121 #define BT_SHAPE_CODE MAKE_ID('S','H','A','P') 121 122 #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') 122 125 #define BT_DNA_CODE MAKE_ID('D','N','A','1') 123 124 126 125 127 … … 133 135 }; 134 136 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. 136 139 class btDefaultSerializer : public btSerializer 137 140 { … … 372 375 373 376 374 btDefaultSerializer(int totalSize )377 btDefaultSerializer(int totalSize=0) 375 378 :m_totalSize(totalSize), 376 379 m_currentSize(0), … … 379 382 m_serializationFlags(0) 380 383 { 381 m_buffer = (unsigned char*)btAlignedAlloc(totalSize, 16);384 m_buffer = m_totalSize?(unsigned char*)btAlignedAlloc(totalSize,16):0; 382 385 383 386 const bool VOID_IS_8 = ((sizeof(void*)==8)); … … 420 423 } 421 424 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 427 428 428 429 #ifdef BT_USE_DOUBLE_PRECISION 429 memcpy( m_buffer, "BULLETd", 7);430 memcpy(buffer, "BULLETd", 7); 430 431 #else 431 memcpy( m_buffer, "BULLETf", 7);432 memcpy(buffer, "BULLETf", 7); 432 433 #endif //BT_USE_DOUBLE_PRECISION 433 434 … … 437 438 if (sizeof(void*)==8) 438 439 { 439 m_buffer[7] = '-';440 buffer[7] = '-'; 440 441 } else 441 442 { 442 m_buffer[7] = '_';443 buffer[7] = '_'; 443 444 } 444 445 445 446 if (littleEndian) 446 447 { 447 m_buffer[8]='v';448 buffer[8]='v'; 448 449 } else 449 450 { 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 } 458 469 459 470 } … … 463 474 writeDNA(); 464 475 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 } 465 499 466 500 mTypes.clear(); … … 472 506 m_nameMap.clear(); 473 507 m_uniquePointers.clear(); 508 m_chunkPtrs.clear(); 474 509 } 475 510 … … 523 558 524 559 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 } 525 576 526 577 … … 529 580 { 530 581 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)); 534 583 535 584 unsigned char* data = ptr + sizeof(btChunk); -
code/trunk/src/external/bullet/LinearMath/btTransform.h
r8351 r8393 15 15 16 16 17 #ifndef btTransform_H18 #define btTransform_H17 #ifndef BT_TRANSFORM_H 18 #define BT_TRANSFORM_H 19 19 20 20 … … 299 299 300 300 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 14 14 15 15 16 #ifndef SIMD_TRANSFORM_UTIL_H17 #define SIMD_TRANSFORM_UTIL_H16 #ifndef BT_TRANSFORM_UTIL_H 17 #define BT_TRANSFORM_UTIL_H 18 18 19 19 #include "btTransform.h" … … 225 225 226 226 227 #endif // SIMD_TRANSFORM_UTIL_H228 227 #endif //BT_TRANSFORM_UTIL_H 228 -
code/trunk/src/external/bullet/LinearMath/btVector3.h
r8351 r8393 15 15 16 16 17 #ifndef SIMD__VECTOR3_H18 #define SIMD__VECTOR3_H17 #ifndef BT_VECTOR3_H 18 #define BT_VECTOR3_H 19 19 20 20 … … 764 764 765 765 766 #endif // SIMD__VECTOR3_H766 #endif //BT_VECTOR3_H -
code/trunk/src/external/bullet/VERSION
r8351 r8393 1 2.7 71 2.78 -
code/trunk/src/external/bullet/btBulletCollisionCommon.h
r8351 r8393 34 34 #include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h" 35 35 #include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" 36 #include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h" 36 37 #include "BulletCollision/CollisionShapes/btTriangleMeshShape.h" 37 38 #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.