Fix nan error on fcam for picking npcs

main
parent 59de84431c
commit 01bbe6a244

@ -6995,6 +6995,8 @@ ISANERROR("Don't know how to do this stuff on this platform.")
draw_quad((DrawParams){quad_at(V2(0.0, screen_size().y/2.0f), MulV2F(screen_size(), 0.1f)), IMG(state.outline_pass_image), WHITE, .layer = LAYER_UI_FG});
Vec3 view_cam_pos = MulM4V4(InvGeneralM4(view), V4(0,0,0,1)).xyz;
if(view_cam_pos.y >= 0.050f) // causes nan if not true... not good...
{
Vec3 world_mouse = screenspace_point_to_camera_point(mouse_pos);
Vec3 mouse_ray = NormV3(SubV3(world_mouse, view_cam_pos));
Vec3 marker = ray_intersect_plane(view_cam_pos, mouse_ray, V3(0,0,0), V3(0,1,0));
@ -7025,6 +7027,7 @@ ISANERROR("Don't know how to do this stuff on this platform.")
}
break;
}
}
Vec2 pos = V2(0.0, screen_size().Y);
int num_entities = 0;

Loading…
Cancel
Save