Ammo Physics ( joint angle and size control ) how

https://didisoftwares.ddns.net/

Hi, I’m trying to simulate physics on an excavator.
Does anyone know how to control the following situations:

1 - how much the slider (btSliderConstraint) can push and pull, even by setting .setLowerLinLimit and setUpperLinLimit ,keeps pulling or pushing without stopping

2 - define how much Hinger1 (btHingeConstraint) can open and close the angle, and set to rotate only in X

3 - make the slider (btSliderConstraint) stop moving in the position it is in when you set speed to zero, currently he continues to pull or push slowly

exposed variable to use in chrome dev console.
PM is a Slider Jointer can control push pull with - PM.setTargetLinMotorVelocity(1 or -1);
PA is a Hinge1

Jointers creation is a function in - https://didisoftwares.ddns.net/physics.js
line 353 - async createJoint

Objects loader and atach jointers in - https://didisoftwares.ddns.net/objects.js
line 197 - case ‘scavator’: {

1 Like

My advice is to not try to debug the entire system at once. Get one joint constraint or motor working first… then work your way up to the full simulation.

You’re may be setting things up in a state that already violates the constraints, at which point all bets are off and the physics engine is just doing its best under the circumstances.
Then there are tuning parameters/iterations etc. that are all in play in the simulation.

Setting these things up to work correctly is HARD.

1 Like

I’ve already found some of the problems, the slider doesn’t work very well as a piston

1 Like