Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Jul 12, 2011 12:20 pm 
Offline

Joined: Tue Jul 12, 2011 11:42 am
Posts: 4
Apologies for the very often-asked question. I'm working on a simple marble-rolling physics game. Bullet has been great to implement and I've gotten good results very quickly.

Version one of the game used a btStaticPlaneShape for the resting base and a btConvexHullShape (a cylinder that I found the code for on these forums) to provide the boundary surround. Marbles were just basic implicit btSphereShape objects. Everything worked very nicely, no tunnelling or problems.

For version two, I'm looking to change this setup to use meshes or some other implementation that gives me an asset pipeline that means I can build more complex levels. I've experimented with a btTriangleMesh and a btHeightFieldTerrainShape for the floor/base - and a btTriangleMesh for the surround. As soon as I switch to these constructs, I get tunnelling happening with my spheres, when they reach high velocities.

Video here: http://www.youtube.com/watch?v=HEMpBVIj8Ug

I'm trying to resolve this - but hoped that someone might be able to offer some advice or links to code examples to try out. I'm guessing that I need to look into a more complex collision detection set-up - but as this is my first time using Bullet, I'm struggling a little with where to go next. I've looked at a lot of posts on the forum and the FAQ and I'm a little stuck with implementing (for example) continuous collision detection.

Thanks very much for any help/advice.


Top
 Profile  
 
PostPosted: Tue Jul 19, 2011 3:41 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Can you try enabling CCD for the ball, tune the following parameters

Code:
      body->setCcdMotionThreshold(0.0001);
      body->setCcdSweptSphereRadius(0.4f);

Make sure the setCcdSweptSphereRadius is fully embedded inside the rigid body (smaller than the actual object radius)

Please let us know if that helps,
Erwin


Top
 Profile  
 
PostPosted: Tue Jul 19, 2011 4:34 pm 
Offline

Joined: Tue Jul 12, 2011 11:42 am
Posts: 4
Many thanks - I'm so far able to get around the issue by sticking to using primitives which have been more robust for purpose, but I will certainly give your suggestions a try. I'll let you know if I have any success.

Thanks for the help!


Top
 Profile  
 
PostPosted: Wed Jul 20, 2011 12:24 pm 
Offline

Joined: Tue Jul 12, 2011 11:42 am
Posts: 4
Your solution worked a treat, many thanks for the awesome help.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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