Skip to main content

WireframeCube Struct

Static wireframe cube mesh definition. More...

Declaration

struct helios::engine::rendering::mesh::assets::WireframeCube { ... }

Public Static Functions Index

static MeshDatameshData ()

Creates a lightweight MeshData view over the static cube buffers. More...

static helios::math::aabbfboundsData ()

Returns the local bounds of this mesh. More...

Public Static Attributes Index

static constexpr std::array< Vertex, 8 >vertices = ...

Cube corner vertices. More...

static constexpr std::array< unsigned int, 24 >indices = ...

Line index buffer. More...

static constexpr PrimitiveTypeprimitiveType = PrimitiveType::Lines

Primitive topology used to interpret indices. More...

Description

Static wireframe cube mesh definition.

The cube is centered at the origin and spans from -0.5 to +0.5 on all three axes. It is rendered as line segments.

Definition at line 28 of file WireframeCube.ixx.

Public Static Functions

boundsData()

helios::math::aabbf helios::engine::rendering::mesh::assets::WireframeCube::boundsData ()
inline static

Returns the local bounds of this mesh.

Returns

local bounds as aabb

Definition at line 94 of file WireframeCube.ixx.

94 static helios::math::aabbf boundsData() {
95 return helios::math::aabbf{
96 -0.5f, -0.5f, -0.5f,
97 0.5f, 0.5f, 0.5f
98 };
99 }

meshData()

MeshData helios::engine::rendering::mesh::assets::WireframeCube::meshData ()
inline static

Creates a lightweight MeshData view over the static cube buffers.

Returns

MeshData referencing vertices, indices, and primitiveType.

Definition at line 82 of file WireframeCube.ixx.

82 static MeshData meshData() {
83 return MeshData{
84 std::span{vertices},
85 std::span{indices},
87 };
88 }

References indices, primitiveType and vertices.

Public Static Attributes

indices

constexpr std::array<unsigned int, 24> helios::engine::rendering::mesh::assets::WireframeCube::indices
constexpr static

Line index buffer.

Initialiser
= { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 }

Every pair of indices describes one edge.

Definition at line 53 of file WireframeCube.ixx.

53 static constexpr std::array<unsigned int, 24> indices = {
54 // back face
55 0, 1,
56 1, 2,
57 2, 3,
58 3, 0,
59
60 // front face
61 4, 5,
62 5, 6,
63 6, 7,
64 7, 4,
65
66 // connecting edges
67 0, 4,
68 1, 5,
69 2, 6,
70 3, 7
71 };

Referenced by meshData.

primitiveType

constexpr PrimitiveType helios::engine::rendering::mesh::assets::WireframeCube::primitiveType = PrimitiveType::Lines
constexpr static

Primitive topology used to interpret indices.

Definition at line 76 of file WireframeCube.ixx.

76 static constexpr PrimitiveType primitiveType = PrimitiveType::Lines;

Referenced by meshData.

vertices

constexpr std::array<Vertex, 8> helios::engine::rendering::mesh::assets::WireframeCube::vertices
constexpr static

Cube corner vertices.

Initialiser
{{ {{-0.5f, -0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, {{ 0.5f, -0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, {{ 0.5f, 0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, {{-0.5f, 0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}}, {{-0.5f, -0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, {{ 0.5f, -0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, {{ 0.5f, 0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, {{-0.5f, 0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}} }}

Normals and UVs are included to match the common Vertex layout, but are not relevant for simple wireframe rendering.

Definition at line 36 of file WireframeCube.ixx.

36 static constexpr std::array<Vertex, 8> vertices{{
37 {{-0.5f, -0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, // 0
38 {{ 0.5f, -0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, // 1
39 {{ 0.5f, 0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, // 2
40 {{-0.5f, 0.5f, -0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}}, // 3
41
42 {{-0.5f, -0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f}}, // 4
43 {{ 0.5f, -0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, // 5
44 {{ 0.5f, 0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, // 6
45 {{-0.5f, 0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}} // 7
46 }};

Referenced by meshData.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.