[SOLVED]Bullet collision

I want a big amout of bulletRigidBodies not to collide with each other, but collide with other bodies.

Any suggestions?

And the second question: When i use ConeTwistConstraint with a big amount of bodies - first everything is ok, but then friction of bodies accumulates and at last they just fly everywhere in differen directions.

P.s. Sorry for my English :frowning:

My suggestion is to read this post: [url]Panda Bullet - #476 by enn0x] . It’s a rather new feature, and not yet mentioned in the manual.

I’d say that the trick is to setup the bodies and constraints in a “relaxed” way, that is in positions/orientations where minimal force is applied. We certainly need more information about your setup in order to provide more detailed help.

enn0x
Thanks for you answer :slight_smile:

I use model from MakeHuman and load it to panda as Actor.
Then i just put objects instead of bones(joints) in this human.

                frameA = TransformState.makeHpr(Vec3(0, 0, 0))
                frameB = TransformState.makeMat(bundle.findChild(name).getDefaultValue())

Copying bone(joint) transform to frame transform for “relax”. All objects make a human something like a human skeleton. So i can say that transform works and all objects must be in “relaxed” pose".

                np.setTransform(frameB)		
                shape = BulletSphereShape(1)	
                np.node().addShape(shape)
                cs = BulletConeTwistConstraint(np.node(), ParentNP.node(), frameA, frameB)
                cs.setDebugDrawSize(2.0)
                cs..setLimit(60, 60, 120)
                world.attachConstraint(cs)

Attaching constraint

if this is not enough - here my new methods with another constraint, that I added in Actor class:http://www.4shared.com/office/gPEqfH1b/PartOfActorClass.html

Sorry, but i searched before and didn’t found this methond in bulletWorld.h. I think my version is old, but I downloaded it only month ago. Please, can you give link to a version, that have this feature. Thanks, and Happy New Year :slight_smile:

You can get currents builds by downloading the buildbot versions of the Panda3D SDK (Downloads → Panda3D SDK for Developers → devel).
https://www.panda3d.org/download.php?sdk&version=devel

“Relaxed” means that the engine will not apply any net force to a given setup, so without perturbation from outside a relaxed system will stay in the same state as it has been initial. Obviously your setup is not relaxed, or you run into numerical problems inside Bullet.

I have to admit that the advice to use a relaxed setup is, well, not very helpful. The trick is to find out why it is not relaxed, and how to setup in a relaxed way.

Setting up Bullet constraints is a tricky thing. I don’t understand it fully myself. So far I don’t see any obvious problems in the fragments you present to me. But then the difference comes with the values which get applied by the code, not by the code itself.

What can we do?
1.) You could try to setup only a single joint, and see what happens if you simulate. Repeat for all joint, one by one.
2.) You could try to insolate the relevant code into a standalone sample and send me the files. Then I can try to find out what causes the explosion.

Sorry, but I can’t give better advice.

enn0x

You advice is pretty good, i understand what you mean. Thanks for you work :slight_smile: