camera_world_to_pixel_point now also takes camera fov into account

This commit is contained in:
Sara 2023-10-08 23:06:47 +02:00
parent 62410b7d72
commit ac24521b34

View file

@ -40,5 +40,7 @@ Vector camera_world_to_pixel_point(Camera* self, Vector point) {
t.scale = OneVector;
t = transform_invert(t);
point = (Vector){point.x + (self->fov / 2.0), point.y + (_camera_height(self) / 2.0)};
return vmulff(transform_point(&t, point), g_render_resolution.x / self->fov);
}