Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::Builder Class Reference

Factory that generates MeshData for common geometric primitives. More...

#include <Builder.h>

Static Public Member Functions

static MeshData CreateRectangle (f32 width, f32 height)
 Create a flat quad with the given dimensions.
 
static MeshData CreateCube (f32 width, f32 height)
 Create a box (6 faces) with the given dimensions.
 
static MeshData CreateTriangle (f32 size)
 Create an equilateral triangle centred at the origin.
 
static MeshData CreateFullscreenQuad ()
 Create a clip-space quad covering the entire screen.
 

Detailed Description

Factory that generates MeshData for common geometric primitives.

All methods are static — Builder is never instantiated. Generated shapes follow a consistent winding order (counter-clockwise front face) compatible with the engine's default back-face culling state.

Definition at line 63 of file Builder.h.

Member Function Documentation

◆ CreateCube()

MeshData mnd::Builder::CreateCube ( f32  width,
f32  height 
)
static

Create a box (6 faces) with the given dimensions.

Parameters
widthExtent along X.
heightExtent along Y (also used for Z in the current implementation).

Definition at line 15 of file Builder.cpp.

References mnd::VertexLayout::elements, mnd::MeshData::indices, mnd::MeshData::layout, mnd::VertexLayout::stride, and mnd::MeshData::vertices.

◆ CreateFullscreenQuad()

MeshData mnd::Builder::CreateFullscreenQuad ( )
static

Create a clip-space quad covering the entire screen.

Useful for post-processing or Shadertoy-style full-screen fragment shaders. The quad spans NDC [-1, 1] in both X and Y.

Definition at line 151 of file Builder.cpp.

References mnd::VertexLayout::elements, mnd::MeshData::indices, mnd::MeshData::layout, mnd::VertexLayout::stride, and mnd::MeshData::vertices.

◆ CreateRectangle()

MeshData mnd::Builder::CreateRectangle ( f32  width,
f32  height 
)
static

Create a flat quad with the given dimensions.

Parameters
widthExtent along the X axis.
heightExtent along the Y axis.

Definition at line 97 of file Builder.cpp.

References mnd::VertexLayout::elements, mnd::MeshData::indices, mnd::MeshData::layout, mnd::VertexLayout::stride, and mnd::MeshData::vertices.

Referenced by mnd::ParticleSystem::Init().

◆ CreateTriangle()

MeshData mnd::Builder::CreateTriangle ( f32  size)
static

Create an equilateral triangle centred at the origin.

Parameters
sizeSide length.

Definition at line 124 of file Builder.cpp.

References mnd::VertexLayout::elements, mnd::MeshData::indices, mnd::MeshData::layout, mnd::VertexLayout::stride, and mnd::MeshData::vertices.


The documentation for this class was generated from the following files: