23 vertices.reserve(3 * (resolution + 2));
24 vertices.push_back(0);
25 vertices.push_back(0);
26 vertices.push_back(0);
27 float delta_theta =
M_PI * 2.0f /
static_cast<float>(resolution);
28 for (
int i = resolution; i >= 0; i--) {
29 float theta = delta_theta *
static_cast<float>(i);
30 vertices.push_back(
cos(theta) * radius);
31 vertices.push_back(0);
32 vertices.push_back(
sin(theta) * radius);
static const float vertices[]
GLM_FUNC_DECL genType cos(genType const &angle)
GLM_FUNC_DECL genType sin(genType const &angle)
Circle(float radius, int resolution)
void SetVertices(const std::vector< GLfloat > &vertices)