13 #ifndef OGLPLUS_SHAPES_SPIRAL_SPHERE_1107121519_HPP
14 #define OGLPLUS_SHAPES_SPIRAL_SPHERE_1107121519_HPP
29 :
public DrawingInstructionWriter
33 const double _radius, _thickness;
34 const unsigned _bands, _divisions, _segments;
36 unsigned _vertex_count(
void)
const;
54 void _make_bitangents(
61 void _make_uv_coords(std::vector<T>& dest,
unsigned& k)
const;
64 void _make_side_verts(std::vector<T>& dest,
unsigned& k)
const;
67 void _make_side_norms(std::vector<T>& dest,
unsigned& k)
const;
70 void _make_side_tgts(std::vector<T>& dest,
unsigned& k)
const;
73 void _make_side_btgs(std::vector<T>& dest,
unsigned& k)
const;
76 void _make_side_uvs(std::vector<T>& dest,
unsigned& k)
const;
95 , _thickness(thickness)
97 , _divisions(divisions)
107 std::vector<GLfloat> _positions(
void)
const;
109 GLuint Positions(std::vector<GLfloat>& dest)
const
116 template <
typename T>
119 auto v = _positions();
120 dest.assign(v.begin(), v.end());
124 std::vector<GLfloat> _normals(
void)
const;
126 GLuint Normals(std::vector<GLfloat>& dest)
const
133 template <
typename T>
137 dest.assign(v.begin(), v.end());
141 std::vector<GLfloat> _tangents(
void)
const;
143 GLuint Tangents(std::vector<GLfloat>& dest)
const
150 template <
typename T>
153 auto v = _tangents();
154 dest.assign(v.begin(), v.end());
158 std::vector<GLfloat> _bitangents(
void)
const;
160 GLuint Bitangents(std::vector<GLfloat>& dest)
const
162 dest = _bitangents();
167 template <
typename T>
170 auto v = _bitangents();
171 dest.assign(v.begin(), v.end());
175 std::vector<GLfloat> _tex_coords(
void)
const;
177 GLuint TexCoordinates(std::vector<GLfloat>& dest)
const
179 dest = _tex_coords();
184 template <
typename T>
187 auto v = _tex_coords();
188 dest.assign(v.begin(), v.end());
192 #if OGLPLUS_DOCUMENTATION_ONLY
204 typedef VertexAttribsInfo<
211 VertexTexCoordinatesTag
217 template <
typename T>
224 T(_radius + _thickness)
241 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
242 #include <oglplus/shapes/spiral_sphere.ipp>
243 #endif //OGLPLUS_LINK_LIBRARY
245 #endif // include guard
Implementation of shape draw instructions.
GLuint Normals(std::vector< T > &dest) const
Makes vertex normals and returns number of values per vertex.
Definition: spiral_sphere.hpp:134
IndexArray Indices(Default=Default()) const
Returns element indices that are used with the drawing instructions.
FaceOrientation FaceWinding(void) const
Returns the winding direction of faces.
Definition: spiral_sphere.hpp:102
GLuint Tangents(std::vector< T > &dest) const
Makes vertex tangents and returns number of values per vertex.
Definition: spiral_sphere.hpp:151
std::vector< GLushort > IndexArray
The type of index container returned by Indices()
Definition: spiral_sphere.hpp:229
GLuint Positions(std::vector< T > &dest) const
Makes vertex coordinates and returns number of values per vertex.
Definition: spiral_sphere.hpp:117
Class providing data and instructions for rendering of a "spiral sphere".
Definition: spiral_sphere.hpp:28
SpiralSphere(double radius, double thickness, unsigned bands, unsigned divisions, unsigned segments)
Creates a custom spiral sphere.
Definition: spiral_sphere.hpp:88
GLuint TexCoordinates(std::vector< T > &dest) const
Makes texture-coorinates and returns number of values per vertex.
Definition: spiral_sphere.hpp:185
FaceOrientation
Face orientation enumeration.
Definition: face_mode.hpp:62
OpenGL face type-related enumeration.
GLuint Bitangents(std::vector< T > &dest) const
Makes vertex bi-tangents and returns number of values per vertex.
Definition: spiral_sphere.hpp:168
VertexAttribsInfo< SpiralSphere > VertexAttribs
Vertex attribute information for this shape builder.
Definition: spiral_sphere.hpp:202
Classes providing additional information about the shape builders.
SpiralSphere(void)
Creates a default spiral sphere.
Definition: spiral_sphere.hpp:79
Class encapsulating the instructions for drawing of a shape.
Definition: draw.hpp:219
Class implementing sphere-related functionality.
Definition: sphere.hpp:29
void BoundingSphere(oglplus::Sphere< T > &bounding_sphere) const
Queries the bounding sphere coordinates and dimensions.
Definition: spiral_sphere.hpp:218
DrawingInstructions Instructions(Default=Default()) const
Returns the instructions for rendering.