Drop sphere with ammo.js - dont move on x and z axis

Hi guys!

Just getting more and more into threejs and got another problem / issue on my way.
I wanna drop a soft body on the y axis on a ground - but prevent it from tilting & moving on the x and z axis - using ammojs atm.

This is what i got so far: https://jsfiddle.net/mwgrtfhp/

I e.x. tried to set Quaternion to 0, 0, 0, 1 on every update - but doesnt any impact.

Whats the best way to pin this object on the y axis?

Greetings,
Aaron

I’m not familiar with ammo.js but it seems to me what you are trying to do is not possible. You would have to constrain the entire simulation of the soft body on the y-axis which is usually not supported by a physics engine. Simply because it’s unusual to do this.

@yombo Any thoughts about this^^?

1 Like

Sorry for the late reply.

@Mugen87 is right, I see no way of doing this. A soft body is a collection of points, it doesn’t have any position or rotation info.

thanks a lot! hm damn - any other way to do this? Drop by Aleksei Vasileika on Dribbble - smth liked a fixes drop - maybe there are some keywords or a direction for me :slight_smile:

Just a crazy idea: to use not a pure flat suface, but very slightly/tiny concave, something bowl-like. So your drop will be in the center, thus at the lowest point, of the “bowl” and won’t go anywhere.

2 Likes

ill try that - thank you! :slight_smile: