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 | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Model), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | file |
model file (3ds, obj, glTF, ...) |
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