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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(WindowProxy), | intent(inout) | :: | self | |||
| type(View), | intent(in), | target | :: | v |
the view flown to |
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