src/primitives.cpp

changeset 1139
51303023d651
parent 1117
efcb47c64a72
child 1141
7dc2c981937e
equal deleted inserted replaced
1138:0dfdef50b0ee 1139:51303023d651
260 260
261 switch (type) 261 switch (type)
262 { 262 {
263 case Circle: 263 case Circle:
264 { 264 {
265 LDLine* line = model.emplace<LDLine>(); 265 LDEdgeLine* line = model.emplace<LDEdgeLine>();
266 line->setVertex(0, Vertex {x0, 0.0f, z0}); 266 line->setVertex(0, Vertex {x0, 0.0f, z0});
267 line->setVertex(1, Vertex {x1, 0.0f, z1}); 267 line->setVertex(1, Vertex {x1, 0.0f, z1});
268 line->setColor(EdgeColor); 268 line->setColor(EdgeColor);
269 } 269 }
270 break; 270 break;
309 309
310 Vertex v0 = {x0, y0, z0}; 310 Vertex v0 = {x0, y0, z0};
311 Vertex v1 = {x1, y1, z1}; 311 Vertex v1 = {x1, y1, z1};
312 Vertex v2 = {x2, y2, z2}; 312 Vertex v2 = {x2, y2, z2};
313 Vertex v3 = {x3, y3, z3}; 313 Vertex v3 = {x3, y3, z3};
314 LDQuad* quad = model.emplace<LDQuad>(v0, v1, v2, v3); 314 LDQuadrilateral* quad = model.emplace<LDQuadrilateral>(v0, v1, v2, v3);
315 quad->setColor(MainColor); 315 quad->setColor(MainColor);
316 316
317 if (type == Cylinder) 317 if (type == Cylinder)
318 quad->invert(); 318 quad->invert();
319 319
373 { 373 {
374 v1 = {v0[X] * (ringNumber + 1), 0.0, v0[Z] * (ringNumber + 1)}; 374 v1 = {v0[X] * (ringNumber + 1), 0.0, v0[Z] * (ringNumber + 1)};
375 v0 = {v0[X] * ringNumber, 1.0, v0[Z] * ringNumber}; 375 v0 = {v0[X] * ringNumber, 1.0, v0[Z] * ringNumber};
376 } 376 }
377 377
378 LDCondLine* line = model.emplace<LDCondLine>(); 378 LDConditionalEdge* line = model.emplace<LDConditionalEdge>();
379 line->setColor(EdgeColor); 379 line->setColor(EdgeColor);
380 line->setVertex(0, v0); 380 line->setVertex(0, v0);
381 line->setVertex(1, v1); 381 line->setVertex(1, v1);
382 line->setVertex(2, v2); 382 line->setVertex(2, v2);
383 line->setVertex(3, v3); 383 line->setVertex(3, v3);

mercurial