Closed Chulepa closed 9 years ago
I'm quite sure scene2d sample is correct. If box2d internally scales the acceleration by delta once again (which sounds reasonable, of course) then box2d sample is wrong. I'll look into it more deeply in the next days. Thanks for the report :)
@Chulepa
According to this box2d thread you're right. The applyForce
method takes delta time into account already.
The same goes for applyTorque
, I guess.
Of course, after fixing the applySteering
method, steering parameters in all box2d tests will need some tweaking.
Also, bullet tests are likely affected by a similar issue. :worried:
Fixed box2d tests, see commit c63f3c085c9c61870c20fd13a184e08fa744e5f4 Bullet tests not fixed yet
Hi,
I was looking the examples on steering behavior, and I found ans issue. I'm not 100% sure I got it right, but let me explain. On the Scene2D example, the steeringOutput is calculated, and scaled with time and added to the velocity.
So the steering linear is treated as a force. On the other hand, on the example with box2D, the steeringOutup is calculated, then scaled to deltaTime, and finaly applyed as a force to the body:
In this case the steeringOutput.linear is scaled to delta before is used as a force. Then the box2D will scale again with dalta before applying to velocity. The result is a much weaker force.
As I sad, I am not sure if I've wrong understood it, or it's a mistake on the examples. And if so, which of the to cases should we use in our code?
Thanks, StefanW