CPP-TOOLBOX
Loading...
Searching...
No Matches
vertex_geometry Namespace Reference

Classes

class  AxisAlignedBoundingBox
 
class  AxisAlignedBoundingBox2D
 
class  Grid
 
class  NGon
 
class  Rectangle
 

Enumerations

enum class  TriangulationMode { CentralFan , VertexFan }
 

Functions

std::ostream & operator<< (std::ostream &os, const Rectangle &rect)
 
float dot (const glm::vec3 &a, const glm::vec3 &b)
 
bool is_right_angle (const glm::vec3 &a, const glm::vec3 &b, const glm::vec3 &c)
 
std::string strip_leading_newlines (const std::string &text)
 
bool circle_intersects_rect (float cx, float cy, float radius, const Rectangle &rect)
 
std::vector< Rectangleget_rects_intersecting_circle (const Grid &grid, float cx, float cy, float radius)
 
draw_info::IndexedVertexPositions text_grid_to_rect_grid (const std::string &text_grid, const vertex_geometry::Rectangle bounding_rect)
 
draw_info::IndexedVertexPositions generate_rectangle_between_2d (const glm::vec2 &p1, const glm::vec2 &p2, float thickness)
 
bool are_valid_rectangle_corners (const glm::vec3 &top_left, const glm::vec3 &top_right, const glm::vec3 &bottom_left, const glm::vec3 &bottom_right)
 
Rectangle create_rectangle_from_corners (const glm::vec3 top_left, const glm::vec3 top_right, const glm::vec3 bottom_left, const glm::vec3 bottom_right)
 
Rectangle create_rectangle (float x_pos, float y_pos, float width, float height)
 
Rectangle create_rectangle_from_top_left (const glm::vec3 &top_left, float width, float height)
 
Rectangle create_rectangle_from_top_right (const glm::vec3 &top_right, float width, float height)
 
Rectangle create_rectangle_from_bottom_left (const glm::vec3 &bottom_left, float width, float height)
 
Rectangle create_rectangle_from_bottom_right (const glm::vec3 &bottom_right, float width, float height)
 
Rectangle create_rectangle_from_center_left (const glm::vec3 &center_left, float width, float height)
 
Rectangle create_rectangle_from_center (const glm::vec3 &center, float width, float height)
 
draw_info::IndexedVertexPositions triangulate_ngon (const NGon &ngon)
 
draw_info::IndexedVertexPositions connect_ngons (const NGon &a, const NGon &b)
 
Rectangle expand_rectangle (const Rectangle &rect, float x_expand, float y_expand)
 
Rectangle shrink_rectangle (const Rectangle &rect, float x_shrink, float y_shrink)
 
Rectangle scale_rectangle_from_left_side (const Rectangle &rect, float x_shrink, float y_shrink)
 
Rectangle slide_rectangle (const Rectangle &rect, int x_offset, int y_offset)
 
Rectangle get_bounding_rectangle (const std::vector< Rectangle > &rectangles)
 
std::vector< Rectanglesubdivide_rectangle (const Rectangle &rect, unsigned int num_subdivisions, bool vertical)
 
std::vector< Rectanglevertical_weighted_subdivision (const Rectangle &rect, const std::vector< unsigned int > &weights)
 
std::vector< Rectanglehorizontal_weighted_subdivision (const Rectangle &rect, const std::vector< unsigned int > &weights)
 
std::vector< Rectangleweighted_subdivision (const Rectangle &rect, const std::vector< unsigned int > &weights, bool vertical)
 
std::vector< Rectanglegenerate_grid_rectangles (const glm::vec3 &center_position, float width, float height, int num_rectangles_x, int num_rectangles_y, float spacing)
 
draw_info::IndexedVertexPositions generate_grid (const glm::vec3 &center_position, float base_width, float base_height, int num_rectangles_x, int num_rectangles_y, float spacing)
 
std::vector< unsigned int > flatten_and_increment_indices (const std::vector< std::vector< unsigned int > > &indices)
 Flattens and increments a collection of index sets.
 
std::vector< glm::vec3 > generate_square_vertices (float center_x, float center_y, float side_length)
 
std::vector< unsigned int > generate_square_indices ()
 
draw_info::IndexedVertexPositions generate_rectangle (float center_x, float center_y, float width, float height)
 
draw_info::IndexedVertexPositions generate_rectangle (float center_x, float center_y, float center_z, float width, float height)
 
std::vector< glm::vec3 > generate_rectangle_vertices (float center_x, float center_y, float width, float height)
 
std::vector< glm::vec3 > generate_rectangle_vertices_with_z (float center_x, float center_y, float center_z, float width, float height)
 
draw_info::IndexedVertexPositions generate_cone_between (const glm::vec3 &base, const glm::vec3 &tip, int segments, float radius)
 
draw_info::IVPNormals generate_torus (int major_segments, int minor_segments, float major_radius, float minor_radius)
 
draw_info::IVPNormals generate_cube (float size)
 
draw_info::IVPNormals generate_box (float size_x, float size_y, float size_z)
 
draw_info::IVPNormals generate_cone (int segments, float height, float radius)
 
draw_info::IndexedVertexPositions generate_cylinder_between (const glm::vec3 &p1, const glm::vec3 &p2, int segments, float radius)
 
draw_info::IVPNormals generate_cylinder (int segments, float height, float radius)
 
std::vector< glm::vec3 > generate_initial_icosahedron_vertices (float radius)
 
std::vector< unsigned int > generate_initial_icosahedron_indices ()
 
int get_midpoint (int a, int b, std::map< std::pair< int, int >, int > &midpoint_cache, std::vector< glm::vec3 > &vertices, float radius)
 
void subdivide_icosahedron (int subdivisions, std::vector< glm::vec3 > &vertices, std::vector< unsigned int > &indices, float radius)
 
std::vector< glm::vec3 > compute_sphere_normals (const std::vector< glm::vec3 > &vertices)
 
draw_info::IVPNormals generate_icosphere (int subdivisions, float radius)
 
float noise (float x, float z, float seed=0.0f)
 
float fractal_noise (float x, float z, int octaves, float persistence, float scale, float seed=0.0f)
 
draw_info::IVPNormals generate_terrain (float size_x, float size_z, int resolution_x, int resolution_z, float max_height, float base_height, int octaves, float persistence, float scale, float seed)
 
glm::vec3 f (double t)
 
glm::vec3 compute_tangent_finite_difference (std::function< glm::vec3(double)> f, double t, double delta)
 
std::vector< std::pair< glm::vec3, glm::vec3 > > sample_points_and_tangents (std::function< glm::vec3(double)> f, double t_start, double t_end, double step_size, double finite_diff_delta)
 
draw_info::IndexedVertexPositions connect_points_by_rectangles (const std::vector< glm::vec2 > &points)
 
draw_info::IndexedVertexPositions generate_function_visualization (std::function< glm::vec3(double)> f, double t_start, double t_end, double step_size, double finite_diff_delta, float radius, int segments)
 
draw_info::IndexedVertexPositions generate_segmented_cylinder (const std::vector< std::pair< glm::vec3, glm::vec3 > > &path, float radius, int segments)
 
draw_info::IndexedVertexPositions generate_quad_strip (const std::vector< std::pair< glm::vec3, glm::vec3 > > &lines)
 
void merge_ivps (draw_info::IndexedVertexPositions &base_ivp, const draw_info::IndexedVertexPositions &extend_ivp)
 
void merge_ivps (draw_info::IndexedVertexPositions &base_ivp, const std::vector< draw_info::IndexedVertexPositions > &extend_ivps)
 
draw_info::IndexedVertexPositions merge_ivps (const std::vector< draw_info::IndexedVertexPositions > &ivps)
 
draw_info::IndexedVertexPositions generate_unit_cube ()
 
std::vector< glm::vec3 > generate_unit_cube_vertices ()
 
std::vector< unsigned int > generate_cube_indices ()
 
std::vector< glm::vec3 > generate_rectangle_normals ()
 Generates normals for each corner of a rectangle.
 
std::vector< glm::vec3 > generate_rectangle_vertices_3d (const glm::vec3 &center, const glm::vec3 &width_dir, const glm::vec3 &height_dir, float width, float height)
 
std::vector< glm::vec3 > generate_rectangle_vertices_from_points (const glm::vec3 &point_a, const glm::vec3 &point_b, const glm::vec3 &surface_normal, float height)
 
std::vector< unsigned int > generate_rectangle_indices ()
 
std::vector< glm::vec2 > generate_rectangle_texture_coordinates ()
 
std::vector< glm::vec2 > generate_rectangle_texture_coordinates_flipped_vertically ()
 
draw_info::IndexedVertexPositions generate_circle (const glm::vec3 center, float radius, unsigned int num_sides)
 
draw_info::IndexedVertexPositions generate_n_gon (const glm::vec3 center, float radius, unsigned int num_sides)
 
std::vector< unsigned int > generate_n_gon_indices (unsigned int num_sides)
 
std::vector< glm::vec3 > generate_n_gon_vertices (const glm::vec3 &center, float radius, unsigned int num_sides)
 generate n equally spaced points on the unit circle
 
draw_info::IndexedVertexPositions generate_annulus (float center_x, float center_y, float outer_radius, float inner_radius, int num_segments, float percent)
 
std::vector< glm::vec3 > generate_annulus_vertices (float center_x, float center_y, float outer_radius, float inner_radius, int num_segments, float percent)
 
std::vector< unsigned int > generate_annulus_indices (int num_segments, float percent)
 
std::vector< glm::vec3 > generate_star_vertices (float center_x, float center_y, float outer_radius, float inner_radius, int num_star_tips, bool blunt_tips)
 
std::vector< unsigned int > generate_star_indices (int num_star_tips, bool blunt_tips)
 
std::vector< glm::vec3 > generate_fibonacci_sphere_vertices (int num_samples, float scale)
 
draw_info::IndexedVertexPositions generate_3d_arrow_with_ratio (const glm::vec3 &start, const glm::vec3 &end, int num_segments, float length_thickness_ratio)
 
draw_info::IndexedVertexPositions generate_3d_arrow (const glm::vec3 &start, const glm::vec3 &end, int num_segments, float stem_thickness)
 
std::vector< glm::vec3 > generate_arrow_vertices (glm::vec2 start, glm::vec2 end, float stem_thickness, float tip_length)
 Create the points of an arrow pointing from one point to another.
 
std::vector< unsigned int > generate_arrow_indices ()
 
void scale_vertices_in_place (std::vector< glm::vec3 > &vertices, const glm::vec3 &scale_vector, const glm::vec3 &origin)
 
std::vector< glm::vec3 > scale_vertices (const std::vector< glm::vec3 > &vertices, const glm::vec3 &scale_vector, const glm::vec3 &origin)
 
void scale_vertices_in_place (std::vector< glm::vec3 > &vertices, float scale_factor)
 
void translate_vertices_in_place (std::vector< glm::vec3 > &vertices, const glm::vec3 &translation)
 
glm::mat4 yaw_pitch_roll (float yaw, float pitch, float roll)
 
void rotate_vertices_in_place (std::vector< glm::vec3 > &vertices, const glm::vec3 &rotation_turns)
 
void increment_indices_in_place (std::vector< unsigned int > &indices, unsigned int increase)
 

Variables

std::vector< glm::vec3 > cube_vertex_positions
 
std::vector< unsigned int > cube_vertex_indices
 

Enumeration Type Documentation

◆ TriangulationMode

Enumerator
CentralFan 
VertexFan 

Function Documentation

◆ are_valid_rectangle_corners()

bool vertex_geometry::are_valid_rectangle_corners ( const glm::vec3 & top_left,
const glm::vec3 & top_right,
const glm::vec3 & bottom_left,
const glm::vec3 & bottom_right )

◆ circle_intersects_rect()

bool vertex_geometry::circle_intersects_rect ( float cx,
float cy,
float radius,
const Rectangle & rect )

◆ compute_sphere_normals()

std::vector< glm::vec3 > vertex_geometry::compute_sphere_normals ( const std::vector< glm::vec3 > & vertices)

◆ compute_tangent_finite_difference()

glm::vec3 vertex_geometry::compute_tangent_finite_difference ( std::function< glm::vec3(double)> f,
double t,
double delta )

◆ connect_ngons()

draw_info::IndexedVertexPositions vertex_geometry::connect_ngons ( const NGon & a,
const NGon & b )

◆ connect_points_by_rectangles()

draw_info::IndexedVertexPositions vertex_geometry::connect_points_by_rectangles ( const std::vector< glm::vec2 > & points)

◆ create_rectangle()

Rectangle vertex_geometry::create_rectangle ( float x_pos,
float y_pos,
float width,
float height )

◆ create_rectangle_from_bottom_left()

Rectangle vertex_geometry::create_rectangle_from_bottom_left ( const glm::vec3 & bottom_left,
float width,
float height )

◆ create_rectangle_from_bottom_right()

Rectangle vertex_geometry::create_rectangle_from_bottom_right ( const glm::vec3 & bottom_right,
float width,
float height )

◆ create_rectangle_from_center()

Rectangle vertex_geometry::create_rectangle_from_center ( const glm::vec3 & center,
float width,
float height )

◆ create_rectangle_from_center_left()

Rectangle vertex_geometry::create_rectangle_from_center_left ( const glm::vec3 & center_left,
float width,
float height )

◆ create_rectangle_from_corners()

Rectangle vertex_geometry::create_rectangle_from_corners ( const glm::vec3 top_left,
const glm::vec3 top_right,
const glm::vec3 bottom_left,
const glm::vec3 bottom_right )

◆ create_rectangle_from_top_left()

Rectangle vertex_geometry::create_rectangle_from_top_left ( const glm::vec3 & top_left,
float width,
float height )

◆ create_rectangle_from_top_right()

Rectangle vertex_geometry::create_rectangle_from_top_right ( const glm::vec3 & top_right,
float width,
float height )

◆ dot()

float vertex_geometry::dot ( const glm::vec3 & a,
const glm::vec3 & b )

◆ expand_rectangle()

Rectangle vertex_geometry::expand_rectangle ( const Rectangle & rect,
float x_expand,
float y_expand )

◆ f()

glm::vec3 vertex_geometry::f ( double t)

◆ flatten_and_increment_indices()

std::vector< unsigned int > vertex_geometry::flatten_and_increment_indices ( const std::vector< std::vector< unsigned int > > & indices)

Flattens and increments a collection of index sets.

Precondition
Each vector of indices must contain a contiguous set of integers {0, ..., n} for some integer n, though the indices do not have to be ordered.

This function concatenates multiple vectors of indices, incrementing each vector's indices by the total number of vertices processed so far, ensuring that indices are unique across all sets.

Parameters
indicesA vector of vectors, where each inner vector contains a contiguous set of integers.
Returns
A single vector of indices, flattened and adjusted to ensure uniqueness.
Note
The function asserts that each inner vector follows the precondition of having a contiguous set of integers.

◆ fractal_noise()

float vertex_geometry::fractal_noise ( float x,
float z,
int octaves,
float persistence,
float scale,
float seed = 0.0f )

◆ generate_3d_arrow()

draw_info::IndexedVertexPositions vertex_geometry::generate_3d_arrow ( const glm::vec3 & start,
const glm::vec3 & end,
int num_segments,
float stem_thickness )

◆ generate_3d_arrow_with_ratio()

draw_info::IndexedVertexPositions vertex_geometry::generate_3d_arrow_with_ratio ( const glm::vec3 & start,
const glm::vec3 & end,
int num_segments,
float length_thickness_ratio )

◆ generate_annulus()

draw_info::IndexedVertexPositions vertex_geometry::generate_annulus ( float center_x,
float center_y,
float outer_radius,
float inner_radius,
int num_segments,
float percent )

◆ generate_annulus_indices()

std::vector< unsigned int > vertex_geometry::generate_annulus_indices ( int num_segments,
float percent )

◆ generate_annulus_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_annulus_vertices ( float center_x,
float center_y,
float outer_radius,
float inner_radius,
int num_segments,
float percent )

◆ generate_arrow_indices()

std::vector< unsigned int > vertex_geometry::generate_arrow_indices ( )

◆ generate_arrow_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_arrow_vertices ( glm::vec2 start,
glm::vec2 end,
float stem_thickness,
float tip_length )

Create the points of an arrow pointing from one point to another.

                                           g\
                                           | --\
                                           |    ---\
      |    a-------------------------------c        --\

stem | | ----—/ | –\ thickness | start ----—/ | --—end | | ----—/ | –/ | b—/------------------------—d –/ | —/ | –/ f/

---—tip len----—

returns [a, b, c, d, e, f, g] from this we want to produce indices

{a, b, c}, {c, b, d}, {e, f, g} {0, 1, 2}, {2, 1, 3}, {4, 5, 6}

Author
cuppajoeman (2024)

◆ generate_box()

draw_info::IVPNormals vertex_geometry::generate_box ( float size_x,
float size_y,
float size_z )

◆ generate_circle()

draw_info::IndexedVertexPositions vertex_geometry::generate_circle ( const glm::vec3 center,
float radius,
unsigned int num_sides )

◆ generate_cone()

draw_info::IVPNormals vertex_geometry::generate_cone ( int segments,
float height,
float radius )

◆ generate_cone_between()

draw_info::IndexedVertexPositions vertex_geometry::generate_cone_between ( const glm::vec3 & base,
const glm::vec3 & tip,
int segments,
float radius )

◆ generate_cube()

draw_info::IVPNormals vertex_geometry::generate_cube ( float size)

◆ generate_cube_indices()

std::vector< unsigned int > vertex_geometry::generate_cube_indices ( )

◆ generate_cylinder()

draw_info::IVPNormals vertex_geometry::generate_cylinder ( int segments,
float height,
float radius )

◆ generate_cylinder_between()

draw_info::IndexedVertexPositions vertex_geometry::generate_cylinder_between ( const glm::vec3 & p1,
const glm::vec3 & p2,
int segments,
float radius )

◆ generate_fibonacci_sphere_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_fibonacci_sphere_vertices ( int num_samples,
float scale )

◆ generate_function_visualization()

draw_info::IndexedVertexPositions vertex_geometry::generate_function_visualization ( std::function< glm::vec3(double)> f,
double t_start,
double t_end,
double step_size,
double finite_diff_delta,
float radius,
int segments )

◆ generate_grid()

draw_info::IndexedVertexPositions vertex_geometry::generate_grid ( const glm::vec3 & center_position,
float base_width,
float base_height,
int num_rectangles_x,
int num_rectangles_y,
float spacing )

◆ generate_grid_rectangles()

std::vector< Rectangle > vertex_geometry::generate_grid_rectangles ( const glm::vec3 & center_position,
float width,
float height,
int num_rectangles_x,
int num_rectangles_y,
float spacing )

◆ generate_icosphere()

draw_info::IVPNormals vertex_geometry::generate_icosphere ( int subdivisions,
float radius )

◆ generate_initial_icosahedron_indices()

std::vector< unsigned int > vertex_geometry::generate_initial_icosahedron_indices ( )

◆ generate_initial_icosahedron_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_initial_icosahedron_vertices ( float radius)

◆ generate_n_gon()

draw_info::IndexedVertexPositions vertex_geometry::generate_n_gon ( const glm::vec3 center,
float radius,
unsigned int num_sides )

◆ generate_n_gon_indices()

std::vector< unsigned int > vertex_geometry::generate_n_gon_indices ( unsigned int num_sides)

◆ generate_n_gon_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_n_gon_vertices ( const glm::vec3 & center,
float radius,
unsigned int num_sides )

generate n equally spaced points on the unit circle

◆ generate_quad_strip()

draw_info::IndexedVertexPositions vertex_geometry::generate_quad_strip ( const std::vector< std::pair< glm::vec3, glm::vec3 > > & lines)

◆ generate_rectangle() [1/2]

draw_info::IndexedVertexPositions vertex_geometry::generate_rectangle ( float center_x,
float center_y,
float center_z,
float width,
float height )

◆ generate_rectangle() [2/2]

draw_info::IndexedVertexPositions vertex_geometry::generate_rectangle ( float center_x,
float center_y,
float width,
float height )

◆ generate_rectangle_between_2d()

draw_info::IndexedVertexPositions vertex_geometry::generate_rectangle_between_2d ( const glm::vec2 & p1,
const glm::vec2 & p2,
float thickness )

◆ generate_rectangle_indices()

std::vector< unsigned int > vertex_geometry::generate_rectangle_indices ( )

◆ generate_rectangle_normals()

std::vector< glm::vec3 > vertex_geometry::generate_rectangle_normals ( )

Generates normals for each corner of a rectangle.

The rectangle is assumed to lie in the XY plane, with normals pointing along the positive Z-axis.

Returns
A vector of glm::vec3 representing the normals for each corner.

◆ generate_rectangle_texture_coordinates()

std::vector< glm::vec2 > vertex_geometry::generate_rectangle_texture_coordinates ( )

◆ generate_rectangle_texture_coordinates_flipped_vertically()

std::vector< glm::vec2 > vertex_geometry::generate_rectangle_texture_coordinates_flipped_vertically ( )

◆ generate_rectangle_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_rectangle_vertices ( float center_x,
float center_y,
float width,
float height )

◆ generate_rectangle_vertices_3d()

std::vector< glm::vec3 > vertex_geometry::generate_rectangle_vertices_3d ( const glm::vec3 & center,
const glm::vec3 & width_dir,
const glm::vec3 & height_dir,
float width,
float height )

◆ generate_rectangle_vertices_from_points()

std::vector< glm::vec3 > vertex_geometry::generate_rectangle_vertices_from_points ( const glm::vec3 & point_a,
const glm::vec3 & point_b,
const glm::vec3 & surface_normal,
float height )

◆ generate_rectangle_vertices_with_z()

std::vector< glm::vec3 > vertex_geometry::generate_rectangle_vertices_with_z ( float center_x,
float center_y,
float center_z,
float width,
float height )

◆ generate_segmented_cylinder()

draw_info::IndexedVertexPositions vertex_geometry::generate_segmented_cylinder ( const std::vector< std::pair< glm::vec3, glm::vec3 > > & path,
float radius,
int segments )

◆ generate_square_indices()

std::vector< unsigned int > vertex_geometry::generate_square_indices ( )

◆ generate_square_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_square_vertices ( float center_x,
float center_y,
float side_length )
Parameters
center_x
center_y
side_length
Todo
Note that the triangles are done in clockwise ordering meaning they are back-facing so if you have culling turned on they will not show up. We should probably just make them counter-clockwise so that this doesn't occur.

note this is designed to work with generate_square_indices inside of a drawElements call.

◆ generate_star_indices()

std::vector< unsigned int > vertex_geometry::generate_star_indices ( int num_star_tips,
bool blunt_tips )

◆ generate_star_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_star_vertices ( float center_x,
float center_y,
float outer_radius,
float inner_radius,
int num_star_tips,
bool blunt_tips )

◆ generate_terrain()

draw_info::IVPNormals vertex_geometry::generate_terrain ( float size_x,
float size_z,
int resolution_x,
int resolution_z,
float max_height,
float base_height,
int octaves,
float persistence,
float scale,
float seed )

◆ generate_torus()

draw_info::IVPNormals vertex_geometry::generate_torus ( int major_segments,
int minor_segments,
float major_radius,
float minor_radius )

◆ generate_unit_cube()

draw_info::IndexedVertexPositions vertex_geometry::generate_unit_cube ( )

◆ generate_unit_cube_vertices()

std::vector< glm::vec3 > vertex_geometry::generate_unit_cube_vertices ( )

◆ get_bounding_rectangle()

Rectangle vertex_geometry::get_bounding_rectangle ( const std::vector< Rectangle > & rectangles)

◆ get_midpoint()

int vertex_geometry::get_midpoint ( int a,
int b,
std::map< std::pair< int, int >, int > & midpoint_cache,
std::vector< glm::vec3 > & vertices,
float radius )

◆ get_rects_intersecting_circle()

std::vector< Rectangle > vertex_geometry::get_rects_intersecting_circle ( const Grid & grid,
float cx,
float cy,
float radius )

◆ horizontal_weighted_subdivision()

std::vector< Rectangle > vertex_geometry::horizontal_weighted_subdivision ( const Rectangle & rect,
const std::vector< unsigned int > & weights )

◆ increment_indices_in_place()

void vertex_geometry::increment_indices_in_place ( std::vector< unsigned int > & indices,
unsigned int increase )

◆ is_right_angle()

bool vertex_geometry::is_right_angle ( const glm::vec3 & a,
const glm::vec3 & b,
const glm::vec3 & c )

◆ merge_ivps() [1/3]

draw_info::IndexedVertexPositions vertex_geometry::merge_ivps ( const std::vector< draw_info::IndexedVertexPositions > & ivps)

◆ merge_ivps() [2/3]

void vertex_geometry::merge_ivps ( draw_info::IndexedVertexPositions & base_ivp,
const draw_info::IndexedVertexPositions & extend_ivp )

◆ merge_ivps() [3/3]

void vertex_geometry::merge_ivps ( draw_info::IndexedVertexPositions & base_ivp,
const std::vector< draw_info::IndexedVertexPositions > & extend_ivps )

◆ noise()

float vertex_geometry::noise ( float x,
float z,
float seed = 0.0f )

◆ operator<<()

std::ostream & vertex_geometry::operator<< ( std::ostream & os,
const Rectangle & rect )

◆ rotate_vertices_in_place()

void vertex_geometry::rotate_vertices_in_place ( std::vector< glm::vec3 > & vertices,
const glm::vec3 & rotation_turns )

◆ sample_points_and_tangents()

std::vector< std::pair< glm::vec3, glm::vec3 > > vertex_geometry::sample_points_and_tangents ( std::function< glm::vec3(double)> f,
double t_start,
double t_end,
double step_size,
double finite_diff_delta )

◆ scale_rectangle_from_left_side()

Rectangle vertex_geometry::scale_rectangle_from_left_side ( const Rectangle & rect,
float x_shrink,
float y_shrink )

◆ scale_vertices()

std::vector< glm::vec3 > vertex_geometry::scale_vertices ( const std::vector< glm::vec3 > & vertices,
const glm::vec3 & scale_vector,
const glm::vec3 & origin )

◆ scale_vertices_in_place() [1/2]

void vertex_geometry::scale_vertices_in_place ( std::vector< glm::vec3 > & vertices,
const glm::vec3 & scale_vector,
const glm::vec3 & origin )

◆ scale_vertices_in_place() [2/2]

void vertex_geometry::scale_vertices_in_place ( std::vector< glm::vec3 > & vertices,
float scale_factor )

◆ shrink_rectangle()

Rectangle vertex_geometry::shrink_rectangle ( const Rectangle & rect,
float x_shrink,
float y_shrink )

◆ slide_rectangle()

Rectangle vertex_geometry::slide_rectangle ( const Rectangle & rect,
int x_offset,
int y_offset )

◆ strip_leading_newlines()

std::string vertex_geometry::strip_leading_newlines ( const std::string & text)

◆ subdivide_icosahedron()

void vertex_geometry::subdivide_icosahedron ( int subdivisions,
std::vector< glm::vec3 > & vertices,
std::vector< unsigned int > & indices,
float radius )

◆ subdivide_rectangle()

std::vector< Rectangle > vertex_geometry::subdivide_rectangle ( const Rectangle & rect,
unsigned int num_subdivisions,
bool vertical )

◆ text_grid_to_rect_grid()

draw_info::IndexedVertexPositions vertex_geometry::text_grid_to_rect_grid ( const std::string & text_grid,
const vertex_geometry::Rectangle bounding_rect )

◆ translate_vertices_in_place()

void vertex_geometry::translate_vertices_in_place ( std::vector< glm::vec3 > & vertices,
const glm::vec3 & translation )

◆ triangulate_ngon()

draw_info::IndexedVertexPositions vertex_geometry::triangulate_ngon ( const NGon & ngon)

◆ vertical_weighted_subdivision()

std::vector< Rectangle > vertex_geometry::vertical_weighted_subdivision ( const Rectangle & rect,
const std::vector< unsigned int > & weights )

◆ weighted_subdivision()

std::vector< Rectangle > vertex_geometry::weighted_subdivision ( const Rectangle & rect,
const std::vector< unsigned int > & weights,
bool vertical )

◆ yaw_pitch_roll()

glm::mat4 vertex_geometry::yaw_pitch_roll ( float yaw,
float pitch,
float roll )

Variable Documentation

◆ cube_vertex_indices

std::vector<unsigned int> vertex_geometry::cube_vertex_indices
Initial value:
= {
1, 2, 6, 6, 5, 1,
0, 4, 7, 7, 3, 0,
4, 5, 6, 6, 7, 4,
0, 3, 2, 2, 1, 0,
0, 1, 5, 5, 4, 0,
3, 7, 6, 6, 2, 3}

◆ cube_vertex_positions

std::vector<glm::vec3> vertex_geometry::cube_vertex_positions
Initial value:
= {{-1.0f, -1.0f, 1.0f},
{1.0f, -1.0f, 1.0f},
{1.0f, -1.0f, -1.0f},
{-1.0f, -1.0f, -1.0f},
{-1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f},
{1.0f, 1.0f, -1.0f},
{-1.0f, 1.0f, -1.0f}}