sphere_update Subroutine

private recursive subroutine sphere_update(self, t)

Update the frame (followed trajectories, children) and, with level of detail, build the mesh the views have wanted if it isn't built yet (the coarsest with as many segments as wanted, or the finest).

Type Bound

Sphere

Arguments

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

the scene time


Calls

proc~~sphere_update~~CallsGraph proc~sphere_update Sphere%sphere_update interface~vkf_sphere_lod_requested vkf_sphere_lod_requested proc~sphere_update->interface~vkf_sphere_lod_requested proc~build_lod_mesh build_lod_mesh proc~sphere_update->proc~build_lod_mesh proc~update ReferenceFrame%update proc~sphere_update->proc~update interface~vkf_compile_node vkf_compile_node proc~build_lod_mesh->interface~vkf_compile_node interface~vkf_sphere_lod_add vkf_sphere_lod_add proc~build_lod_mesh->interface~vkf_sphere_lod_add proc~apply_material_to apply_material_to proc~build_lod_mesh->proc~apply_material_to proc~ellipsoid_create ellipsoid_create proc~build_lod_mesh->proc~ellipsoid_create proc~name ReferenceFrame%name proc~build_lod_mesh->proc~name proc~followed_pose followed_pose proc~update->proc~followed_pose proc~update~2 TrajectoryFollower%update proc~update->proc~update~2 proc~apply_material_to->proc~name interface~vkf_mesh_set_twilight vkf_mesh_set_twilight proc~apply_material_to->interface~vkf_mesh_set_twilight proc~color~2 ReferenceFrame%color proc~apply_material_to->proc~color~2 proc~mesh_set_material mesh_set_material proc~apply_material_to->proc~mesh_set_material interface~vkf_mesh_create vkf_mesh_create proc~ellipsoid_create->interface~vkf_mesh_create interface~vkf_mesh_set_bound vkf_mesh_set_bound proc~ellipsoid_create->interface~vkf_mesh_set_bound proc~ellipsoid ellipsoid proc~ellipsoid_create->proc~ellipsoid proc~ellipsoid_size ellipsoid_size proc~ellipsoid_create->proc~ellipsoid_size proc~mesh_arrays mesh_arrays proc~ellipsoid_create->proc~mesh_arrays 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 interface~vkf_mesh_array vkf_mesh_array proc~mesh_arrays->interface~vkf_mesh_array interface~vkf_mesh_material vkf_mesh_material proc~mesh_set_material->interface~vkf_mesh_material interface~vkf_mesh_material_changed vkf_mesh_material_changed proc~mesh_set_material->interface~vkf_mesh_material_changed 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 sphere_update(self, t)
        class(Sphere), intent(inout), target :: self
        real(wp), intent(in) :: t                           !! the scene time
        integer :: wanted, k
        call self%ReferenceFrame%update(t)
        if (.not. c_associated(self%lod_node)) return
        wanted = vkf_sphere_lod_requested(self%lod_node)
        if (wanted <= 0) return
        k = findloc(lod_segments >= wanted, .true., 1)
        if (k == 0) k = size(lod_segments)
        if (.not. c_associated(self%lod_mesh(k))) call build_lod_mesh(self, k, compile=self%shown)
    end subroutine sphere_update