166 {
167
168
170 {
172 GLViewport x = null, y = null, z = null, w = null;
175 {
176 if (v2 == v)
177 {
178 continue;
179 }
180
181 float diff2 = Math.Abs(p.
_x - v2.Percentages._x);
182 if (diff2 <= diff.
_x)
183 {
184 x = v2;
185 diff._x = diff2;
186 }
187
188 diff2 = Math.Abs(p.
_y - v2.Percentages._y);
189 if (diff2 <= diff.
_y)
190 {
191 y = v2;
192 diff._y = diff2;
193 }
194
195 diff2 = Math.Abs(p.
_z - v2.Percentages._z);
196 if (diff2 <= diff.
_z)
197 {
198 z = v2;
199 diff._z = diff2;
200 }
201
202 diff2 = Math.Abs(p.
_w - v2.Percentages._w);
203 if (diff2 <= diff.
_w)
204 {
205 w = v2;
206 diff._w = diff2;
207 }
208 }
209
211 if (diff.
_x > 0.0f && x !=
null)
212 {
213 average._x = (v.Percentages._x + x.Percentages._x) / 2.0f;
214 x.SetXPercentage(average.
_x);
215 }
216
217 if (diff.
_y > 0.0f && y !=
null)
218 {
219 average._y = (v.Percentages._y + y.Percentages._y) / 2.0f;
220 y.SetYPercentage(average.
_y);
221 }
222
223 if (diff.
_z > 0.0f && z !=
null)
224 {
225 average._z = (v.Percentages._z + z.Percentages._z) / 2.0f;
226 z.SetZPercentage(average.
_z);
227 }
228
229 if (diff.
_w > 0.0f && w !=
null)
230 {
231 average._w = (v.Percentages._w + w.Percentages._w) / 2.0f;
232 w.SetWPercentage(average.
_w);
233 }
234
235 v.SetPercentages(average);
236 }
237 }
Definition: Vector4.cs:12
float _x
Definition: Vector4.cs:13
float _z
Definition: Vector4.cs:13
float _y
Definition: Vector4.cs:13
float _w
Definition: Vector4.cs:13