Skip to content

Instantly share code, notes, and snippets.

@andrewseidl
Created April 29, 2015 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewseidl/5ad3b592675465a4b569 to your computer and use it in GitHub Desktop.
Save andrewseidl/5ad3b592675465a4b569 to your computer and use it in GitHub Desktop.
Chrono/Bullet differences
Only in bullet-real: btBulletDynamicsCommon.h
Only in bullet-real: Bullet-C-Api.h
diff -r bullet-real/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h bullet-chrono/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
51a52
> BARREL_SHAPE_PROXYTYPE, //***ALEX***
60a62,64
> // for 2d collision between polylines:
> ARC_SHAPE_PROXYTYPE, //***ALEX***
> SEGMENT_SHAPE_PROXYTYPE, //***ALEX***
diff -r bullet-real/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h bullet-chrono/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
32c32
< #define DBVT_BP_MARGIN (btScalar)0.05
---
> //#define DBVT_BP_MARGIN (btScalar)0.05 //***ALEX*** NO MARGIN
Only in bullet-real/BulletCollision: CMakeLists.txt
diff -r bullet-real/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp bullet-chrono/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
16c16
<
---
> #include <stdio.h>
85c85
<
---
>
87c87
<
---
>
diff -r bullet-real/BulletCollision/CollisionDispatch/btCollisionWorld.cpp bullet-chrono/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
15c15
<
---
> #include "core/ChLog.h"
143c143
<
---
>
150,151c150,151
< minAabb -= contactThreshold;
< maxAabb += contactThreshold;
---
> //minAabb -= contactThreshold; ***ALEX*** not needed because in C::E the margin also includes the contact breaking layer
> //maxAabb += contactThreshold; ***ALEX*** not needed because in C::E the margin also includes the contact breaking layer
Only in bullet-chrono/BulletCollision/CollisionShapes: bt2DShape.cpp
Only in bullet-chrono/BulletCollision/CollisionShapes: bt2DShape.h
Only in bullet-chrono/BulletCollision/CollisionShapes: btBarrelShape.cpp
Only in bullet-chrono/BulletCollision/CollisionShapes: btBarrelShape.h
diff -r bullet-real/BulletCollision/CollisionShapes/btCollisionShape.cpp bullet-chrono/BulletCollision/CollisionShapes/btCollisionShape.cpp
47c47,51
< return getAngularMotionDisc() * defaultContactThreshold;
---
> // return getAngularMotionDisc() * defaultContactThreshold; // <-- original!
> //return 0.001; // <-- ***ALEX***TEST: fixed and small, for small objects
> //return getAngularMotionDisc() * getMargin()*0.2; //***ALEX*** modified because defaultContactThreshold is zero in C::E, with inward breaking threshold
> //return 0.001+ getAngularMotionDisc() * getMargin()*0.2; //***ALEX*** hybryd!
> return 0.3*getMargin(); //***ALEX*** fixed to be comparable to margin
Only in bullet-real/BulletCollision: Gimpact
Only in bullet-real/BulletCollision: ibmsdk
Only in bullet-chrono/BulletCollision: Jamfile
diff -r bullet-real/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h bullet-chrono/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
51a52
> reactions_cache[0]=reactions_cache[1]=reactions_cache[2]=reactions_cache[3]=reactions_cache[4]=reactions_cache[5]=0; //***ALEX***
73a75
> /* ***ALEX***
76a79,80
> */
> reactions_cache[0]=reactions_cache[1]=reactions_cache[2]=reactions_cache[3]=reactions_cache[4]=reactions_cache[5]=0; //***ALEX***
79c83
<
---
> float reactions_cache[6]; //***ALEX*** cache here the three multipliers N,U,V for warm starting the NCP solver.
116c120
< PfxConstraintRow mConstraintRow[3];
---
> // PfxConstraintRow mConstraintRow[3]; ***ALEX*** remove to save RAM
diff -r bullet-real/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp bullet-chrono/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
20,21c20
<
< btScalar gContactBreakingThreshold = btScalar(0.02);
---
> btScalar gContactBreakingThreshold = btScalar(0.004); //***ALEX***, 0.004, original 0.02, warning: do not set too low or you get troubles with aabb
53a53,54
> pt.reactions_cache[0]=pt.reactions_cache[1]=pt.reactions_cache[2]=0; //***ALEX***
> pt.reactions_cache[3]=pt.reactions_cache[4]=pt.reactions_cache[5]=0; //***ALEX***
diff -r bullet-real/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h bullet-chrono/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
148a149
> /* ***ALEX***
152c153
<
---
> */
157a159,165
>
> m_pointCache[lastUsedIndex].reactions_cache[0] = 0; //***ALEX***
> m_pointCache[lastUsedIndex].reactions_cache[1] = 0;
> m_pointCache[lastUsedIndex].reactions_cache[2] = 0;
> m_pointCache[lastUsedIndex].reactions_cache[3] = 0;
> m_pointCache[lastUsedIndex].reactions_cache[4] = 0;
> m_pointCache[lastUsedIndex].reactions_cache[5] = 0;
169a178
> /* ***ALEX***
172a182
> */
179a190,196
> float mx = m_pointCache[insertIndex].reactions_cache[0]; //***ALEX***
> float my = m_pointCache[insertIndex].reactions_cache[1];
> float mz = m_pointCache[insertIndex].reactions_cache[2];
> float mf = m_pointCache[insertIndex].reactions_cache[3];
> float mg = m_pointCache[insertIndex].reactions_cache[4];
> float mh = m_pointCache[insertIndex].reactions_cache[5];
>
181a199,205
> m_pointCache[insertIndex].reactions_cache[0] = mx; //***ALEX***
> m_pointCache[insertIndex].reactions_cache[1] = my;
> m_pointCache[insertIndex].reactions_cache[2] = mz;
> m_pointCache[insertIndex].reactions_cache[3] = mf;
> m_pointCache[insertIndex].reactions_cache[4] = mg;
> m_pointCache[insertIndex].reactions_cache[5] = mh;
>
182a207,208
>
> /* ***ALEX***
190c216
<
---
> */
Only in bullet-real: BulletDynamics
Only in bullet-chrono: BulletFileLoader
Only in bullet-real: BulletMultiThreaded
Only in bullet-real: BulletSoftBody
Only in bullet-chrono: BulletWorldImporter
Only in bullet-real: CMakeLists.txt
Only in bullet-real: ibmsdk
Only in bullet-chrono/LinearMath: .btAlignedAllocator.cpp.swp
diff -r bullet-real/LinearMath/btConvexHull.cpp bullet-chrono/LinearMath/btConvexHull.cpp
489c489
< int4 HullLibrary::FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow)
---
> bt_int4 HullLibrary::FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow)
497c497
< return int4(-1,-1,-1,-1);
---
> return bt_int4(-1,-1,-1,-1);
513c513
< return int4(-1,-1,-1,-1);
---
> return bt_int4(-1,-1,-1,-1);
519c519
< return int4(-1,-1,-1,-1);
---
> return bt_int4(-1,-1,-1,-1);
522c522
< return int4(p0,p1,p2,p3);
---
> return bt_int4(p0,p1,p2,p3);
547c547
< int4 p = FindSimplex(verts,verts_count,allow);
---
> bt_int4 p = FindSimplex(verts,verts_count,allow);
diff -r bullet-real/LinearMath/btConvexHull.h bullet-chrono/LinearMath/btConvexHull.h
151c151
< class int4
---
> class bt_int4
155,156c155,156
< int4(){};
< int4(int _x,int _y, int _z,int _w){x=_x;y=_y;z=_z;w=_w;}
---
> bt_int4(){};
> bt_int4(int _x,int _y, int _z,int _w){x=_x;y=_y;z=_z;w=_w;}
216c216
< int4 FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow);
---
> bt_int4 FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow);
diff -r bullet-real/LinearMath/btQuickprof.cpp bullet-chrono/LinearMath/btQuickprof.cpp
34c34
< #if defined(WIN32) || defined(_WIN32)
---
> #if defined(_WIN32)
diff -r bullet-real/LinearMath/btScalar.h bullet-chrono/LinearMath/btScalar.h
107c107
< #define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
---
> #define btAssert(x) {if(!(x)){printf("Assert " __FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
diff -r bullet-real/LinearMath/btVector3.h bullet-chrono/LinearMath/btVector3.h
496c496
< // wAxis must be a unit lenght vector
---
> // wAxis must be a unit length vector
Only in bullet-real/LinearMath: CMakeLists.txt
Only in bullet-real/LinearMath: ibmsdk
Only in bullet-chrono/LinearMath: Jamfile
Only in bullet-real: Makefile.am
Only in bullet-real: MiniCL
Only in bullet-real: vectormath
  • grep * -r -e "btScalar lastLambda" introduced: df9230327cbac30c05132c128fa9df47d5c9cd57

  • grep * -r -e "btVector3\s*m_closestPointOnSimplex" introduced: 6f281704226ec544d6258a1ba4b5418f4d05ca99

  • grep * -r -e 'btAssert(m_numVertices>0);' introduced: 7a2a98078a8cbd5f8e201e584f1b22f1fd15ea77

  • grep * -r -e 'm_lastW = btVector3(btScalar(BT_LARGE_FLOAT),' introduced: badf7232575428a8f0d700e0bbcee1ae7479884e

  • grep * -r -e 'virtual void setShapeIdentifiersA(int' | grep btPointCollector.h introduced: d67aa861f2456e2c40980c11a02b41b026969cf6

  • grep * -r -e 'btBroadphaseRayCallback : public btBroadphaseAabbCallback' introduced: bb8d1b11df1b6588d808b9fd79c87cca5a9a4cf9

  • grep * -r -e 'childShape = compoundShape->getChildShape' | grep -v 'btCollisionShape*' introduced: 0fbd9d49c442428e1f58213de29adfd863e28530

  • grep * -r -e "[[:space:]]#define USE_PATH_COMPRESSION 1" introduced: f5e6f8742717ef6aef798213622533ad5ea44bb6

  • grep * -r -e 'CO_RIGID_BODY=2' introduced: 844a54a409ebfb772851f46adbf9fd2178b53e6d

  • grep * -r -e 'const btScalar result = m_userCallback->addSingleResult' introduced: 9086c15e490635b54ae3045dfa3879760c82c48b

  • grep * -r -e 'SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle ) const' introduced: 318e0d74dc643f5ab6398911343ee43d16f22469

  • grep * -r -e '#if defined (BT_HAS_ALIGNED_ALLOCATOR) ||' introduced: 41314b5ebc1bbdc34bd39406105e9e2b96f7a588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment