I've just look tread posted by other user And like them I'm confuse about the the of addworld force. What do I need to do except update to use body.addforceWorld(new vector (0,20,0) )for example ? It don't work .
I was one of the people who had the same problem with using AddWorldForce. What I find out is that when the bounding box is intersecting with another bounding box, the object will get "stuck" and using AddWorldForce will not make the object move. So in my case, I had an object located in mid-air in the beginning of the program, and when I apply force at that time, it will move. But as soon as it collided with the ground and came to a complete stop (so it did bounce a bit and it's not like it got stuck as soon as it collided), no matter how I applied forces to the object, it wouldn't move. It will move if I change it's velocity, so that's kinda how I hacked around it; if I wanted the object to move, I applied a small velocity to get it moving a little so the force will register; it still doesn't always work though. But doesn't this sound like a bug to you?
I also overrode the body class and defined my own AddExternalForce method as jwatte suggested; but I think that didn't solve my problem of objects getting stuck and unmovable.
A question for jwatte. How did you add in constraints? Did you use the body.AddConstraint method? I tried that to add a constraint in velocity, which is a built-in constraint in the engine, and it didn't work for me. Do I need to do anything in the Update?
I was using velocity but the velocity change make the box spin around. I manage to use the negative impulse with some tweaking but force and torque never work. I'm not really aware about the way of overriding a method ( I'm from python and really new at c#) but don't seems really complicated. The problem is that a feature should work properly without hacking so might be a bug in the code. since there is not example of force applied in jigglegame, so we cannot know. There is not extra explanation on xml so maybe something is missing.
Gameon: The problem your seeing is likely the deactivation code, you can disable it via
physicSystem.EnableFreezing = false;
You will take a speed hit for that, but should stop things being frozen and not being awaken at the right time. In theory of course it should reactivate when its required, however in practise at the moment it doesn't happen some time.
Another one of the things on my list to look at in the future.
The way world forces are handled is a little weird, but not sure what the API for that would look like.
IIRC Currently the default non-overridden behaviour is to each frame clear the world forces and then optional add gravity. The has the effect that only really derived classes can actually add a world force effectively (cos if its done at the wrong time, its cleared by the inbuilt remove world forces call).
Prehaps the per frame clear, should be made optional… not sure yet.