vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
mesh_generators.h
1#pragma once
2
3#include <nlohmann/json_fwd.hpp>
4
5#include "resource/asset/mesh_asset.h"
6#include "resource/resource_handle.h"
7
8namespace Vkm::Engine {
9
10class ResourceManager;
11
25MeshHandle addGeneratedMesh(ResourceManager& resources, MeshAsset mesh);
26
37MeshHandle createGeneratedMesh(const nlohmann::json& source, ResourceManager& resources);
38
44MeshAsset generateTriangle(float size = 1.0f);
45
54MeshAsset generatePlane(
55 float width = 1.0f,
56 float height = 1.0f,
57 uint32_t widthSegments = 1,
58 uint32_t heightSegments = 1
59);
60
65MeshAsset generateCube();
66
77MeshAsset generateSphere(uint32_t xSegments = 32, uint32_t ySegments = 16);
78
85MeshAsset generatePyramid(float baseSize = 1.0f, float height = 1.0f);
86
98MeshAsset generateCone(float radius = 0.5f, float height = 1.0f, uint32_t segments = 16);
99
112MeshAsset generateCylinder(float radius = 0.5f, float height = 1.0f, uint32_t segments = 20);
113
114} // namespace Vkm::Engine
Open type-erased resource registry with typed handles and generational lifetimes.
Definition resource_manager.h:46
CPU-side geometry: indexed triangle mesh plus a cached local-space AABB.
Definition mesh_asset.h:51