PickCamera Derived Type

type, public :: PickCamera

The camera and cursor of a pick (see the module documentation).


Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: aspect = 1.0_wp

width / height

real(kind=wp), public :: eye(3) = 0.0_wp

the eye (root frame)

real(kind=wp), public :: forward(3) = [0.0_wp, 1.0_wp, 0.0_wp]

the view direction (unit vector, root frame)

real(kind=wp), public :: half_h = 1.0_wp

half the viewport (framebuffer pixels)

real(kind=wp), public :: half_w = 1.0_wp

half the viewport (framebuffer pixels)

integer, public :: kinds = -1

the kinds of hits wanted: bit k for kind k (all)

real(kind=wp), public :: max_depth = huge(1.0_wp)

hits deeper than this aren't wanted (nearest only)

real(kind=wp), public :: near = 0.0_wp

the smallest depth in front of the eye

real(kind=wp), public :: ortho(4) = [-1.0_wp, 1.0_wp, -1.0_wp, 1.0_wp]

(orthographic: left, right, bottom, top)

logical, public :: perspective = .true.

(true: perspective; false: orthographic)

real(kind=wp), public :: pixel_ratio = 1.0_wp

framebuffer pixels per window unit (for line widths, marker sizes)

real(kind=wp), public :: right(3) = [1.0_wp, 0.0_wp, 0.0_wp]

the camera's right axis (unit vector, root frame)

real(kind=wp), public :: tan_y = 0.0_wp

tan(vertical field of view / 2)

real(kind=wp), public :: tolerance = 6.0_wp

framebuffer pixels

real(kind=wp), public :: up(3) = [0.0_wp, 0.0_wp, 1.0_wp]

the camera's up axis (unit vector, root frame)

real(kind=wp), public :: x = 0.0_wp

the cursor (-1 to 1, y up)

real(kind=wp), public :: y = 0.0_wp

the cursor (-1 to 1, y up)


Source Code

    type, public :: PickCamera
        real(wp) :: eye(3) = 0.0_wp                         !! the eye (root frame)
        real(wp) :: right(3) = [1.0_wp, 0.0_wp, 0.0_wp]     !! the camera's right axis (unit vector, root frame)
        real(wp) :: up(3) = [0.0_wp, 0.0_wp, 1.0_wp]        !! the camera's up axis (unit vector, root frame)
        real(wp) :: forward(3) = [0.0_wp, 1.0_wp, 0.0_wp]   !! the view direction (unit vector, root frame)
        logical :: perspective = .true.                     !! (true: perspective; false: orthographic)
        real(wp) :: tan_y = 0.0_wp                          !! tan(vertical field of view / 2)
        real(wp) :: aspect = 1.0_wp                         !! width / height
        real(wp) :: ortho(4) = [-1.0_wp, 1.0_wp, -1.0_wp, 1.0_wp]   !! (orthographic: left, right, bottom, top)
        real(wp) :: half_w = 1.0_wp, half_h = 1.0_wp        !! half the viewport (framebuffer pixels)
        real(wp) :: x = 0.0_wp, y = 0.0_wp                  !! the cursor (-1 to 1, y up)
        real(wp) :: tolerance = 6.0_wp                      !! framebuffer pixels
        real(wp) :: pixel_ratio = 1.0_wp                    !! framebuffer pixels per window unit (for line widths, marker sizes)
        real(wp) :: near = 0.0_wp                           !! the smallest depth in front of the eye
        integer :: kinds = -1                               !! the kinds of hits wanted: bit k for kind k (all)
        real(wp) :: max_depth = huge(1.0_wp)                !! hits deeper than this aren't wanted (nearest only)
    end type PickCamera