Project

General

Profile

« Previous | Next » 

Revision e6cf7283

Added by Leszek Koltunski about 3 years ago

Change the Cubit center from a Static3D to a float[].
The point: now we can have more than one center, and bandaged objects need more than one, because in this way they are going to fill up their RotationRow bitmaps.

View differences:

src/main/java/org/distorted/objects/TwistyPyraminx.java
82 82

  
83 83
///////////////////////////////////////////////////////////////////////////////////////////////////
84 84

  
85
  private void addTetrahedralLattice(int size, int index, Static3D[] pos)
85
  private void addTetrahedralLattice(int size, int index, float[][] pos)
86 86
    {
87 87
    final float DX = 1.0f;
88 88
    final float DY = SQ2/2;
......
103 103

  
104 104
        for(int z=0; z<size-layer; z++)
105 105
          {
106
          pos[index] = new Static3D(currX,currY,currZ);
106
          pos[index] = new float[] {currX,currY,currZ};
107 107
          index++;
108 108
          currZ -= DZ;
109 109
          }
......
120 120
///////////////////////////////////////////////////////////////////////////////////////////////////
121 121
// there are (n^3-n)/6 octahedrons and ((n+1)^3 - (n+1))/6 tetrahedrons
122 122

  
123
  Static3D[] getCubitPositions(int size)
123
  float[][] getCubitPositions(int size)
124 124
    {
125 125
    int numOcta = (size-1)*size*(size+1)/6;
126 126
    int numTetra= size*(size+1)*(size+2)/6;
127
    Static3D[] ret = new Static3D[numOcta+numTetra];
127
    float[][] ret = new float[numOcta+numTetra][];
128 128

  
129 129
    addTetrahedralLattice(size-1,      0,ret);
130 130
    addTetrahedralLattice(size  ,numOcta,ret);

Also available in: Unified diff