Sticking on Collision

This post is related to the one called “Merging on Collision”. I have balls of dust interacting using gravity. I’d originally thought that when two balls of space dust collided, I wanted them to merge smoothly into a new (bigger) ball. I’ve since discovered that this isn’t what I need at all.



Instead, I want the balls of dust to stick to each other when they touch. How can I achieve this? Applying a large force to balls which are close to each other simply makes them bounce off each other with more force, as you’d expect. How can I stick items to each other?



I’ve noticed that there’s no compound scene shape like there is with collision shapes, or I’d just delete the touching dust lumps and add a compound shape with equivalent components. Does that make sense?



Cheers!

I think you could create a batch of the two mesh using geometry instancing

http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/geometry-instancing-1/

resulting in single mesh of the two.

Nono, you just need a CompoundCollisionShape. If you want it to look a bit more dynamic you could use joints.

It has to look like Spheres joined together, as well as colliding like Spheres joined together. Mm… I’ve given the Geometry instancing a try, the concept looks good even if I can’t get the code to work yet.