Project

General

Profile

« Previous | Next » 

Revision 9a7e8b98

Added by Leszek Koltunski about 1 year ago

new SPLIT type: type EDGE_COIN (will be used in Coin Tetrahedron).
Only supported in Tetrahedrons for now.

View differences:

src/main/java/org/distorted/objectlib/touchcontrol/TouchControlHexahedron.java
47 47
    {
48 48
    switch(type)
49 49
      {
50
      case TYPE_NOT_SPLIT   : return 0;
51
      case TYPE_SPLIT_EDGE  : boolean e0 = touchPoint[0] > 0;
52
                              boolean e1 = touchPoint[1] > 0;
53
                              return e0 ? (e1 ? 0:1) : (e1 ? 3:2);
54
      case TYPE_SPLIT_CORNER: boolean c0 = touchPoint[1] >= touchPoint[0];
55
                              boolean c1 = touchPoint[1] >=-touchPoint[0];
56
                              return c0 ? (c1 ? 0:3) : (c1 ? 1:2);
50
      case TYPE_NOT_SPLIT     : return 0;
51
      case TYPE_SPLIT_EDGE    : boolean e0 = touchPoint[0] > 0;
52
                                boolean e1 = touchPoint[1] > 0;
53
                                return e0 ? (e1 ? 0:1) : (e1 ? 3:2);
54
      case TYPE_SPLIT_CORNER  : boolean c0 = touchPoint[1] >= touchPoint[0];
55
                                boolean c1 = touchPoint[1] >=-touchPoint[0];
56
                                return c0 ? (c1 ? 0:3) : (c1 ? 1:2);
57
      case TYPE_SPLIT_EDGE_COIN: // not supported
57 58
      }
58 59

  
59 60
    return 0;

Also available in: Unified diff