How to glue physical objects together

Hi

Another question about connect/glue physical objects together. I currently do it with point to point joints, but I suppose that will slow down my app if I have a lot of them. Is there a way to glue objects together and form a new physical object? There will be as well movable stuff, which I have to do with hinge joints.

Any suggestion highly welcome :smile:
Many thanks
Christian

Just make a new physics object and give it the same velocity?

just to get you right: i should then keep those velocity in sync of all glued objects? what if is hit by something?

not sure if that will make the trick to be honest. because it would behave like a big box. but that I dont want as it is a self constructed robot out of boxes, servos and the like.

but thanks for the suggestion anyway

I found CompoundShape in jbullet. I think this is more or less what I was looking for. I see there is no direct wrapper for jmonkeyengine so far.

Hi, do you know where the javadoc link is? Itā€™s very useful.

http://javadoc.jmonkeyengine.org/com/jme3/bullet/collision/shapes/CompoundCollisionShape.html

Hah I looked at the wrong samples/places. That definitly help :slight_smile: thanks

Thats exactly what I suggested, making a new physics objectā€¦

but a compound collision shape can not be added to physic space. I get a ā€œcan not add this kind of object to physic spaceā€. any suggestions?

I answer my question my self :smile:

CompoundCollisionShape comp = new CompoundCollisionShape();
RigidBodyControl compCtrl = new RigidBodyControl(comp);
bulletAppState.getPhysicsSpace().add(compCtrl);

I of cours need a rigid body control. I try that later. Do I have to set a [SOLVED] into title if itā€™s done? I saw that a few times in this forum.

EDIT: If I add several rigid body collision shapes to the compound and drop it into physics no physical reaction just hangs there in the air. So something I miss or I do not understand. Isnā€™t there codesamples somewhere? I found one with vehicle controll thatā€™s why I thouht it should work with my rigid body control idea. Iā€™m little lost now. Any suggestion?!

i guess your mass is 0? aka static objects?

No it is 1.0f, I tried to give the compound a mass as well, no reaction. Further more the added cubes in the compound did not even stick together if I told them by the position vector you have to hand over for child shape addition. They stay just where I put them as graphical 3D objects. So I suppose no physics.

yeah I think I just donā€™t understand the concept for compound I fear. My understanding was you have a couple of rigid bodies with mass and shapes and instead drop them to a physic space you do it indirectly by adding them to a compound and drop the compound into the physic space.

Compoundshapes are for simulating objects that you cannot approximate with one simple shape.

Eg a cross could be made with two box collision shapes. It will behave as a single rigidbody then.
You might be wanting a constraint actually (look them up), not sure.

yes actually I want to make a pluggable robot out of component. I fear if I use joints and have a lot robot components I will slow down the app, so I thought having the fix parts in compounts.

but I think for smaller robots (20 parts or so) stiff 6dof joints will do the trick. see my other questions about 6dof joints stiffness :wink: