set_model Function

private function set_model(self, file) result(ok)

Read the model file (now, so its bound is known). Returns false if it could not be read. Set it before a window first shows the model.

Type Bound

Model

Arguments

Type IntentOptional Attributes Name
class(Model), intent(inout) :: self
character(len=*), intent(in) :: file

model file (3ds, obj, glTF, ...)

Return Value logical


Calls

proc~~set_model~~CallsGraph proc~set_model Model%set_model interface~vkf_model_read vkf_model_read proc~set_model->interface~vkf_model_read interface~vkf_node_bound vkf_node_bound proc~set_model->interface~vkf_node_bound

Called by

proc~~set_model~~CalledByGraph proc~set_model Model%set_model proc~new_model new_model proc~new_model->proc~set_model interface~model Model interface~model->proc~new_model

Source Code

    logical function set_model(self, file) result(ok)
        class(Model), intent(inout) :: self
        character(len=*), intent(in) :: file                !! model file (3ds, obj, glTF, ...)
        type(c_ptr) :: node
        node = vkf_model_read(file, len(file, kind=c_int))
        ok = c_associated(node)
        if (.not. ok) return
        self%file = file
        self%model_ = node
        if (vkf_node_bound(node, self%bound_center, self%bound_radius) /= 0) then
            self%bound_center = 0.0_wp
            self%bound_radius = 0.0_wp
        end if
    end function set_model