camera_projection_perspective
Perspective projection parameters (field of view, aspect ratio, near/far planes).
Fields and methods
Members of the struct camera_projection_perspective. Most of what you do with a CGP type goes through the free functions listed below.
Fields
float field_of_view = 50.0f * Pi/180 | Vertical field of view in radians, 50 degrees by default. |
float aspect_ratio = 1.0f | Width/height ratio of the viewport, 1 by default (usually set from window_structure::aspect_ratio()). |
float depth_min = 0.01f | Distance of the near clipping plane, 0.01 by default. |
float depth_max = 1000 | Distance of the far clipping plane, 1000 by default. |
Functions taking a camera_projection_perspective
Compute 3
Documented on another page
picking_mesh_vertex_as_sphereCasts 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).onvec2picking_plane_orthogonal_to_cameraIntersects the camera ray through the screen position (relative coordinates) with the plane through plane_position orthogonal to the front direction of the camera.onvec2picking_spheresCast 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.onvec2
Functions returning a camera_projection_perspective
None.
Operators
None.