Ammo Physics ( joint angle and size control ) how

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 -
line 353 - async createJoint

Objects loader and atach jointers in -
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