qxLib
Classes | Functions
geom.h File Reference
#include <qx/render/draw_mode.h>
#include <qx/typedefs.h>
#include <glm/geometric.hpp>
#include <glm/vec3.hpp>
#include <array>
#include <cmath>
#include <numbers>
#include <span>
#include <unordered_map>
#include <vector>
#include <qx/render/geom.inl>

Go to the source code of this file.

Classes

struct  qx::vertex
 
struct  qx::geometry
 

Functions

glm::vec3 qx::create_tangent (const glm::vec3 &normal)
 Create tangent vector for a given normal. More...
 
indices qx::transform_triangle_indices_to_lines (indices_view triangles)
 Transform triangle indices to line indices. More...
 
geometry qx::create_parallelogram (float fSide1, float fSide2, float fSide3, bool bFlatNormals=true)
 Create parallelogram geometry. More...
 
geometry qx::create_parallelogram_lines (float fSide1, float fSide2, float fSide3)
 Create parallelogram geometry for lines drawing. More...
 
geometry qx::create_cube (float fSide, bool bFlatNormals=true)
 Create cube geometry. More...
 
geometry qx::create_cube_lines (float fSide)
 Create cube geometry for lines drawing. More...
 
geometry qx::create_icosahedron (float fRadius, bool bFlatNormals=true)
 Create icosahedron geometry. More...
 
geometry qx::create_icosahedron_lines (float fRadius)
 Create icosahedron geometry for lines drawing. More...
 
geometry qx::create_icosphere (float fRadius, size_t nDivides, bool bFlatNormals=false)
 Create icosphere geometry. More...
 
geometry qx::create_icosphere_lines (float fRadius, size_t nDivides)
 Create icosphere geometry for lines drawing. More...
 
geometry qx::create_rect (float fWidth, float fHeight)
 Create rectangle geometry. More...
 
geometry qx::create_rect_lines (float fWidth, float fHeight)
 Create rectangle geometry for lines drawing. More...
 
geometry qx::create_square (float fSideLength)
 Create square geometry. More...
 
geometry qx::create_square_lines (float fSideLength)
 Create square geometry for lines drawing. More...
 
geometry qx::create_ellipse (float fHorRadius, float fVertRadius, size_t nSides)
 Create ellipse geometry. More...
 
geometry qx::create_ellipse_lines (float fHorRadius, float fVertRadius, size_t nSides)
 Create ellipse geometry for lines drawing. More...
 
geometry qx::create_circle (float fRadius, size_t nSides)
 Create circle geometry for lines drawing. More...
 
geometry qx::create_circle_lines (float fRadius, size_t nSides)
 Create circle geometry for lines drawing. More...
 

Detailed Description

Author
Khrapov
Date
4.04.2021

Definition in file geom.h.

Function Documentation

◆ create_circle()

geometry qx::create_circle ( float  fRadius,
size_t  nSides 
)
inline

Create circle geometry for lines drawing.

Parameters
fRadius- circle radius
nSides- number of lines in ellipse edge, must be > 3 the greater value, the smoother еру edge
Return values
-circle geometry

Definition at line 358 of file geom.inl.

◆ create_circle_lines()

geometry qx::create_circle_lines ( float  fRadius,
size_t  nSides 
)
inline

Create circle geometry for lines drawing.

Parameters
fRadius- circle radius
nSides- number of lines in ellipse edge, must be > 3 the greater value, the smoother еру edge
Return values
-circle geometry

Definition at line 363 of file geom.inl.

◆ create_cube()

geometry qx::create_cube ( float  fSide,
bool  bFlatNormals = true 
)
inline

Create cube geometry.

Parameters
fSide- cube side length
bFlatNormals- if true, each vertex will have independent normal
Return values
-cube geometry

Definition at line 165 of file geom.inl.

◆ create_cube_lines()

geometry qx::create_cube_lines ( float  fSide)
inline

Create cube geometry for lines drawing.

Parameters
fSide- cube side length
Return values
-cube geometry

Definition at line 170 of file geom.inl.

◆ create_ellipse()

geometry qx::create_ellipse ( float  fHorRadius,
float  fVertRadius,
size_t  nSides 
)
inline

Create ellipse geometry.

Parameters
fHorRadius- ellipse horizontal radius
fVertRadius- ellipse vertical radius
nSides- number of lines in ellipse edge, must be > 3 the greater value, the smoother еру edge
Return values
-ellipse geometry

Definition at line 322 of file geom.inl.

◆ create_ellipse_lines()

geometry qx::create_ellipse_lines ( float  fHorRadius,
float  fVertRadius,
size_t  nSides 
)
inline

Create ellipse geometry for lines drawing.

Parameters
fHorRadius- ellipse horizontal radius
fVertRadius- ellipse vertical radius
nSides- number of lines in ellipse edge, must be > 3 the greater value, the smoother еру edge
Return values
-ellipse geometry

Definition at line 350 of file geom.inl.

◆ create_icosahedron()

geometry qx::create_icosahedron ( float  fRadius,
bool  bFlatNormals = true 
)
inline

Create icosahedron geometry.

Parameters
fRadius- icosahedron radius
bFlatNormals- if true, each vertex will have independent normal
Return values
-icosahedron geometry

Definition at line 179 of file geom.inl.

◆ create_icosahedron_lines()

geometry qx::create_icosahedron_lines ( float  fRadius)
inline

Create icosahedron geometry for lines drawing.

Parameters
fRadius- icosahedron radius
Return values
-icosahedron geometry

Definition at line 188 of file geom.inl.

◆ create_icosphere()

geometry qx::create_icosphere ( float  fRadius,
size_t  nDivides,
bool  bFlatNormals = false 
)
inline

Create icosphere geometry.

Parameters
fRadius- icosphere radius
nDivides- num of divides of icosahedron (bigger is higher precision)
bFlatNormals- if true, each vertex will have independent normal
Return values
-icosphere geometry

Definition at line 197 of file geom.inl.

◆ create_icosphere_lines()

geometry qx::create_icosphere_lines ( float  fRadius,
size_t  nDivides 
)
inline

Create icosphere geometry for lines drawing.

Parameters
fRadius- icosphere radius
nDivides- num of divides of icosahedron (bigger is higher precision)
Return values
-icosphere geometry

Definition at line 270 of file geom.inl.

◆ create_parallelogram()

geometry qx::create_parallelogram ( float  fSide1,
float  fSide2,
float  fSide3,
bool  bFlatNormals = true 
)
inline

Create parallelogram geometry.

Parameters
fSide1- side 1 length
fSide2- side 2 length
fSide3- side 3 length
bFlatNormals- if true, each vertex will have independent normal
Return values
-parallelogram geometry

Definition at line 151 of file geom.inl.

◆ create_parallelogram_lines()

geometry qx::create_parallelogram_lines ( float  fSide1,
float  fSide2,
float  fSide3 
)
inline

Create parallelogram geometry for lines drawing.

Parameters
fSide1- side 1 length
fSide2- side 2 length
fSide3- side 3 length
Return values
-parallelogram geometry

Definition at line 156 of file geom.inl.

◆ create_rect()

geometry qx::create_rect ( float  fWidth,
float  fHeight 
)
inline

Create rectangle geometry.

Parameters
fWidth- rectangle width
fHeight- rectangle height
Return values
-rectangle geometry

Definition at line 279 of file geom.inl.

◆ create_rect_lines()

geometry qx::create_rect_lines ( float  fWidth,
float  fHeight 
)
inline

Create rectangle geometry for lines drawing.

Parameters
fWidth- rectangle width
fHeight- rectangle height
Return values
-rectangle geometry

Definition at line 293 of file geom.inl.

◆ create_square()

geometry qx::create_square ( float  fSideLength)
inline

Create square geometry.

Parameters
fSideLength- square side length
Return values
-square geometry

Definition at line 312 of file geom.inl.

◆ create_square_lines()

geometry qx::create_square_lines ( float  fSideLength)
inline

Create square geometry for lines drawing.

Parameters
fSideLength- square side length
Return values
-square geometry

Definition at line 317 of file geom.inl.

◆ create_tangent()

glm::vec3 qx::create_tangent ( const glm::vec3 &  normal)
inline

Create tangent vector for a given normal.

Parameters
normal- normal vector
Return values
-tangent vector

Definition at line 125 of file geom.inl.

◆ transform_triangle_indices_to_lines()

indices qx::transform_triangle_indices_to_lines ( indices_view  triangles)
inline

Transform triangle indices to line indices.

Parameters
triangles- triangle indices
Return values
-line indices

Definition at line 132 of file geom.inl.