5#include "Utilities/Math.h"
18 const glm::vec3 * crossSectionElements,
20 const glm::quat * rotations);
25 const glm::vec3 * crossSectionElements,
26 const glm::vec3 * crossSectionElements2,
29 const glm::quat * rotations);
38 const int numSections,
39 const int numSegments,
41 const size_t stride = 1);
52 const glm::vec3 * positions);
58 uint32_t * colorValues);
76 static void generateDepthBasedTextureCoordinates(
77 const size_t pathLength,
78 const size_t numSegments,
80 const float * offsets,
81 const size_t offsetStride,
82 glm::vec2 * texCoords);
84 static bool generateRotations(
const glm::vec3 * directions,
const int numDirections,
const glm::vec3 & primaryAxis, glm::quat * rotations)
86 if (!directions || !numDirections || !rotations)
return false;
88 for (
int i = 0; i < numDirections; ++i) {
89 rotations[i] = Cogs::Core::getRotation(primaryAxis, directions[i]);
@ Geometry
Store entity vector fields (vector<vec3>, vector<vec2>, vector<int>, vector<float>).
Contains all Cogs related functionality.
static void offsetCrossSections(glm::vec3 *vertices, int numSections, int numSegments, const glm::vec3 *positions)
Offset vertices with per section positions.
static bool generateCrossSections(glm::vec3 *vertices, int numSections, const glm::vec3 *crossSectionElements, int numSegments, const glm::quat *rotations)
Generates cross section vertices in vertices from the cross section definition given.
static void modulateVertices(glm::vec3 *vertices, int numVertices, float *values)
Modulate extrusion vertices with per vertex data.
static void modulateSections(glm::vec3 *vertices, const int numSections, const int numSegments, const float *values, const size_t stride=1)
Modulate extrusion vertices with per section data.
static void colorSections(uint32_t *colors, int numSections, int numSegments, uint32_t *colorValues)
Generate color data per vertex from per section data.
static void generateSimpleExtrusionNormals(glm::vec3 *vertices, glm::vec3 *normals, int numVertices)
Generates extrusion normals from the vertices given.
static void generateTriangleIndices(int32_t *indices, int numSections, int numSegments, bool closed, bool useTexture, int32_t offset=0)
Generate legacy triangle extrusion indices.