The body: an ellipsoid mesh under the sphere's transform.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Sphere), | intent(inout) | :: | self | |||
| type(c_ptr), | intent(in) | :: | viewer |
a window's viewer (null: headless) |
||
| type(c_ptr), | intent(in) | :: | group |
the frame's contents group |
subroutine sphere_build_contents(self, viewer, group) class(Sphere), intent(inout) :: self type(c_ptr), intent(in) :: viewer !! a window's viewer (null: headless) type(c_ptr), intent(in) :: group !! the frame's contents group type(c_ptr) :: image, night, body image = read_texture(self, self%texture) night = read_texture(self, self%night_texture) self%textured = c_associated(image) self%built_radii = self%radii() self%translucent = self%opacity_ < 1.0_wp if (self%auto_lod_) then ! meshes chosen per view, built when wanted self%image = image ! (kept for those built later) self%night = night self%shown = c_associated(viewer) self%lod_node = vkf_sphere_lod_create(maxval(self%built_radii)) call build_lod_mesh(self, lod_first, compile=.false.) ! (compiled with the scene) if (.not. c_associated(self%lod_mesh(lod_first))) return body = self%lod_node else self%mesh = ellipsoid_create(self%built_radii, [1.0_c_float, 1.0_c_float, 1.0_c_float, 1.0_c_float], image, & self%n_lon, self%n_lat, night, translucent=self%translucent) if (c_associated(image)) call vkf_image_delete(image) if (c_associated(night)) call vkf_image_delete(night) if (.not. c_associated(self%mesh)) return body = self%mesh end if call apply_material(self) self%sphere_node = vkf_transform_create() call update_sphere_transform(self) if (vkf_node_add_child(self%sphere_node, body) /= 0 .or. vkf_node_add_child(group, self%sphere_node) /= 0) & write(*, '(a)') 'vkframes: Sphere '//self%name()//': could not build the scene' end subroutine sphere_build_contents