Project

General

Profile

« Previous | Next » 

Revision 63002261

Added by Leszek Koltunski over 4 years ago

Skewb finished?

View differences:

src/main/java/org/distorted/objects/RubikMovementSkewb.java
25 25
{
26 26
  RubikMovementSkewb()
27 27
    {
28
    super(RubikSkewb.ROT_AXIS, RubikSkewb.FACE_AXIS, 0.5f, 0.5f);
28
    super(RubikSkewb.ROT_AXIS, RubikSkewb.FACE_AXIS, 0.25f, 0.25f);
29 29
    }
30 30

  
31 31
///////////////////////////////////////////////////////////////////////////////////////////////////
......
50 50

  
51 51
  boolean isInsideFace(float[] p)
52 52
    {
53
    return ( p[0]<=0.5f && p[0]>=-0.5f && p[1]<=0.5f && p[1]>=-0.5f );
53
    return ( p[0]<=0.25f && p[0]>=-0.25f && p[1]<=0.25f && p[1]>=-0.25f );
54 54
    }
55 55

  
56 56
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objects/RubikSkewb.java
95 95
           new Static4D(  0.5f, -0.5f, -0.5f, -0.5f )
96 96
         };
97 97

  
98
  private static final float DIST_CORNER = 0.50f;
99
  private static final float DIST_CENTER = 0.49f;
100

  
98 101
  // centers of the 8 corners + 6 sides ( i.e. of the all 14 cubits)
99 102
  private static final Static3D[] CENTERS = new Static3D[]
100 103
         {
101
           new Static3D( 0.5f, 0.5f, 0.5f ),
102
           new Static3D( 0.5f, 0.5f,-0.5f ),
103
           new Static3D( 0.5f,-0.5f, 0.5f ),
104
           new Static3D( 0.5f,-0.5f,-0.5f ),
105
           new Static3D(-0.5f, 0.5f, 0.5f ),
106
           new Static3D(-0.5f, 0.5f,-0.5f ),
107
           new Static3D(-0.5f,-0.5f, 0.5f ),
108
           new Static3D(-0.5f,-0.5f,-0.5f ),
109

  
110
           new Static3D( 0.49f, 0.0f, 0.0f ),
111
           new Static3D(-0.49f, 0.0f, 0.0f ),
112
           new Static3D( 0.0f, 0.49f, 0.0f ),
113
           new Static3D( 0.0f,-0.49f, 0.0f ),
114
           new Static3D( 0.0f, 0.0f, 0.49f ),
115
           new Static3D( 0.0f, 0.0f,-0.49f ),
104
           new Static3D( DIST_CORNER, DIST_CORNER, DIST_CORNER ),
105
           new Static3D( DIST_CORNER, DIST_CORNER,-DIST_CORNER ),
106
           new Static3D( DIST_CORNER,-DIST_CORNER, DIST_CORNER ),
107
           new Static3D( DIST_CORNER,-DIST_CORNER,-DIST_CORNER ),
108
           new Static3D(-DIST_CORNER, DIST_CORNER, DIST_CORNER ),
109
           new Static3D(-DIST_CORNER, DIST_CORNER,-DIST_CORNER ),
110
           new Static3D(-DIST_CORNER,-DIST_CORNER, DIST_CORNER ),
111
           new Static3D(-DIST_CORNER,-DIST_CORNER,-DIST_CORNER ),
112

  
113
           new Static3D( DIST_CENTER,        0.0f,        0.0f ),
114
           new Static3D(-DIST_CENTER,        0.0f,        0.0f ),
115
           new Static3D(        0.0f, DIST_CENTER,        0.0f ),
116
           new Static3D(        0.0f,-DIST_CENTER,        0.0f ),
117
           new Static3D(        0.0f,        0.0f, DIST_CENTER ),
118
           new Static3D(        0.0f,        0.0f,-DIST_CENTER ),
116 119
         };
117 120

  
118 121
  // Colors of the faces of cubits. Each cubit, even the face pyramid, has 6 faces
......
560 563

  
561 564
  public int computeRowFromOffset(float offset)
562 565
    {
563
    return offset<0.5f ? 0:1;
566
    return offset<0.25f ? 0:1;
564 567
    }
565 568

  
566 569
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff