Sorry for double post, but now I faced an other strange problem with camera.
I use the following script to make Z movement of camera smoother (on stairs etc):
Code:
vec_set(camera.x, vector(my.x, my.y, camera.z));
vec_set(cam_pos.x, vector(0, 0, 30)); // 30 is Z height of camera
vec_rotate(cam_pos.x, my.pan);
vec_add(cam_pos.x, my.x);
vec_lerp(camera.x, camera.x, cam_pos.x, 0.5 * time_step); // 0.5 smooth factor

If I set camera's position with "vec_set" instead of "vec_lerp", movement is perfectly smooth, other ways it jerks a little bit.
I tried to lerp without "time_step", but I get same results.. Used to make it smoother without "vec_lerp" with this:
Code:
camera.x = cam_pos.x;
camear.y = cam_pos.y;
camera.z -= (camera.z - cam_pos.z) * time_step;

But results are the same.. Camera jerks a little bit, what could cause that? It only happens if I don't limit fps as well.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung