Panda Bullet


Currently there is no way. But I might be possible to add such a method. I don’t know if Bullet draws anything without having at least a single simulation step done before, but I could give it a try. Won’t be before next weekend though.


i think they work just like the bullet hinge motor, except it allows you to specify a motor with target velocity and impulse for each rotational direction (so effectively 3 independent hinge-like motors working on each of the 3 rotational degrees of freedom).

Nevertheless i will probably use a different solution at this point anyhow and revisit the bullet motors if I fail… thanks for the prompt response.


Nope, the Bullet API is completely different. For a hinge you simply call a single method to enable/disable the motor, and provide a single parameter (the target velocity of the moter). For generic constraints there is this method

int 	get_limit_motor_info2 (btRotationalLimitMotor *limot, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, const btVector3 &angVelA, const btVector3 &angVelB, btConstraintInfo2 *info, int row, btVector3 &ax1, int rotational, int rotAllowed=false)

What has to be provided, and what is an out-parameter (obviously not the const-references)? And how to create one or more motors? Like everywhere else in the Bullet API there is no documentation.


Ah, wait, I missed this method

btRotationalLimitMotor * 	getRotationalLimitMotor (int index)

Might be quite easy to expose.


I exposed both the angular and linear motors for the generic constraint. Bullet’s manin gis “rotational” and “translational”. I simply forward the calls to Bullet, so any questions should be considered questions about Bullet and not the Panda3D Bullet wrapper. Consider this feature as highly experimental.


I’m trying to disable collisions between constrained bodies to speed up the simulation (I have ~1000 nodes constrained in a mesh). From bullet forums I found the flag below.

 btDynamicsWorld::addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies)

However, this only works on objects directly tied to each other. Also, I don’t think it’s exposed in panda. I can’t set the nodes to allOff() like in panda’s collision system, because there is no from/into.

So, in bullet, how do you prevent a large group of nodes (more than 32) from seeing each other, but still able to see a collision floor or something else?


thank you very much. i will try to play with it and get you some feedback when i can.


Is there anyway we can get rigidBodyNodes to behave properly with copyTo()?


Since rigid body nodes wrap underlying Bullet object, and Bullet itself does not have a clone function for rigid bodies, this would mean to create a deep copy of the underlying Bullet object by hand. It is possible, but quite a lot of work (we would have to clone the shapes etc.). And it would never be an exact copy of a bodies simulation state (current contact points etc.).


But Bullet does have copy constructors, correct? Couldn’t you then invoke that copy constructor in the BulletRigidBodyNode copy constructor?


Nope, Copy constructors are rarely provided. For example the class btRigidBody class, which is probably the most central object type: … ource.html
(use this link while the original Bullet API docs are offline)

There is the CTOR with construction info, and a second CTOR for backward compatibility with a long list or arguments, but no copy constructor. Unfortunately there is also no way to get the CI from an already constructed rigid body, as it has been possible in the PhysX 2.8.

This seems to be a common thing in physics engines. PhysX has protcted CTORs (object creation is done via factory methods), Bullet seem to lack copy constructors, and I don’t recall having seen copy constructors in Havok.


Hi Ennox,

I’ve having a weird issue with the standard BulletKCC (which I know is a bit borked which has nothing to do with you). If I try implementing mouse look and steering the capsule with setH(), the capsule rotates at a faster rate than the objects parented to it.

Does this sound familiar or do I need a sanity check?

EDIT: Found out what the issue is (at least with Panda 1.8). It seems the capsule in the bullet world works in radians but panda’s hierarch still works in degrees. So to fix I have to:

  • convert the heading to radians and rotate the capsule
  • counter-rotate the capsules children
  • rotate the children with the original heading in degrees
    Bit annoying, but at least it works!


Sorry, missed this post.

Things dealing with the synchronisation between Bullet and the Panda scene graph are our responsibility, and not part of the Bullet code. Seems like I forgot to convert degree to radians within the virtual transform_changed methode. I will check in a fix asap.


I’m going to release 1.8.1 really soon. Are there any particular changes (ones that don’t break ABI compatibility) that you want me to pick up?


Upgrading to Bullet 2.81 is currently the only pending point. But I would need until next weekend.


Checked in some fixes which allow to compile with either Bullet 2.80 (rev2531) or Bullet 2.81 (rev2613). The only changes to the ABI are fixing a bit of const-correctness (nodes retrieved from query results are const, i. e. you can not modify their state).

I also updated the, to reflect the changes of the last few months.


referring to my question about the zero positions of hinge constraints ([url]Zero Position of Bullet Hinge Constraint]) I think I figured out that I would need the HingeConstraint constructor which allows to define transforms: Would there be a chance to have this one wrapped by the panda bullet bindings?
Thanks for your help!


Not a problem. I find the CTOR with local “frames” (coordinate systems) more intuitive anyway. Tell me if it helps your problem. I will then add thse CTOR to all constraint types (where available).


Sorry I write here to advice that in CVS source there is an error in

void BulletSphericalConstraint::set_pivot_b(const LPoint3 &pivot_b) ) {

this should be

void BulletSphericalConstraint::set_pivot_b(const LPoint3 &pivot_b) ) {



Right. Thank you for finding out. I check in the fix.