Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Aug 24, 2011 6:16 pm 
Offline

Joined: Wed Aug 24, 2011 6:08 pm
Posts: 4
btCollisionObject needed to have information about DynamicWorld. For this purpose added void* m_userObjectPointer_0; to hold DynamicWorld pointer or handle.

Otherwise if phisical object is lost (when deleted C++ object but not deleted body handle) then unable to destroy body due to absence info about World

Needed to make changes for future version of BulletPhysics, here are modified files:

http://tmdfreegames.com/btCollisionObject.h
http://tmdfreegames.com/btCollisionObject.cpp


Top
 Profile  
 
PostPosted: Fri Aug 26, 2011 1:10 pm 
Offline

Joined: Wed Aug 24, 2011 6:08 pm
Posts: 4
two files

bullet-2.78\src\BulletCollision\CollisionShapes\btConvexPolyhedron.cpp
bullet-2.78\src\BulletCollision\NarrowPhaseCollision\btPolyhedralContactClipping.cpp

have the same function 'bool IsAlmostZero(const btVector3 &)'

'MAX_ITERATIONS' : macro redefinition in bullet-2.78\src\BulletCollision\NarrowPhaseCollision\btGjkConvexCast.cpp(27)
'IDX' : macro redefinition in bullet-2.78\src\BulletSoftBody\btSoftBodyHelpers.cpp(549)

needed to be removed


Top
 Profile  
 
PostPosted: Sat Aug 27, 2011 4:42 am 
Offline
User avatar

Joined: Tue Mar 02, 2010 6:13 am
Posts: 66
no pointer to the world in btCollisionObject is meant
to avoid circular dependencies , so don't think this
will make it ...


Top
 Profile  
 
PostPosted: Sat Aug 27, 2011 5:23 am 
Offline

Joined: Wed Aug 24, 2011 6:08 pm
Posts: 4
it is not actual pointer to World, because as it was said it is User Data and used in callback function CustomMaterialCombinerCallback to decide from what World the Handle is lost

to prevent body handle leaking and it does not concern to internal physics structure and logic

it is user level control and one user pointer is not enough

of cause can be used userpointer = malloc(sizeof(void*) * 2); to store both pointers but it can slow calculation down
and requires additionally memory control


Top
 Profile  
 
PostPosted: Sat Aug 27, 2011 7:17 am 
Offline

Joined: Wed Aug 24, 2011 6:08 pm
Posts: 4
When said handle it means that C++ Bullet Physics code called from ANSI C multithreaded application environment
It helps for debugging to detect lost body handle because drawing and physics are running in separate threads


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group