VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
skyMesh.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 09.10.2025.
5//
6
7#pragma once
8
9#include <memory>
12#include <scene/meshInstance.h>
14#include <scene/mesh.h>
15
16namespace visutwin::canvas
17{
18 class GraphicsDevice;
19 class Scene;
20 class Texture;
21 class GraphNode;
22
26 class SkyMesh
27 {
28 public:
29 SkyMesh(const std::shared_ptr<GraphicsDevice>& device, Scene* scene, GraphNode* node, Texture* texture, int type);
30 ~SkyMesh();
31
32 MeshInstance* meshInstance() const { return _meshInstance.get(); }
33
35 static std::shared_ptr<Mesh> createSphereMesh(const std::shared_ptr<GraphicsDevice>& device,
36 int latBands = 64, int lonBands = 64);
37
38 private:
39 std::shared_ptr<Mesh> createInfiniteMesh(const std::shared_ptr<GraphicsDevice>& device) const;
40 std::shared_ptr<Mesh> createBoxMesh(const std::shared_ptr<GraphicsDevice>& device) const;
41 std::shared_ptr<Mesh> createDomeMesh(const std::shared_ptr<GraphicsDevice>& device) const;
42 std::shared_ptr<Mesh> createMeshByType(const std::shared_ptr<GraphicsDevice>& device, int type) const;
43
44 Scene* _scene = nullptr;
45 std::shared_ptr<Material> _material;
46 std::shared_ptr<Mesh> _mesh;
47 std::unique_ptr<MeshInstance> _meshInstance;
48 };
49}
Hierarchical scene graph node with local/world transforms and parent-child relationships.
Definition graphNode.h:28
Abstract GPU interface for resource creation, state management, and draw submission.
Renderable instance of a Mesh with its own material, transform node, and optional GPU instancing.
Container for the scene graph, lighting environment, fog, skybox, and layer composition.
Definition scene.h:29
MeshInstance * meshInstance() const
Definition skyMesh.h:32
static std::shared_ptr< Mesh > createSphereMesh(const std::shared_ptr< GraphicsDevice > &device, int latBands=64, int lonBands=64)
Create a full UV sphere mesh (no flattening). Used for atmosphere sky.
Definition skyMesh.cpp:336
SkyMesh(const std::shared_ptr< GraphicsDevice > &device, Scene *scene, GraphNode *node, Texture *texture, int type)
Definition skyMesh.cpp:178
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.
Definition texture.h:57