Changeset 1972 for code/branches/physics/src/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
- Timestamp:
- Oct 20, 2008, 5:40:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
r1963 r1972 32 32 33 33 #if DBVT_BP_PROFILE 34 #define DBVT_BP_PROFILING_RATE 25635 #include "LinearMath/btQuickprof.h"34 #define DBVT_BP_PROFILING_RATE 256 35 #include "LinearMath/btQuickprof.h" 36 36 #endif 37 37 … … 41 41 struct btDbvtProxy : btBroadphaseProxy 42 42 { 43 44 //btDbvtAabbMm aabb;45 46 47 48 49 btDbvtProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :50 btBroadphaseProxy( aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask)43 /* Fields */ 44 btDbvtAabbMm aabb; 45 btDbvtNode* leaf; 46 btDbvtProxy* links[2]; 47 int stage; 48 /* ctor */ 49 btDbvtProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) : 50 btBroadphaseProxy(userPtr,collisionFilterGroup,collisionFilterMask) 51 51 { 52 52 links[0]=links[1]=0; 53 53 } 54 54 }; … … 61 61 struct btDbvtBroadphase : btBroadphaseInterface 62 62 { 63 64 63 /* Config */ 64 enum { 65 65 DYNAMIC_SET = 0, /* Dynamic set index */ 66 66 FIXED_SET = 1, /* Fixed set index */ 67 67 STAGECOUNT = 2 /* Number of stages */ 68 };69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 68 }; 69 /* Fields */ 70 btDbvt m_sets[2]; // Dbvt sets 71 btDbvtProxy* m_stageRoots[STAGECOUNT+1]; // Stages list 72 btOverlappingPairCache* m_paircache; // Pair cache 73 btScalar m_prediction; // Velocity prediction 74 int m_stageCurrent; // Current stage 75 int m_fupdates; // % of fixed updates per frame 76 int m_dupdates; // % of dynamic updates per frame 77 int m_cupdates; // % of cleanup updates per frame 78 int m_newpairs; // Number of pairs created 79 int m_fixedleft; // Fixed optimization left 80 unsigned m_updates_call; // Number of updates call 81 unsigned m_updates_done; // Number of updates done 82 btScalar m_updates_ratio; // m_updates_done/m_updates_call 83 int m_pid; // Parse id 84 int m_cid; // Cleanup index 85 int m_gid; // Gen id 86 bool m_releasepaircache; // Release pair cache on delete 87 bool m_deferedcollide; // Defere dynamic/static collision to collide call 88 bool m_needcleanup; // Need to run cleanup? 89 89 #if DBVT_BP_PROFILE 90 91 90 btClock m_clock; 91 struct { 92 92 unsigned long m_total; 93 93 unsigned long m_ddcollide; … … 95 95 unsigned long m_cleanup; 96 96 unsigned long m_jobcount; 97 } m_profiling;97 } m_profiling; 98 98 #endif 99 /* Methods */ 100 btDbvtBroadphase(btOverlappingPairCache* paircache=0); 101 ~btDbvtBroadphase(); 102 void collide(btDispatcher* dispatcher); 103 void optimize(); 104 /* btBroadphaseInterface Implementation */ 105 btBroadphaseProxy* createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy); 106 void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); 107 void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher); 108 virtual void rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback); 109 110 virtual void getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const; 111 void calculateOverlappingPairs(btDispatcher* dispatcher); 112 btOverlappingPairCache* getOverlappingPairCache(); 113 const btOverlappingPairCache* getOverlappingPairCache() const; 114 void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const; 115 void printStats(); 116 static void benchmark(btBroadphaseInterface*); 99 /* Methods */ 100 btDbvtBroadphase(btOverlappingPairCache* paircache=0); 101 ~btDbvtBroadphase(); 102 void collide(btDispatcher* dispatcher); 103 void optimize(); 104 /* btBroadphaseInterface Implementation */ 105 btBroadphaseProxy* createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy); 106 void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); 107 void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher); 108 void calculateOverlappingPairs(btDispatcher* dispatcher); 109 btOverlappingPairCache* getOverlappingPairCache(); 110 const btOverlappingPairCache* getOverlappingPairCache() const; 111 void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const; 112 void printStats(); 113 static void benchmark(btBroadphaseInterface*); 117 114 }; 118 115
Note: See TracChangeset
for help on using the changeset viewer.