terrain_update Subroutine

private recursive subroutine terrain_update(self, t)

Each frame: if the map's window has closed (the map was released with it), the map again for a window still open (compiled for the windows running), then the frame's update.

Type Bound

TerrainBody

Arguments

Type IntentOptional Attributes Name
class(TerrainBody), intent(inout), target :: self
real(kind=wp), intent(in) :: t

simulation time (s)


Calls

proc~~terrain_update~~CallsGraph proc~terrain_update TerrainBody%terrain_update interface~vkf_compile_node vkf_compile_node proc~terrain_update->interface~vkf_compile_node interface~vkf_node_delete vkf_node_delete proc~terrain_update->interface~vkf_node_delete interface~vkf_node_remove_child vkf_node_remove_child proc~terrain_update->interface~vkf_node_remove_child interface~vkf_rocky_map_alive vkf_rocky_map_alive proc~terrain_update->interface~vkf_rocky_map_alive interface~vkf_viewer_any vkf_viewer_any proc~terrain_update->interface~vkf_viewer_any proc~make_map make_map proc~terrain_update->proc~make_map proc~name ReferenceFrame%name proc~terrain_update->proc~name proc~update ReferenceFrame%update proc~terrain_update->proc~update proc~make_map->proc~name interface~vkf_node_add_child vkf_node_add_child proc~make_map->interface~vkf_node_add_child interface~vkf_rocky_map_create vkf_rocky_map_create proc~make_map->interface~vkf_rocky_map_create proc~apply_layer apply_layer proc~make_map->proc~apply_layer proc~apply_settings apply_settings proc~make_map->proc~apply_settings proc~followed_pose followed_pose proc~update->proc~followed_pose proc~update~2 TrajectoryFollower%update proc~update->proc~update~2 proc~apply_layer->proc~name interface~vkf_rocky_add_elevation vkf_rocky_add_elevation proc~apply_layer->interface~vkf_rocky_add_elevation interface~vkf_rocky_add_image vkf_rocky_add_image proc~apply_layer->interface~vkf_rocky_add_image proc~find_data_file find_data_file proc~apply_layer->proc~find_data_file proc~apply_settings->proc~name interface~vkf_rocky_map_settings vkf_rocky_map_settings proc~apply_settings->interface~vkf_rocky_map_settings proc~color~2 ReferenceFrame%color proc~apply_settings->proc~color~2 proc~quat_from_matrix quat_from_matrix proc~followed_pose->proc~quat_from_matrix proc~quat_multiply quat_multiply proc~followed_pose->proc~quat_multiply proc~quat_normalize quat_normalize proc~followed_pose->proc~quat_normalize proc~rigid_inverse rigid_inverse proc~followed_pose->proc~rigid_inverse proc~state_at TrajectoryFollower%state_at proc~followed_pose->proc~state_at proc~world_matrix_at ReferenceFrame%world_matrix_at proc~followed_pose->proc~world_matrix_at proc~update~2->proc~state_at proc~find_in_dirs find_in_dirs proc~find_data_file->proc~find_in_dirs proc~chosen_trajectory chosen_trajectory proc~state_at->proc~chosen_trajectory proc~data_valid TrajectoryFollower%data_valid proc~state_at->proc~data_valid proc~interpolate_attitude interpolate_attitude proc~state_at->proc~interpolate_attitude proc~interpolate_position interpolate_position proc~state_at->proc~interpolate_position proc~time_index Trajectory%time_index proc~state_at->proc~time_index proc~wrapped_time wrapped_time proc~state_at->proc~wrapped_time proc~world_matrix_at->proc~world_matrix_at proc~local_matrix_at ReferenceFrame%local_matrix_at proc~world_matrix_at->proc~local_matrix_at proc~time_distance Trajectory%time_distance proc~chosen_trajectory->proc~time_distance proc~verify_data Trajectory%verify_data proc~data_valid->proc~verify_data proc~attitude~3 Trajectory%attitude proc~interpolate_attitude->proc~attitude~3 proc~num_attitudes Trajectory%num_attitudes proc~interpolate_attitude->proc~num_attitudes proc~quat_slerp quat_slerp proc~interpolate_attitude->proc~quat_slerp proc~num_points Trajectory%num_points proc~interpolate_position->proc~num_points proc~point_between Trajectory%point_between proc~interpolate_position->proc~point_between proc~point~2 Trajectory%point proc~interpolate_position->proc~point~2 proc~local_matrix_at->proc~followed_pose proc~frame_matrix frame_matrix proc~local_matrix_at->proc~frame_matrix proc~time_index->proc~time_distance proc~time_range~3 Trajectory%time_range proc~wrapped_time->proc~time_range~3 proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix proc~point_between->proc~num_points proc~point_between->proc~point~2 proc~time_fraction Trajectory%time_fraction proc~point_between->proc~time_fraction

Source Code

    recursive subroutine terrain_update(self, t)
        class(TerrainBody), intent(inout), target :: self
        real(wp), intent(in) :: t           !! simulation time (s)
        type(c_ptr) :: viewer
        integer(c_int) :: status
        if (c_associated(self%map)) then
            if (vkf_rocky_map_alive(self%map) == 0) then
                viewer = vkf_viewer_any()
                if (c_associated(viewer)) then
                    status = vkf_node_remove_child(self%map_group, self%map)
                    call vkf_node_delete(self%map)
                    call make_map(self, viewer)
                    if (c_associated(self%map)) then
                        if (vkf_compile_node(self%map) /= 0) &
                            write(*, '(a)') 'vkframes: TerrainBody '//self%name()//': could not compile the map'
                    end if
                end if
            end if
        end if
        call self%ReferenceFrame%update(t)
    end subroutine terrain_update