src/linetypes/circularprimitive.cpp

changeset 196
6bcb284679d4
parent 186
922662adb72a
equal deleted inserted replaced
195:6e79c1cb83e6 196:6bcb284679d4
75 75
76 void ldraw::CircularPrimitive::getPolygons(std::vector<gl::Polygon> &polygons, GetPolygonsContext *) const 76 void ldraw::CircularPrimitive::getPolygons(std::vector<gl::Polygon> &polygons, GetPolygonsContext *) const
77 { 77 {
78 for (int i = 0; i < this->segments; i += 1) 78 for (int i = 0; i < this->segments; i += 1)
79 { 79 {
80 const float ang_1 = (2 * math::pi * i) / this->divisions; 80 const float ang_1 = (2 * pi<> * i) / this->divisions;
81 const float ang_2 = (2 * math::pi * (i + 1)) / this->divisions; 81 const float ang_2 = (2 * pi<> * (i + 1)) / this->divisions;
82 const glm::vec3 p_1 = {std::sin(ang_1), 0, std::cos(ang_1)}; 82 const glm::vec3 p_1 = {std::sin(ang_1), 0, std::cos(ang_1)};
83 const glm::vec3 p_2 = {std::sin(ang_2), 0, std::cos(ang_2)}; 83 const glm::vec3 p_2 = {std::sin(ang_2), 0, std::cos(ang_2)};
84 switch (this->type) 84 switch (this->type)
85 { 85 {
86 case Circle: 86 case Circle:

mercurial