Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Bullet physics collision


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 newtechnology   Crossbones+   -  Reputation: 1040

Like
0Likes
Like

Posted 29 May 2014 - 10:07 AM

How do I do collision with bullet physics? I've sponza model which has about 393 subsets. Should I add this all subsets as rigidbody to bullet physics? Is it possible to add/remove rigidbodies/model from being checked from collision using bullet physics? I want to add/remove models from being checked from collision because of frustum culling. If model isn't visible, then I don't want it to be checked for collision. Also how to do collision with this many 393 subsets?

 

Here is how my scene looks

 

bsOqs8z.png



Sponsor:

#2 DiegoSLTS   Members   -  Reputation: 2086

Like
0Likes
Like

Posted 29 May 2014 - 12:02 PM

In most (all?) physic libraries you're collision detection is no related to what you draw on your screen. You can simplify shapes or groups of shapes that are visually complex with simple shapes for collision. You probably can reduce the number of collision shapes to a really small number of cubes.

 

Also, only use collision shapes and rigid bodies in objects that need to. What I mean is, if your character (let's assume you have one moving in that place) can´t jump, there's no need to check for collisions in the rounded top of the openings, or the spikes comming out of the walls, or the ceilings.

 

I used Bullet Physics years ago and I don't remember the syntax, so I can't help you with actual code, but here's the official "Hello World": http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World

 

I don't think you can automatically disable some collision shapes when they're out of the screen, most of the time physic stuffs happen even if you're not looking (enemies would fall through the ground, or they won't be able to throw things at you), but I'm sure you can add/remove the rigid bodies from the "btDiscreteDynamicsWorld" if you want to at any time. Anyway, that sounds like premature optimization, so maybe you should check that feature later if you find that the collision detection is affected by those objects. I think the real intended use of removing something from btDiscreteDynamicsWorld is when that object will never interact again, adding and removing everything might even be worse for performance.



#3 newtechnology   Crossbones+   -  Reputation: 1040

Like
0Likes
Like

Posted 30 May 2014 - 03:19 AM

Okay. How does bullet do frustum culling? I mean it doesn't know the information regarding my frustum then how will it do frustum culling? Also another question,

 

Look at this video :

 

Why do I keep moving even after touching the ground? it never stops. In video it might seem that I stop moving but it never stops.


Edited by newtechnology, 30 May 2014 - 04:01 AM.


#4 Aardvajk   Crossbones+   -  Reputation: 8802

Like
0Likes
Like

Posted 30 May 2014 - 05:19 AM

Bullet doesn't do frustrum culling. As has been pointed out, what is visible has nothing to do with what requires physic simulation. Bullet has its own methods of broad phase to reduce the physics calculations required each frame.

 

Re your other question, its probably related to how your friction is set up. However, if you are trying to use a rigid body for a character controller, you're in for a world of pain and frustration. Best to take a look at btKinematicCharacterController instead. Its not complete and has its own issues, but you're unlikely to ever get a rigid body behaving as you want for a character controller.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS