Added GeometryFactory classes

This commit is contained in:
Vladyslav Baranovskyi
2024-06-13 23:34:14 +03:00
parent 1385b43e55
commit d26d6cfff3
2 changed files with 332 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "Geometry.hpp"
namespace OpenVulkano::Scene
{
class GeometryFactory
{
public:
static Geometry* MakeCube(float x = 1, float y = 1, float z = 1, const Math::Vector4f& color = Math::Vector4f(1));
static Geometry* MakePlane(float width = 1, float height = 1, const Math::Vector4f& color = Math::Vector4f(1));
static Geometry* MakeSphere(float radius, uint32_t segments, uint32_t rings, const Math::Vector4f& color = Math::Vector4f(1));
static Geometry* MakeHemisphere(float radius, uint32_t segments, uint32_t rings, const Math::Vector4f& color = Math::Vector4f(1));
static Geometry* MakeTriangle(const Math::Vector3f& p1, const Math::Vector3f& p2, const Math::Vector3f& p3, const Math::Vector4f& color = Math::Vector4f(1));
static Geometry* MakeCylinder(float radius, float height, uint32_t segments, const Math::Vector4f& color = Math::Vector4f(1));
static Geometry* MakePyramid(float baseLength = 1, float height = 1, const Math::Vector4f& color = Math::Vector4f(1));
};
}