model_pick Subroutine

private subroutine model_pick(self, cam, to_root, hits, n)

Picked on the model's bounding sphere (not its triangles); else at the frame's origin.

Type Bound

Model

Arguments

Type IntentOptional Attributes Name
class(Model), intent(in), target :: self
type(PickCamera), intent(in) :: cam

the cursor's ray and the pick's settings

real(kind=wp), intent(in) :: to_root(4,4)

the frame's transform to the root frame

type(PickHit), intent(inout), allocatable :: hits(:)

hits so far (grown as needed)

integer, intent(inout) :: n

number of hits in hits


Calls

proc~~model_pick~~CallsGraph proc~model_pick Model%model_pick proc~contents_shown ReferenceFrame%contents_shown proc~model_pick->proc~contents_shown proc~identity_matrix identity_matrix proc~model_pick->proc~identity_matrix proc~model_frame_bound Model%model_frame_bound proc~model_pick->proc~model_frame_bound proc~pick ReferenceFrame%pick proc~model_pick->proc~pick proc~pick_ellipsoid pick_ellipsoid proc~model_pick->proc~pick_ellipsoid proc~frame_matrix frame_matrix proc~model_frame_bound->proc~frame_matrix proc~add_pick_hit add_pick_hit proc~pick->proc~add_pick_hit proc~point_pick point_pick proc~pick->proc~point_pick proc~wants wants proc~pick->proc~wants proc~pick_ellipsoid->proc~add_pick_hit proc~ray ray proc~pick_ellipsoid->proc~ray proc~ray_ellipsoid ray_ellipsoid proc~pick_ellipsoid->proc~ray_ellipsoid proc~pick_ellipsoid->proc~wants proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix proc~project project proc~point_pick->proc~project

Source Code

    subroutine model_pick(self, cam, to_root, hits, n)
        class(Model), intent(in), target :: self
        type(PickCamera), intent(in) :: cam                 !! the cursor's ray and the pick's settings
        real(wp), intent(in) :: to_root(4,4)                !! the frame's transform to the root frame
        type(PickHit), allocatable, intent(inout) :: hits(:)  !! hits so far (grown as needed)
        integer, intent(inout) :: n                         !! number of hits in hits
        real(wp) :: c(3), r, m(4,4)
        call self%bound(c, r)
        if (self%contents_shown() .and. r > 0.0_wp) then
            m = identity_matrix()
            if (pick_ellipsoid(self, cam, to_root, c, m(1:3, 1:3), [r, r, r], .false., hits, n)) return
        end if
        call self%ReferenceFrame%pick(cam, to_root, hits, n)
    end subroutine model_pick