Cube Struct
Declaration
struct helios::rendering::asset::shape::basic::Cube { ... }
Base struct
| struct | Shape |
|
Struct representing geometric primitives and indices for various shapes. provides immutable, shared access to vertices and indices of the represented geometric shape. More... | |
Public Constructors Index
| Cube () | |
Public Member Functions Index
| helios::rendering::mesh::PrimitiveType | primitiveType () const noexcept override |
Description
Definition at line 24 of file Cube.ixx.
Public Constructors
Cube()
| inline |
Definition at line 26 of file Cube.ixx.
27 Shape(
28 std::vector<Vertex>{
29 // n (z = 1.0)
30 {{-1.0f, -1.0f, 1.0f}, { 0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, // Bottom-left
31 {{ 1.0f, -1.0f, 1.0f}, { 0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, // Bottom-right
32 {{ 1.0f, 1.0f, 1.0f}, { 0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, // Top-right
33 {{-1.0f, 1.0f, 1.0f}, { 0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}}, // Top-left
34
35 // f (z = -1.0)
36 {{-1.0f, -1.0f, -1.0f}, { 0.0f, 0.0f, -1.0f}, {1.0f, 0.0f}}, // Bottom-left
37 {{ 1.0f, -1.0f, -1.0f}, { 0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}}, // Bottom-right
38 {{ 1.0f, 1.0f, -1.0f}, { 0.0f, 0.0f, -1.0f}, {0.0f, 1.0f}}, // Top-right
39 {{-1.0f, 1.0f, -1.0f}, { 0.0f, 0.0f, -1.0f}, {1.0f, 1.0f}}, // Top-left
40
41 // l (x = -1.0)
42 {{-1.0f, -1.0f, -1.0f}, {-1.0f, 0.0f, 0.0f}, {0.0f, 0.0f}}, // Bottom-left
43 {{-1.0f, -1.0f, 1.0f}, {-1.0f, 0.0f, 0.0f}, {1.0f, 0.0f}}, // Bottom-right
44 {{-1.0f, 1.0f, 1.0f}, {-1.0f, 0.0f, 0.0f}, {1.0f, 1.0f}}, // Top-right
45 {{-1.0f, 1.0f, -1.0f}, {-1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}}, // Top-left
46
47 // r (x = 1.0)
48 {{ 1.0f, -1.0f, -1.0f}, { 1.0f, 0.0f, 0.0f}, {1.0f, 0.0f}}, // Bottom-left
49 {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.0f}, {0.0f, 0.0f}}, // Bottom-right
50 {{ 1.0f, 1.0f, 1.0f}, { 1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}}, // Top-right
51 {{ 1.0f, 1.0f, -1.0f}, { 1.0f, 0.0f, 0.0f}, {1.0f, 1.0f}}, // Top-left
52
53 // b (y = -1.0)
54 {{-1.0f, -1.0f, -1.0f}, { 0.0f, -1.0f, 0.0f}, {0.0f, 1.0f}}, // Bottom-left
55 {{ 1.0f, -1.0f, -1.0f}, { 0.0f, -1.0f, 0.0f}, {1.0f, 1.0f}}, // Bottom-right
56 {{ 1.0f, -1.0f, 1.0f}, { 0.0f, -1.0f, 0.0f}, {1.0f, 0.0f}}, // Top-right
57 {{-1.0f, -1.0f, 1.0f}, { 0.0f, -1.0f, 0.0f}, {0.0f, 0.0f}}, // Top-left
58
59 // t (y = 1.0)
60 {{-1.0f, 1.0f, -1.0f}, { 0.0f, 1.0f, 0.0f}, {0.0f, 0.0f}}, // Bottom-left
61 {{ 1.0f, 1.0f, -1.0f}, { 0.0f, 1.0f, 0.0f}, {1.0f, 0.0f}}, // Bottom-right
62 {{ 1.0f, 1.0f, 1.0f}, { 0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, // Top-right
63 {{-1.0f, 1.0f, 1.0f}, { 0.0f, 1.0f, 0.0f}, {0.0f, 1.0f}} // Top-left
64 },
65 std::vector<unsigned int>{
66 // n
67 0, 1, 2, 2, 3, 0,
68 // f
69 4, 5, 6, 6, 7, 4,
70 // l
71 8, 9, 10, 10, 11, 8,
72 // r
73 12, 13, 14, 14, 15, 12,
74 // b
75 16, 17, 18, 18, 19, 16,
76 // t
77 20, 21, 22, 22, 23, 20
78 }
79 ) {}
Public Member Functions
primitiveType()
| inline nodiscard noexcept virtual |
Returns the intended PrimitiveType for this Shape.
This method returns the intended PrimitiveType for the Shape represented by this instance. This information can be used to properly set up the MeshConfig wrapping this Shape.
- Returns
The intended PrimitiveType of this Shape.
Definition at line 81 of file Cube.ixx.
81 [[nodiscard]] helios::rendering::mesh::PrimitiveType primitiveType() const noexcept override {
82 return mesh::PrimitiveType::LineLoop;
83 }
Reference helios::rendering::mesh::LineLoop.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.