Project

General

Profile

« Previous | Next » 

Revision 369e6176

Added by Leszek Koltunski about 1 year ago

Make the touchable part of the 'coin' in the CoinTetrahedroon a bit smaller.

View differences:

src/main/java/org/distorted/objectlib/touchcontrol/TouchControl.java
25 25
  // and also it has an inscribed circle (see coin tetrahedron!)
26 26
  public static final int TYPE_SPLIT_EDGE_COIN= 3;
27 27

  
28
  static final float D_TRIANGLE = 0.95f;
29
  static final float D_SQUARE   = 0.90f;
30
  static final float D_PENTA    = 0.55f;
31

  
28 32
  public static final int TC_HEXAHEDRON        =   6;
29 33
  public static final int TC_TETRAHEDRON       =   4;
30 34
  public static final int TC_OCTAHEDRON        =   8;
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlDodecahedron.java
114 114
      case TYPE_SPLIT_EDGE     : return partEdge(point,face);
115 115
      case TYPE_SPLIT_EDGE_COIN: float y = point[1];
116 116
                                 float x = point[0];
117
                                 return partEdge(point,face) + (x*x+y*y < DIST2D*DIST2D ? 0:5 );
117
                                 float dist = D_PENTA*DIST2D;
118
                                 return partEdge(point,face) + (x*x+y*y < dist*dist ? 0:5 );
118 119
      case TYPE_SPLIT_CORNER   : // not supported
119 120
      }
120 121

  
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlHexahedron.java
70 70
      case TYPE_SPLIT_CORNER   : return partCorner(point,face);
71 71
      case TYPE_SPLIT_EDGE_COIN: float y = point[1];
72 72
                                 float x = point[0];
73
                                 return partEdge(point,face) + (x*x+y*y < DIST2D*DIST2D ? 0:4 );
73
                                 float dist = D_SQUARE*DIST2D;
74
                                 return partEdge(point,face) + (x*x+y*y < dist*dist ? 0:4 );
74 75
      }
75 76

  
76 77
    return 0;
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlIcosahedron.java
185 185
      case TYPE_SPLIT_CORNER   : return partCorner(point,face);
186 186
      case TYPE_SPLIT_EDGE_COIN: float y = point[1];
187 187
                                 float x = point[0];
188
                                 return partEdge(point,face) + (x*x+y*y < DIST2D*DIST2D ? 0:3 );
188
                                 float dist = D_TRIANGLE*DIST2D;
189
                                 return partEdge(point,face) + (x*x+y*y < dist*dist ? 0:3 );
189 190
      }
190 191

  
191 192
    return 0;
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlOctahedron.java
92 92
      case TYPE_SPLIT_CORNER    : return partCorner(point,face);
93 93
      case TYPE_SPLIT_EDGE_COIN : float y = point[1];
94 94
                                  float x = point[0];
95
                                  return partEdge(point,face) + (x*x+y*y < DIST2D*DIST2D ? 0:3 );
95
                                  float dist = D_TRIANGLE*DIST2D;
96
                                  return partEdge(point,face) + (x*x+y*y < dist*dist ? 0:3 );
96 97
      }
97 98

  
98 99
    return 0;
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlTetrahedron.java
94 94
      case TYPE_SPLIT_CORNER   : return partCorner(point,face);
95 95
      case TYPE_SPLIT_EDGE_COIN: float y = point[1];
96 96
                                 float x = point[0];
97
                                 return partEdge(point,face) + (x*x+y*y < DIST2D*DIST2D ? 0:3 );
97
                                 float dist = D_TRIANGLE*DIST2D;
98
                                 return partEdge(point,face) + (x*x+y*y < dist*dist ? 0:3 );
98 99
      }
99 100

  
100 101
    return 0;

Also available in: Unified diff