88 std::vector<std::vector<Vertex>>
faces;
Builder create_box(float x, float y, float z, NormalsFacing normals_facing, const Rgb &color=colors::white)
Creates a box/cube mesh.
u64 Index
A type alias for the index used in the Builder.
std::array< std::size_t, 4 > Influence4
Builder create_xy_plane(float x, float y, SideCount two_sided, const Rgb &color=colors::white)
SideCount
An enum describing if a face is one or two-sided.
NormalsFacing
The possible directions that normals can face.
Builder create_uv_sphere(float diameter, int longitude_count, int latitude_count, NormalsFacing normals_facing, const Rgb &color=colors::white)
Creates a UV sphere mesh.
Builder create_xz_plane(float x, float z, bool invert, const Rgb &color=colors::white)
Represents a linear sRGB color.
A (inclusive) range between two values.
Represents color in gamma (non-linear) space (aka sRGB).
A helper utility to create a Geom.
Index foa_text_coord(const v2 &v, float max_diff)
Index add_position(const v3 &pos)
std::vector< v3 > lin_colors
in linear space
std::vector< v3 > positions
Builder & add_face(const std::vector< Vertex > &)
void add_weight(const v4 &weight)
void add_influence(const Influence4 &weight)
Index foa_normal(const n3 &norm, float max_diff)
Builder & write_obj(const std::string &path)
std::vector< Influence4 > influences
std::vector< n3 > normals
std::vector< v4 > weights
std::vector< std::vector< Vertex > > faces
Builder & scale(float scale)
Index foa_position(const v3 &pos, float max_diff)
Index add_normal(const n3 &norm)
Builder & move(const v3 &dir)
std::vector< v2 > texcoords
Builder & invert_normals()
Index add_color(const Lin_rgb &color)
Index foa_color(const Lin_rgb &color, float max_diff)
Index add_text_coord(const v2 &tc)
Builder & add_quad(bool ccw, const Vertex &v0, const Vertex &v1, const Vertex &v2, const Vertex &v3)
Builder & add_triangle(const Triangle &t)
A simple triangle face in a Builder.
Triangle(const Vertex &a, const Vertex &b, const Vertex &c)
A single vertex referencing the shared data in the Builder.
Vertex(Index pnt, Index clr)
Vertex(Index a_position, Index a_normal, Index a_texture, Index a_color)