vkmEngine 1.0.15
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 depth = 1.0f,
57 uint32_t widthSegments = 1,
58 uint32_t depthSegments = 1
59);
60
65MeshAsset generateCube();
66
75MeshAsset generateSphere(uint32_t resolution = 16);
76
83MeshAsset generatePyramid(float baseSize = 1.0f, float height = 1.0f);
84
96MeshAsset generateCone(float radius = 0.5f, float height = 1.0f, uint32_t segments = 16);
97
110MeshAsset generateCylinder(float radius = 0.5f, float height = 1.0f, uint32_t segments = 20);
111
124MeshAsset generateRing(float innerRadius = 0.25f, float outerRadius = 0.5f, uint32_t segments = 32);
125
126} // namespace Vkm::Engine
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