sync Subroutine

private recursive subroutine sync(self)

Copy the positions and attitudes of this frame and its descendants to their transform nodes (only those that changed since the last sync).

Type Bound

ReferenceFrame

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(inout) :: self

Calls

proc~~sync~~CallsGraph proc~sync ReferenceFrame%sync proc~sync->proc~sync interface~vkf_transform_set_matrix vkf_transform_set_matrix proc~sync->interface~vkf_transform_set_matrix proc~check_status check_status proc~sync->proc~check_status proc~local_matrix ReferenceFrame%local_matrix proc~sync->proc~local_matrix proc~frame_matrix frame_matrix proc~local_matrix->proc~frame_matrix proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix

Called by

proc~~sync~~CalledByGraph proc~sync ReferenceFrame%sync proc~sync->proc~sync proc~fm_update FrameManager%fm_update proc~fm_update->proc~sync proc~frame WindowProxy%frame proc~frame->proc~sync proc~realize ReferenceFrame%realize proc~frame->proc~realize proc~realize->proc~sync proc~realize->proc~realize proc~add_child ReferenceFrame%add_child proc~add_child->proc~realize proc~resize WindowProxy%resize proc~resize->proc~frame proc~run WindowProxy%run proc~run->proc~frame

Source Code

    recursive subroutine sync(self)
        class(ReferenceFrame), intent(inout) :: self
        integer :: k
        if (.not. self%realized) return
        if (.not. (self%synced .and. all(self%position_ == self%synced_position) .and. &
                   all(self%attitude_ == self%synced_attitude))) then
            call check_status(vkf_transform_set_matrix(self%node_, self%local_matrix()))
            self%synced_position = self%position_
            self%synced_attitude = self%attitude_
            self%synced = .true.
        end if
        do k = 1, self%n_children
            call self%children(k)%p%sync()
        end do
    end subroutine sync