Project

General

Profile

« Previous | Next » 

Revision d2e06841

Added by Leszek Koltunski 10 months ago

progress with TwistyBandagedMegaminx.

View differences:

src/main/java/org/distorted/objectlib/bandaged/BandagedObjectCuboid.java
22 22

  
23 23
public class BandagedObjectCuboid extends BandagedObject
24 24
{
25
  private float[][] getCuts(int[] numLayers)
26
    {
27
    float[][] ret = new float[3][];
28

  
29
    for(int axis=0; axis<3; axis++)
30
      {
31
      int len = numLayers[axis];
32
      float start = (2-len)*0.5f;
33

  
34
      if( len>=2 )
35
        {
36
        ret[axis] = new float[len-1];
37
        for(int i=0; i<len-1; i++) ret[axis][i] = start+i;
38
        }
39
      }
40

  
41
    return ret;
42
    }
43

  
44
///////////////////////////////////////////////////////////////////////////////////////////////////
45

  
46
  float[][] getRotAxis()
47
    {
48
    return new float[][]
49
      {
50
        {1,0,0},
51
        {0,1,0},
52
        {0,0,1},
53
      };
54
    }
55

  
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57

  
25 58
  float getDist2D()
26 59
     {
27 60
     return 0.5f;
......
62 95

  
63 96
  public BandagedObjectCuboid(DistortedScreen screen)
64 97
     {
65
     super(screen,3);
98
     super(screen);
66 99
     }
67 100

  
68 101
///////////////////////////////////////////////////////////////////////////////////////////////////
......
138 171
        mSize[2] = z;
139 172
        mMax = x>y ? Math.max(x,z) : Math.max(y,z);
140 173
        mNumCubits = ( x<=1 || y<=1 || z<=1 ) ? x*y*z : x*y*z-(x-2)*(y-2)*(z-2);
174
        mCuts = getCuts(mSize);
141 175
        return true;
142 176
        }
143 177

  

Also available in: Unified diff