Changeset 1279
 Timestamp:
 Apr 23, 2012, 2:20:21 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/orbital/mesh.h
r1278 r1279 57 57 else CASE("afcb") { p = GetArg(p, v3, f1); AppendFlatChamfBox(v3, f1); } 58 58 else CASE("asph") { p = GetArg(p, v3, f1); AppendSphere(v3, (int)f1); } 59 else CASE("as") { p = GetArg(p, f1, f2, f3, f4, f5); AppendStar((int)f1, f2, f 4, (int)f5, (int)f5); }60 else CASE("aes") { /* TODO */}59 else CASE("as") { p = GetArg(p, f1, f2, f3, f4, f5); AppendStar((int)f1, f2, f3, (int)f4, (int)f5); } 60 else CASE("aes") { p = GetArg(p, f1, f2, f3, f4); AppendExpandedStar((int)f1, f2, f3, f4); } 61 61 else CASE("ad") { p = GetArg(p, f1, f2, f3); AppendDisc((int)f1, f2, (int)f3); } 62 62 else CASE("at") { p = GetArg(p, f1, f2); AppendSimpleTriangle(f1, (int)f2); } … … 687 687 } 688 688 689 void AppendStar(int nbranches, float r1, float r2) 690 { 691 AppendStar(nbranches, r1, r2, 0, 0); 692 } 693 694 void AppendStar(int nbranches, float r1, float r2, int fade) 695 { 696 AppendStar(nbranches, r1, r2, fade, 0); 697 } 698 699 void AppendStar(int nbranches, float r1, float r2, int fade, int fade2) 689 void AppendStar(int nbranches, float r1, float r2, 690 int fade = 0, int fade2 = 0) 700 691 { 701 692 int vbase = m_vert.Count(); … … 727 718 } 728 719 729 void AppendExpandedStar() {} /* TODO */ 720 void AppendExpandedStar(int nbranches, float r1, float r2, float extrar) 721 { 722 int vbase = m_vert.Count(); 723 724 AppendQuadVert(vec3(0.f, 0.f, 0.f)); 725 726 mat3 rotmat = mat3::rotate(180.0f / nbranches, 0.f, 1.f, 0.f); 727 vec3 p1(r1, 0.f, 0.f), p2(r2, 0.f, 0.f), 728 p3(r1 + extrar, 0.f, 0.f), p4(r2 + extrar, 0.f, 0.f);; 729 730 p2 = rotmat * p2; 731 p4 = rotmat * p4; 732 rotmat = rotmat * rotmat; 733 734 for (int i = 0; i < nbranches; i++) 735 { 736 AppendQuadVert(p1); 737 AppendQuadVert(p2); 738 AppendQuadVert(p3); 739 SetCurVertColor(m_color2); 740 AppendQuadVert(p4); 741 SetCurVertColor(m_color2); 742 743 int j = (i + 1) % nbranches; 744 AppendQuad(0, 4 * i + 1, 4 * i + 2, 4 * j + 1, vbase); 745 AppendQuad(4 * i + 1, 4 * i + 3, 4 * i + 4, 4 * i + 2, vbase); 746 AppendQuad(4 * j + 1, 4 * i + 2, 4 * i + 4, 4 * j + 3, vbase); 747 748 p1 = rotmat * p1; 749 p2 = rotmat * p2; 750 p3 = rotmat * p3; 751 p4 = rotmat * p4; 752 } 753 } 730 754 731 755 void AppendDisc(int nsides, float r, int fade = 0)
Note: See TracChangeset
for help on using the changeset viewer.