287 std::vector<int> discreteNormal(3, 0);
289 if (_blockGeometry->getMaterial({iX, iY}) != 1
290 && _blockGeometry->getMaterial({iX, iY}) != 0) {
293 if (_blockGeometry->getMaterial({iX, iY + 1}) != 1
294 && _blockGeometry->getMaterial({iX, iY + 1}) != 0
295 && _blockGeometry->getMaterial({iX, iY - 1}) != 1
296 && _blockGeometry->getMaterial({iX, iY - 1}) != 0) {
298 if (_blockGeometry->getMaterial({iX + 1, iY}) == 1) {
299 discreteNormal[0] = 0;
300 discreteNormal[1] = -1;
301 discreteNormal[2] = 0;
304 if (_blockGeometry->getMaterial({iX - 1, iY}) == 1) {
305 discreteNormal[0] = 0;
306 discreteNormal[1] = 1;
307 discreteNormal[2] = 0;
312 if (_blockGeometry->getMaterial({iX + 1, iY}) != 1
313 && _blockGeometry->getMaterial({iX + 1, iY}) != 0
314 && _blockGeometry->getMaterial({iX - 1, iY}) != 1
315 && _blockGeometry->getMaterial({iX - 1, iY}) != 0) {
317 if (_blockGeometry->getMaterial({iX, iY + 1}) == 1) {
318 discreteNormal[0] = 0;
319 discreteNormal[1] = 0;
320 discreteNormal[2] = -1;
323 if (_blockGeometry->getMaterial({iX, iY - 1}) == 1) {
324 discreteNormal[0] = 0;
325 discreteNormal[1] = 0;
326 discreteNormal[2] = 1;
331 if ( _blockGeometry->getMaterial({iX + 1, iY}) != 1
332 && _blockGeometry->getMaterial({iX + 1, iY}) != 0) {
334 if (_blockGeometry->getMaterial({iX, iY + 1}) != 1
335 && _blockGeometry->getMaterial({iX, iY + 1}) != 0
336 && _blockGeometry->getMaterial({iX + 1, iY + 1}) == 1) {
337 discreteNormal[0] = 1;
338 discreteNormal[1] = -1;
339 discreteNormal[2] = -1;
342 if (_blockGeometry->getMaterial({iX, iY - 1}) != 1
343 && _blockGeometry->getMaterial({iX, iY - 1}) != 0
344 && _blockGeometry->getMaterial({iX + 1, iY - 1}) == 1) {
345 discreteNormal[0] = 1;
346 discreteNormal[1] = -1;
347 discreteNormal[2] = 1;
352 if (_blockGeometry->getMaterial({iX - 1, iY}) != 1
353 && _blockGeometry->getMaterial({iX - 1, iY}) != 0) {
355 if (_blockGeometry->getMaterial({iX, iY + 1}) != 1
356 && _blockGeometry->getMaterial({iX, iY + 1}) != 0
357 && _blockGeometry->getMaterial({iX - 1, iY + 1}) == 1) {
358 discreteNormal[0] = 1;
359 discreteNormal[1] = 1;
360 discreteNormal[2] = -1;
363 if (_blockGeometry->getMaterial({iX, iY - 1}) != 1
364 && _blockGeometry->getMaterial({iX, iY - 1}) != 0
365 && _blockGeometry->getMaterial({iX - 1, iY - 1}) == 1) {
366 discreteNormal[0] = 1;
367 discreteNormal[1] = 1;
368 discreteNormal[2] = 1;
373 if (_blockGeometry->getMaterial({iX - 1, iY}) != 1
374 && _blockGeometry->getMaterial({iX - 1, iY}) != 0) {
376 if (_blockGeometry->getMaterial({iX, iY - 1}) != 1
377 && _blockGeometry->getMaterial({iX, iY - 1}) != 0
378 && _blockGeometry->getMaterial({iX - 1, iY - 1}) == 0) {
379 discreteNormal[0] = 2;
380 discreteNormal[1] = -1;
381 discreteNormal[2] = -1;
384 if (_blockGeometry->getMaterial({iX, iY + 1}) != 1
385 && _blockGeometry->getMaterial({iX, iY + 1}) != 0
386 && _blockGeometry->getMaterial({iX - 1, iY + 1}) == 0) {
387 discreteNormal[0] = 2;
388 discreteNormal[1] = -1;
389 discreteNormal[2] = 1;
394 if (_blockGeometry->getMaterial({iX + 1, iY}) != 1
395 && _blockGeometry->getMaterial({iX + 1, iY}) != 0) {
397 if (_blockGeometry->getMaterial({iX, iY - 1}) != 1
398 && _blockGeometry->getMaterial({iX, iY - 1}) != 0
399 && _blockGeometry->getMaterial({iX + 1, iY - 1}) == 0) {
400 discreteNormal[0] = 2;
401 discreteNormal[1] = 1;
402 discreteNormal[2] = -1;
405 if (_blockGeometry->getMaterial({iX, iY + 1}) != 1
406 && _blockGeometry->getMaterial({iX, iY + 1}) != 0
407 && _blockGeometry->getMaterial({iX + 1, iY + 1}) == 0) {
408 discreteNormal[0] = 2;
409 discreteNormal[1] = 1;
410 discreteNormal[2] = 1;
414 return discreteNormal;