How to make objects 'stick'?

Hi guys,



I installed jME and jME-Physics 2 this weekend and it is totally awesome!



I was wondering what would be the best way to get rid of some unwanted wobble. I hope you can see it in the picture below. I defined 0 bounciness for the material pair of the floor and the dynamic node (by copying the code from lesson 3) and it works, when the box is dropped it doesn’t bounce. However if I rotate the box at 90 around an edge, when it hits the floor it wobbles a little bit… Is there a way I can control this (other than with the materials being used)

In general, is there a way to make objects ‘stick’ when they collide? How do I set the characteristics of the collisions? I know there was an onContact method and ContactPairs but these seem to have been removed?



Sorry if this was asked before, I searched but I didn’t find it.

And I wanted to make my first post  :smiley:

thanks

Welcome to jME :slight_smile: - you will need to change your nick after a while :wink:



I'm not sure what can be seen from the screenshot (only that physics does not seem to be in sync with visuals :?), but if I understood you, you want to achieve a perfect collision of the dynamic box with the floor. That's not easy. Your 'wobbling' is most probably caused by the angle of the box not being exactly 90

Thank you Irrisor.

Looking forward to the day when I would know enough of the jME numerous features and java in general as not to be a noob  :slight_smile:



the picture is just trying to show the wobble. I have 2 boxes, one is a regular old fashioned box and another one is a dynamic physics box. Both are attached to the same node, which I rotate. The physics box wobbles after the move, which in fact is more realistic.



I am trying to make the box roll on user input but after a few rolls it eventually hits the flloor too hard and falls off. I will just change my logic to fix the box position before the rotation around an axis. Or now that I know that there are hinges I could try using these…



Anyway, thank you very much for your reply. I am sure I will be back soon.