|
There's my singleton to create my physic world at the beginning of the game. The Conversion class converts units from my graphical world to my physical world to stay to a good scale:
/* * Singleton for physic world. */ public static World getWorld(){ if(myWorld == null){ accumulator = 0.0f; myWorld = new World(new Vector2(0, Conversion.worldToBox(-20)), true);
//Only add to test if it could changes the behavior I had. PhysicManager.getWorld().setAutoClearForces(true); //Set callbacks. myWorld.setContactListener(new GroundListener()); //Use to see the edges of bodies. debugger = new Box2DDebugRenderer(true, false, false, true); camera = new OrthographicCamera(15, 15); camera.position.set(0, 0, 0); } return myWorld; }
My problem isn't that the gravity grows or must reset, but that my "character" is constantly pulled down and, once upon the platform, won't be able to jump due to an excessive force applied on him. I try to discribe it the best way possible, but it's hard to clearly express.
I want to know if I must do something to reset the force applied on my character while he stands on an object or then that the engine is misconfigured (by me) and should affect the force applied on any object upon contact.
Exemple: (Gravity) Y-axis force on my char: 0, -5, -10, -15, (fell on the platform), -20, -25, -30, etc. My character can jump with a force of 30, but the force applied is higher.
|