fly Subroutine

private subroutine fly(self, v)

The camera of an active flight to view v, at this moment: both cameras in the root frame (their views' frames as they are now), in between by the eased fraction of the time passed, back in v's frame.

Arguments

Type IntentOptional Attributes Name
type(WindowProxy), intent(inout) :: self
type(View), intent(in), target :: v

the view flown to


Calls

proc~~fly~~CallsGraph proc~fly fly proc~camera_between camera_between proc~fly->proc~camera_between proc~put_camera put_camera proc~fly->proc~put_camera proc~rigid_inverse rigid_inverse proc~fly->proc~rigid_inverse proc~transform_camera transform_camera proc~fly->proc~transform_camera proc~window_wall window_wall proc~fly->proc~window_wall proc~world_to_view View%world_to_view proc~fly->proc~world_to_view proc~camera_orientation camera_orientation proc~camera_between->proc~camera_orientation proc~quat_normalize quat_normalize proc~camera_between->proc~quat_normalize proc~quat_slerp quat_slerp proc~camera_between->proc~quat_slerp proc~quat_to_matrix quat_to_matrix proc~camera_between->proc~quat_to_matrix interface~vkf_viewer_look_at vkf_viewer_look_at proc~put_camera->interface~vkf_viewer_look_at proc~wall_time wall_time proc~window_wall->proc~wall_time proc~world_to_view->proc~rigid_inverse proc~frame_to_root frame_to_root proc~world_to_view->proc~frame_to_root proc~identity_matrix identity_matrix proc~world_to_view->proc~identity_matrix proc~quat_from_vectors quat_from_vectors proc~world_to_view->proc~quat_from_vectors proc~world_to_view->proc~quat_to_matrix proc~rotated rotated proc~world_to_view->proc~rotated proc~translation_matrix translation_matrix proc~world_to_view->proc~translation_matrix proc~cross cross proc~camera_orientation->proc~cross proc~quat_from_matrix quat_from_matrix proc~camera_orientation->proc~quat_from_matrix proc~frame_to_root->proc~rigid_inverse proc~world_matrix ReferenceFrame%world_matrix proc~frame_to_root->proc~world_matrix proc~quat_from_vectors->proc~quat_normalize proc~quat_from_vectors->proc~cross proc~translation_matrix->proc~identity_matrix proc~world_matrix->proc~world_matrix proc~local_matrix ReferenceFrame%local_matrix proc~world_matrix->proc~local_matrix proc~frame_matrix frame_matrix proc~local_matrix->proc~frame_matrix proc~frame_matrix->proc~quat_to_matrix

Called by

proc~~fly~~CalledByGraph proc~fly fly proc~place_camera place_camera proc~place_camera->proc~fly proc~frame WindowProxy%frame proc~frame->proc~place_camera proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame

Source Code

    subroutine fly(self, v)
        type(WindowProxy), intent(inout) :: self
        type(View), intent(in), target :: v                 !! the view flown to
        real(wp) :: s, from(3,3), to(3,3), m(4,4)
        if (.not. self%flight%active) return
        if (.not. associated(self%flight%to, v)) then             ! (another view since)
            self%flight%active = .false.
            return
        end if
        s = (window_wall(self) - self%flight%started) / self%flight%duration
        if (s >= 1.0_wp) then
            self%flight%active = .false.
            call put_camera(self, self%flight%finish)
            return
        end if
        s = s * s * (3.0_wp - 2.0_wp * s)                           ! (eased in and out)
        m = v%world_to_view()
        from = transform_camera(rigid_inverse(self%flight%from%world_to_view()), self%flight%start)
        to = transform_camera(rigid_inverse(m), self%flight%finish)
        call put_camera(self, transform_camera(m, camera_between(s, from, to)))
    end subroutine fly