Collision

I just tried it at another way: no KinematicCharacterController, but now I removed all the forces on the x and z axis, and it is nearly what I want, the only problem is that collision with objects like walls pushes me up instead of back. Is there a way to let only those collision forces apply and not things like gravity rolling me off the hills. I move the camera RigidBody by changing it’s world transform.


//The method to move the camera
public void move(float amount, float direction) {
	com.bulletphysics.linearmath.Transform transf = body.getWorldTransform(new com.bulletphysics.linearmath.Transform());
	javax.vecmath.Vector3f vec = transf.origin;
	vec.z -= amount * Math.sin(Math.toRadians(rotation.y + 90 * direction));
	vec.x -= amount * Math.cos(Math.toRadians(rotation.y + 90 * direction));
	body.setWorldTransform(transf); //body is the RigidBody of the camera
}

And this updates the physics:


    public void updatePhysics(float delta) {
        RigidBody camera = Main.getCamera().getRigidBody();
    	Vector3f cp = camera.getWorldTransform(new Transform()).origin; //The current CameraPosition
        dynWorld.stepSimulation(delta, 10);
        Transform np = camera.getWorldTransform(new Transform()); // The new CameraPosition
        np.origin.x = cp.x;
        np.origin.z = cp.z;
        
        camera.setWorldTransform(np);
        camera.setLinearVelocity(new Vector3f(0,camera.getLinearVelocity(new Vector3f()).y,0)); // Clears all the linear vilocity except for the Y axe
        Vector3f pos = camera.getWorldTransform(new Transform()).origin;
        Main.getCamera().setPosition(-pos.x, -pos.y, -pos.z);
    }