nngn
Loading...
Searching...
No Matches
nngn::Models Class Reference

#include <model.h>

Public Types

enum  Flag : u8 { DEDUP = 1u << 0 , CALC_NORMALS = 1u << 1 }
 

Static Public Member Functions

static bool load (const char *path, u32 tex, u8 flags, std::vector< Vertex > *vertices, std::vector< u32 > *indices)
 Reads an OBJ file as a list of vertices/indices.
 
static void calculate_normals (std::vector< Vertex >::iterator b_vtx, std::vector< Vertex >::iterator i_vtx, std::vector< Vertex >::iterator e_vtx, std::vector< u32 >::const_iterator b_idx, std::vector< u32 >::const_iterator e_idx)
 

Member Enumeration Documentation

◆ Flag

Enumerator
DEDUP 
CALC_NORMALS 

Member Function Documentation

◆ calculate_normals()

void nngn::Models::calculate_normals ( std::vector< Vertex >::iterator  b_vtx,
std::vector< Vertex >::iterator  i_vtx,
std::vector< Vertex >::iterator  e_vtx,
std::vector< u32 >::const_iterator  b_idx,
std::vector< u32 >::const_iterator  e_idx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

bool nngn::Models::load ( const char *  path,
u32  tex,
u8  flags,
std::vector< Vertex > *  vertices,
std::vector< u32 > *  indices 
)
static

Reads an OBJ file as a list of vertices/indices.

Both vectors are input/output arguments: existing values will be preserved, new values will be appended.

Parameters
verticesFilled with position/texture/normal values from the OBJ file, with one exception: the third texture coordinate of every element is set to (float)tex.
indicesIndices into vertices, adjusted as necessary if it already contains data.
Here is the call graph for this function:

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