Skip to main content

Rhombus.ixx File

Diamond/rhombus shape primitive for rendering. More...

Included Headers

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespaceasset

Rendering asset management. More...

namespaceshape

Geometric shape definitions. More...

namespacebasic

Basic primitive shapes. More...

Classes Index

structRhombus

A 2D rhombus (diamond) shape primitive. More...

Description

Diamond/rhombus shape primitive for rendering.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file Rhombus.ixx
3 * @brief Diamond/rhombus shape primitive for rendering.
4 */
5module;
6
7#include <vector>
8
9export module helios.rendering.asset.shape.basic.Rhombus;
10
11import helios.rendering.asset.shape.Shape;
12import helios.rendering.Vertex;
13import helios.rendering.mesh.PrimitiveType;
14
15using namespace helios::rendering;
16
18
19 /**
20 * @brief A 2D rhombus (diamond) shape primitive.
21 *
22 * Creates a diamond shape centered at the origin with vertices at:
23 * - Left: (-0.5, 0.0)
24 * - Top: (0.0, 0.25)
25 * - Right: (0.5, 0.0)
26 * - Bottom: (0.0, -0.25)
27 *
28 * The shape spans 1 units horizontally and 0.5 units vertically.
29 *
30 * ```
31 * (0, 0.25)
32 * /\
33 * / \
34 * / \
35 * (-0.5,0) (0.5,0)
36 * \ /
37 * \ /
38 * \/
39 * (0, -0.25)
40 * ```
41 *
42 * Default primitive type is Lines (wireframe rendering).
43 */
44 struct Rhombus : public Shape {
45
46 /**
47 * @brief Constructs a rhombus shape with predefined vertices.
48 */
50 std::vector<Vertex>{
51
52 {{ -0.5f, 0.0f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
53 {{ 0.0f, 0.25f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
54 {{ 0.0f, -0.25f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
55 {{ 0.5f, 0.0f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}}
56
57 },
58 std::vector<unsigned int>{
59 2, 3, 1, 0, 2, 1,
60 }
61 ) {}
62
63 /**
64 * @brief Returns the primitive type for rendering.
65 *
66 * @return PrimitiveType::Lines for wireframe rendering.
67 */
68 [[nodiscard]] helios::rendering::mesh::PrimitiveType primitiveType() const noexcept override {
70 }
71
72 };
73
74}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.