I just played around a bit with setMaxLinMotorForce on a slider constraint, but I am not clear on what unit the motor force is in.
I modeled a sliding door with a box blocking it, and with 10 (Newton?) it was enough to make the box jump from the doorframe instead of just blocking the door. Seems a bit excessive to me.
What unit is setMaxLinMotorForce in?
-
- Posts: 56
- Joined: Sat Mar 08, 2008 12:37 am
Re: What unit is setMaxLinMotorForce in?
Hello,
The definition of the maxLinMotorForce may be a little bit confusing
Actually it sets limits for the applied impulse for the constraint solver.
To set it in newtons you should use the following formula:
slider->setMaxLinMotorForce(maxForceInNewtons * dt * dt);
where dt is the simulation time interval (1/60 sec by default)
Note, that it sets limits and not the actual force. If you set a relatively large
value, the body will achieve the desived velocity set by setTargetLinMotorVelocity()
for one simulation step.
Thanks,
Roman
The definition of the maxLinMotorForce may be a little bit confusing
Actually it sets limits for the applied impulse for the constraint solver.
To set it in newtons you should use the following formula:
slider->setMaxLinMotorForce(maxForceInNewtons * dt * dt);
where dt is the simulation time interval (1/60 sec by default)
Note, that it sets limits and not the actual force. If you set a relatively large
value, the body will achieve the desived velocity set by setTargetLinMotorVelocity()
for one simulation step.
Thanks,
Roman