23 const float height=1.0f,
const float width=2.0f,
const float deep=0.3f) {
24 float twh = width/2.0f;
25 float thh = height/2.0f;
26 float tdh = deep/2.0f;
28 float ctrX = 0, ctrY = 0, ctrZ = 0;
30 float over = ctrZ + tdh;
31 float overh = over - tdh/2.0f;
32 float under = ctrZ - tdh;
33 float underh = under + tdh/2.0f;
39 Point3f ship_top_left =
Point3f(ctrX-width*1.5f/10, ctrY+thh*4/5, ctrZ);
40 Point3f ship_top_right =
Point3f(ctrX+width*1.5f/10, ctrY+thh*4/5, ctrZ);
41 Point3f ship_bottom_right =
Point3f(ctrX+width*2/06, ctrY-thh, overh);
42 Point3f ship_bottom_left =
Point3f(ctrX-width*2/06, ctrY-thh, overh);
46 Point3f ship_left =
Point3f(ctrX-twh+(width/18), ctrY-thh/2, ctrZ);
47 Point3f ship_right =
Point3f(ctrX+twh-(width/18), ctrY-thh/2, ctrZ);
51 oshape.
lineTo(shoot_bl.
x, shoot_bl.
y, shoot_bl.
z);
52 oshape.
lineTo(ship_top_left.
x, ship_top_left.
y, ship_top_left.
z);
53 oshape.
lineTo(ship_center_top.
x, ship_center_top.
y, ship_center_top.
z);
54 oshape.
lineTo(ship_top_right.
x, ship_top_right.
y, ship_top_right.
z);
55 oshape.
lineTo(shoot_br.
x, shoot_br.
y, shoot_br.
z);
56 oshape.
lineTo(shoot_bl.
x, shoot_bl.
y, shoot_bl.
z);
58 oshapes.push_back(oshape);
63 oshape.
lineTo(shoot_tl.
x, shoot_tl.
y, shoot_tl.
z);
64 oshape.
lineTo(shoot_bl.
x, shoot_bl.
y, shoot_bl.
z);
65 oshape.
lineTo(shoot_br.
x, shoot_br.
y, shoot_br.
z);
66 oshape.
lineTo(shoot_tr.
x, shoot_tr.
y, shoot_tr.
z);
67 oshape.
lineTo(shoot_tl.
x, shoot_tl.
y, shoot_tl.
z);
69 oshapes.push_back(oshape);
74 oshape.
lineTo(ship_center_top.
x, ship_center_top.
y, ship_center_top.
z);
75 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, ship_bottom_right.
z);
76 oshape.
lineTo(ship_top_right.
x, ship_top_right.
y, ship_top_right.
z);
77 oshape.
lineTo(ship_center_top.
x, ship_center_top.
y, ship_center_top.
z);
79 oshapes.push_back(oshape);
83 oshape.
lineTo(ship_center_top.
x, ship_center_top.
y, ship_center_top.
z);
84 oshape.
lineTo(ship_top_left.
x, ship_top_left.
y, ship_top_left.
z);
85 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, ship_bottom_left.
z);
86 oshape.
lineTo(ship_center_top.
x, ship_center_top.
y, ship_center_top.
z);
88 oshapes.push_back(oshape);
92 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, ship_bottom_left.
z);
93 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, ship_bottom_right.
z);
94 oshape.
lineTo(ship_center_top.
x, ship_center_top.
y, ship_center_top.
z);
95 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, ship_bottom_left.
z);
97 oshapes.push_back(oshape);
101 oshape.
lineTo(ship_top_left.
x, ship_top_left.
y, ship_top_left.
z);
102 oshape.
lineTo(ship_left.
x, ship_left.
y, ship_left.
z);
103 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, ship_bottom_left.
z);
104 oshape.
lineTo(ship_top_left.
x, ship_top_left.
y, ship_top_left.
z);
106 oshapes.push_back(oshape);
110 oshape.
lineTo(ship_top_right.
x, ship_top_right.
y, ship_top_right.
z);
111 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, ship_bottom_right.
z);
112 oshape.
lineTo(ship_right.
x, ship_right.
y, ship_right.
z);
113 oshape.
lineTo(ship_top_right.
x, ship_top_right.
y, ship_top_right.
z);
115 oshapes.push_back(oshape);
119 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, ship_bottom_left.
z);
120 oshape.
lineTo(ship_left.
x, ship_left.
y, ship_left.
z);
121 oshape.
lineTo(ctrX-twh, ctrY-thh, ctrZ);
122 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, ship_bottom_left.
z);
124 oshapes.push_back(oshape);
128 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, ship_bottom_right.
z);
129 oshape.
lineTo(ctrX+twh, ctrY-thh, ctrZ);
130 oshape.
lineTo(ship_right.
x, ship_right.
y, ship_right.
z);
131 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, ship_bottom_right.
z);
133 oshapes.push_back(oshape);
135 std::vector<OutlineShape> oshapes_back = oshapes;
137 for(
Outline& o : back.outlines()) {
138 for(
Vertex& v : o.vertices()) {
139 v.coord().z = ( (v.coord().z-ctrZ) * -1.0f + ctrZ - 0.001f);
144 oshapes.reserve( oshapes.size() + oshapes_back.size() );
146 oshapes.emplace_back(std::move(o));
150 oshape.
lineTo(ctrX+twh, ctrY-thh, ctrZ);
151 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, overh);
152 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, overh);
153 oshape.
lineTo(ctrX-twh, ctrY-thh, ctrZ);
154 oshape.
lineTo(ctrX+width/ 7, ctrY-thh, ctrZ);
155 oshape.
lineTo(ctrX+width/ 7, ctrY-thh, ctrZ + tdh/4);
156 oshape.
lineTo(ctrX+width/26, ctrY-thh, ctrZ + tdh/4);
157 oshape.
lineTo(ctrX+width/26, ctrY-thh, ctrZ);
158 oshape.
lineTo(ctrX-width/26, ctrY-thh, ctrZ);
159 oshape.
lineTo(ctrX-width/26, ctrY-thh, ctrZ + tdh/4);
160 oshape.
lineTo(ctrX-width/ 7, ctrY-thh, ctrZ + tdh/4);
161 oshape.
lineTo(ctrX-width/ 7, ctrY-thh, ctrZ);
163 oshapes.push_back(oshape);
167 oshape.
lineTo(ctrX-twh, ctrY-thh, ctrZ);
168 oshape.
lineTo(ship_bottom_left.
x, ship_bottom_left.
y, underh);
169 oshape.
lineTo(ship_bottom_right.
x, ship_bottom_right.
y, underh);
170 oshape.
lineTo(ctrX+twh, ctrY-thh, ctrZ);
171 oshape.
lineTo(ctrX+width/26, ctrY-thh, ctrZ);
172 oshape.
lineTo(ctrX+width/26, ctrY-thh, ctrZ-tdh/4);
173 oshape.
lineTo(ctrX+width/ 7, ctrY-thh, ctrZ-tdh/8);
174 oshape.
lineTo(ctrX+width/ 7, ctrY-thh, ctrZ);
175 oshape.
lineTo(ctrX-width/ 7, ctrY-thh, ctrZ);
176 oshape.
lineTo(ctrX-width/ 7, ctrY-thh, ctrZ-tdh/8);
177 oshape.
lineTo(ctrX-width/26, ctrY-thh, ctrZ-tdh/4);
178 oshape.
lineTo(ctrX-width/26, ctrY-thh, ctrZ);
180 oshapes.push_back(oshape);