# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 6 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Grid CollisionPosted: Fri Apr 13, 2012 4:13 pm

Joined: Fri Apr 13, 2012 4:11 pm
Posts: 5
I'd like to transition from using an intrinsic collision system to Bullet. Currently, one great benefit to the intrinsic collision system that was written for my engine is the fact that since there is tile data, I can quickly walk across the lines of polygons and quickly check if they're within cubes inside a 3D grid in the level. For doing ray tracing as well, it's quite quick.

Is there an alternative? Should I really create thousands of boxes for each collision tile?

Top

 Post subject: Re: Grid CollisionPosted: Fri Apr 13, 2012 4:37 pm

Joined: Fri Jun 24, 2011 8:53 am
Posts: 149
Of course not. You'll have to somehow approximate it. Ideally, each tile might be built out of a few btRigidBody instances. Or perhaps a single btRigidBody from a compound shape.
I cannot quite see any reason to create "thousands" of boxes for each tile. What would be the point? What is a tile for you? Would you elaborate?

Top

 Post subject: Re: Grid CollisionPosted: Fri Apr 13, 2012 8:26 pm

Joined: Fri Apr 13, 2012 4:11 pm
Posts: 5
Sorry, I don't think that's what I'm referring to.

I meant, for the entire map, beyond characters/vehicles/etc..., there's tile data. Obstacles are represented by cubes of tiles that are consistently the same size. Would I really make an instance of all collision tiles? That is, say I had a large labyrinth, which means there'd be thousand of wall tiles, would the best approach be to create a bunch of boxes? Or is there some trick for something like this, similar to a heightfield, that works on a very large scale of rectangles that spans an entire level?

Top

 Post subject: Re: Grid CollisionPosted: Sat Apr 14, 2012 8:20 am

Joined: Fri Jun 24, 2011 8:53 am
Posts: 149
I see. There are a few options.

First, probably simplest, is to just create a few boxes. A thousand of static boxes or simple hulls can probably be mangled at reasonable speed. My current world is about 400 boxes and 200 hulls, ticks at about 100 fps on my system (Athlon X3 450).

The next step would be to collapse nearby boxes in a single one. This will also improve stability.

Note, as showed here bullet silently assumes rigid bodies do not touch each other. When this does not hold true, there will be issues with simulation stability (although predictability is probably a better term).

To solve this, I have played a bit with polygon soups (they allow internal edges to be properly detected)... I couldn't quite make them work, in general, I think the best thing to do is to have a proper kinematic controller taking care of those cases. As for dynamics... well, I guess that's a problem.

Top

 Post subject: Re: Grid CollisionPosted: Sat Apr 14, 2012 7:56 pm

Joined: Fri Apr 13, 2012 4:11 pm
Posts: 5
I wonder if it's worth implementing a new type of object, rather than fighting with the system. If everything is aligned and consistently sized. I'm sure others could benefit from this special object as well.

I, of course, agree that I could collapse boxes and whatnot, but when changing the environment at run-time, it could prove to be tedious.

Top

 Post subject: Re: Grid CollisionPosted: Thu Apr 26, 2012 6:25 pm

Joined: Sun Jan 29, 2012 10:01 pm
Posts: 49
The default broadphase is using a dynamic tree for each group of bodies and therefor the lookup cost for small dynamic bodies is only O(log n) where n is the number of static bodies. My game use thousands of static bodies without any problem.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 6 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 6 guests

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

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities