URL: https://graphicscomputing.fr/cgp/reference/camera_first_person/
Description: Camera with a free position and orientation (first person view).

# camera_first_person

Camera with a free position and orientation (first person view).

Fields:

- `rotation_transform orientation_camera` - Orientation of the camera frame (identity by default, the camera then looks toward -z).
- `vec3 position_camera` - Position of the camera in world space, (0,0,0) by default.

Functions taking it:

- `intersection_structure picking_plane_orthogonal_to_camera(vec2 const& screen_position, vec3 const& plane_position, camera_generic_base const& camera, camera_projection_perspective const& projection)` - Intersects the camera ray through the screen position (relative coordinates) with the plane through plane_position orthogonal to the front direction of the camera.
- `picking_structure picking_spheres(vec2 const& screen_click, numarray<vec3> const& spheres_centers, float spheres_radius, camera_generic_base const& camera, camera_projection_perspective const& projection)` - Cast a ray through a screen position (normalized device coordinates) and return the closest hit among spheres of common radius, with its index, position and normal.
- `picking_structure picking_mesh_vertex_as_sphere(vec2 const& screen_click, numarray<vec3> const& vertex_position, numarray<vec3> const& vertex_normal, float picking_distance, camera_generic_base const& camera, camera_projection_perspective const& projection)` - Casts the camera ray through the screen position and returns the closest vertex whose sphere of radius picking_distance it hits, with the hit point, the vertex normal and the vertex index (active is false if none).
