Building for Bullet?
by Rex Hiebert · in Torque 3D Professional · 01/22/2010 (1:25 pm) · 2 replies
I've been working with PhysX for implementing physics in my game and have not been too happy with the limited primitives (box, capsule, and sphere) that must be used to create the collision object. I saw that Bullet Physics will be in version 1.1 and was wondering what kind of collision objects can be created? Do we have to stick with just a few primitives or can we build our own convex hulls? Do we need a special exporter like the Max plug-in that is required for PhysX objects?
I also noticed in the code list that there are different dynamics worlds- continuous, discreet and simple. What are these? Will they allow objects to switch between simulating and non-simulating as needed? From what I've seen in PhysX, physics is on or off. I would like to be able to control which objects should or should not be simulating at any time but when they are "off" they should still be collision objects for objects that are still "on". For example, object A is an active object. It falls to the ground and stops and is then turned into a passive object. Object B can then fall on object A and collide with it but A will not try to react to object B.
Any information would be great. I'm really looking forward to the latest update. Keep up the good work!
I also noticed in the code list that there are different dynamics worlds- continuous, discreet and simple. What are these? Will they allow objects to switch between simulating and non-simulating as needed? From what I've seen in PhysX, physics is on or off. I would like to be able to control which objects should or should not be simulating at any time but when they are "off" they should still be collision objects for objects that are still "on". For example, object A is an active object. It falls to the ground and stops and is then turned into a passive object. Object B can then fall on object A and collide with it but A will not try to react to object B.
Any information would be great. I'm really looking forward to the latest update. Keep up the good work!
#2
You mention that convex and triangle mesh are supported same as PhysX. Has that been added for 1.1? The documentation states:
"Primitives must be used, and the only primitives allowed are boxes, spheres, and capsules.
They must remain primitives, and cannot be converted to editable meshes, editable polys, or scaled by using the scale tool."
We would love to be able to use more than just those primitives.
What is a triangle mesh? Is that just an object made of tris instead of quads? This would be ideal for our application since we have many nonstandard shapes. My objects aren't breakable (and won't need to be) so are you saying we could use the base geometry for collision as a "simple single rigid body"?
And on your last statement, yes, it would be very helpful to know when an object comes to rest so that it can be swapped for a static object.
My app will allow the user to place objects and physics will determine if they fall or not. I'm trying to record their final position. Right now it only gets the position of the server side object which sometimes differs in location from what they saw simulated on their side. Can we get the client side location? My app will be stand-alone and will not need to worry about server authority or client side cheating. Is there a way to get that?
What are your thoughts on the two engines? PhysX vs Bullet? Our scenario will have a few hundred objects that will need to have physics applied but usually only a few of those at a time. Is one better than the other for that?
Thanks for all of your help. Looking forward to the next release!
02/05/2010 (2:21 pm)
Thanks for the reply. Sorry it took me so long to get back to it.You mention that convex and triangle mesh are supported same as PhysX. Has that been added for 1.1? The documentation states:
"Primitives must be used, and the only primitives allowed are boxes, spheres, and capsules.
They must remain primitives, and cannot be converted to editable meshes, editable polys, or scaled by using the scale tool."
We would love to be able to use more than just those primitives.
What is a triangle mesh? Is that just an object made of tris instead of quads? This would be ideal for our application since we have many nonstandard shapes. My objects aren't breakable (and won't need to be) so are you saying we could use the base geometry for collision as a "simple single rigid body"?
And on your last statement, yes, it would be very helpful to know when an object comes to rest so that it can be swapped for a static object.
My app will allow the user to place objects and physics will determine if they fall or not. I'm trying to record their final position. Right now it only gets the position of the server side object which sometimes differs in location from what they saw simulated on their side. Can we get the client side location? My app will be stand-alone and will not need to worry about server authority or client side cheating. Is there a way to get that?
What are your thoughts on the two engines? PhysX vs Bullet? Our scenario will have a few hundred objects that will need to have physics applied but usually only a few of those at a time. Is one better than the other for that?
Thanks for all of your help. Looking forward to the next release!
Associate Tom Spilman
Sickhead Games
If you just need a simple single rigid boday... no.
I'm adding support for box, sphere, capsule, and triangle mesh collision markers so that you can supply a DTS that uses one or more of these primitives.
Using the DTS with TSStatic will get you a static rigid body... using that DTS with PhysicsShape will give you a dynamic rigid body. Using the PhysicsShapeData datablock you can set the common physics properties.
We have some plans on doing new breakable objects based on PhysicsShape that work with both Bullet and PhysX, but that didn't make it for 1.1.
Continuous does continuous collision detection which means it does sweep tests to find precise collision regardless of the speed of the body. As of the latest Bullet docs it still says 'Under construction, don't use yet!'.
Discreet collision detection means it tests for overlapping objects at each timestep and then projects to find the collision. This mode is very fast, but you can get tunneling with fast moving objects and thin collision surfaces. This is what T3D 1.1 uses for Bullet and PhysX.
The btSimpleDynamicsWorld is just for testing.
Well one way you might achieve that in PhysX is to convert the actor from dynamic to kinematic/static on the fly. The new physics api PhysicsBody class doesn't have a method exposed to toggle the dynamic/static state, but it should be simple to add if you require it.