Game based on TestAdvancedVehicle, some questions

Hello, I am creating a racing game based on the TestAdvancedVehicle example for a software contest. The game must be completed in a couple of days, and I still have a few issues. I use a standard game, and one game state for the race.



One of them is repositioning the cars. For the cars I use the Car class, but with very small modifications (for better AI cornering). Here is the code I use to reset the cars:



/**
    * Reset the car associated with this tracker.
    * In case of the human player this method should be called from a ResetAction.
    * In case of an AI player this method should be called automatically when the AI
    * is blocked or the car is turned upside down.
    */
   public void reset() {
      if (car == null)
         return;
      //get reset position
      Vector2f pos = prevSection.getLeadingInterface().getRaceNode();
      //move car to correct position
      car.setPosition(pos.x, car.getChassis().getChild(0).getWorldTranslation().y+20, pos.y);
      //rotate car to face race direction
      //not completed
      car.setRotation(0.0f, 1.57f, 0.0f, 1.0f);
   }



The problem is that for the human car I have to press 'R' several times until the car is reset, and for AI cars this method has no effect. The AI's are updated from the Race state's update method. It seems like the setPosition() and setRotation() calls have no effect.

You will also need to clear the forces that are acting on the dynamic physics nodes, and also iterate over each joint on the vehicle and reset them after moving the nodes to their new location.



Post more code (what's in car?) and I can get a little more specific for you.