diff options
author | Erwin Coumans <erwin.coumans@gmail.com> | 2015-05-02 22:33:33 -0700 |
---|---|---|
committer | Erwin Coumans <erwin.coumans@gmail.com> | 2015-05-02 22:33:33 -0700 |
commit | 7a0288bf56b5ae7c7bb1f7de99fccc397bec5f47 (patch) | |
tree | 1cdabd9661b742d1081acd6006f8035a8314891f /src/BulletCollision/BroadphaseCollision/btDbvt.h | |
parent | 37c788841a5cd3873cac77b04c1b0756983bb951 (diff) | |
download | bullet3-7a0288bf56b5ae7c7bb1f7de99fccc397bec5f47.tar.gz |
fix issue with btDbvt::collideOCL, related to memmove (needs further testing)
only enable OpenCL demo if flag --enable_experimental_opencl is passed to ExampleBrowser
Diffstat (limited to 'src/BulletCollision/BroadphaseCollision/btDbvt.h')
-rw-r--r-- | src/BulletCollision/BroadphaseCollision/btDbvt.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/BulletCollision/BroadphaseCollision/btDbvt.h b/src/BulletCollision/BroadphaseCollision/btDbvt.h index b64936844..f578aae01 100644 --- a/src/BulletCollision/BroadphaseCollision/btDbvt.h +++ b/src/BulletCollision/BroadphaseCollision/btDbvt.h @@ -1193,17 +1193,23 @@ inline void btDbvt::collideOCL( const btDbvtNode* root, /* Insert 0 */ j=nearest(&stack[0],&stock[0],nes[q].value,0,stack.size()); stack.push_back(0); + + //void * memmove ( void * destination, const void * source, size_t num ); + #if DBVT_USE_MEMMOVE - memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1)); + memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1)); #else - for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1]; + for(int k=stack.size()-1;k>j;--k) + { + stack[k]=stack[k-1]; + } #endif stack[j]=allocate(ifree,stock,nes[q]); /* Insert 1 */ j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size()); stack.push_back(0); #if DBVT_USE_MEMMOVE - memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1)); + memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1)); #else for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1]; #endif |