Circle.ixx File
Basic circle shape for rendering. More...
Included Headers
#include <vector>
#include <cmath>
#include <numbers>
#include <helios.rendering.mesh.PrimitiveType>
#include <helios.math.types>
#include <helios.rendering.Vertex>
#include <helios.rendering.asset.shape.Shape>
Namespaces Index
| namespace | helios |
| namespace | rendering |
|
Graphics rendering infrastructure. More... | |
| namespace | asset |
|
Rendering asset management. More... | |
| namespace | shape |
|
Geometric shape definitions. More... | |
| namespace | basic |
|
Basic primitive shapes. More... | |
Classes Index
| struct | Circle |
Description
Basic circle shape for rendering.
File Listing
The file content with the documentation metadata removed is:
18using namespace helios::rendering;
20export namespace helios::rendering::asset::shape::basic {
37 std::vector<Vertex> vertices;
39 vertices.reserve(segments + 1);
42 vertices.push_back({
51 const float angle = (static_cast<float>(i) / static_cast<float>(segments)) * 2.0f * std::numbers::pi_v<float>;
60 vertices.push_back({
66 return vertices;
74 std::vector<unsigned int> indices;
75 indices.reserve(segments * 3); // 'segments' triangles, 3 indices per triangle
78 indices.push_back(0); // center vertex
79 indices.push_back(i); // current circumference vertex
85 indices.push_back(next_i);
87 return indices;
104 Shape(
109 [[nodiscard]] helios::rendering::mesh::PrimitiveType primitiveType() const noexcept override {
110 return mesh::PrimitiveType::Triangles;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.