model_frame_bound Subroutine

private subroutine model_frame_bound(self, center, radius)

The model's bounding sphere in the frame (through the model transform).

Type Bound

Model

Arguments

Type IntentOptional Attributes Name
class(Model), intent(in) :: self
real(kind=wp), intent(out) :: center(3)

the bounding sphere, frame coordinates (scene units)

real(kind=wp), intent(out) :: radius

the bounding sphere, frame coordinates (scene units)


Calls

proc~~model_frame_bound~~CallsGraph proc~model_frame_bound Model%model_frame_bound proc~frame_matrix frame_matrix proc~model_frame_bound->proc~frame_matrix proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix

Called by

proc~~model_frame_bound~~CalledByGraph proc~model_frame_bound Model%model_frame_bound proc~model_pick Model%model_pick proc~model_pick->proc~model_frame_bound

Source Code

    subroutine model_frame_bound(self, center, radius)
        class(Model), intent(in) :: self
        real(wp), intent(out) :: center(3), radius          !! the bounding sphere, frame coordinates (scene units)
        real(wp) :: m(4,4)
        m = frame_matrix(self%model_position_, self%model_attitude_, self%scale_, self%pivot_)
        center = matmul(m(1:3, 1:3), self%bound_center) + m(1:3, 4)
        radius = self%bound_radius * maxval(abs(self%scale_))
    end subroutine model_frame_bound