72 |
72 |
73 switch (countof(verts)) |
73 switch (countof(verts)) |
74 { |
74 { |
75 case 2: |
75 case 2: |
76 // 2 verts - make a line |
76 // 2 verts - make a line |
77 model.emplace<LDEdgeLine>(verts[0], verts[1]); |
77 model.append<LDEdgeLine>(verts[0], verts[1]); |
78 break; |
78 break; |
79 |
79 |
80 case 3: |
80 case 3: |
81 case 4: |
81 case 4: |
82 { |
82 { |
83 LDObject* obj = (countof(verts) == 3) ? |
83 LDObject* obj = (countof(verts) == 3) ? |
84 static_cast<LDObject*>(model.emplace<LDTriangle>()) : |
84 static_cast<LDObject*>(model.append<LDTriangle>()) : |
85 static_cast<LDObject*>(model.emplace<LDQuadrilateral>()); |
85 static_cast<LDObject*>(model.append<LDQuadrilateral>()); |
86 |
86 |
87 for (int i = 0; i < countof(verts); ++i) |
87 for (int i = 0; i < countof(verts); ++i) |
88 obj->setVertex (i, verts[i]); |
88 obj->setVertex (i, verts[i]); |
89 |
89 |
90 break; |
90 break; |