Project

General

Profile

« Previous | Next » 

Revision 064ccc31

Added by Leszek Koltunski about 4 years ago

Missing meshes; fix the Solver.

View differences:

src/main/java/org/distorted/objects/TwistyCube.java
421 421
      objectString.append(FACE_NAMES[color]);
422 422
      }
423 423

  
424
     face = FRONT;
424
    face = FRONT;
425 425

  
426 426
    for(int i=0; i<len; i++)
427 427
      {
src/main/java/org/distorted/objects/TwistyObject.java
346 346
  int getCubitFaceColorIndex(int cubit, int face)
347 347
    {
348 348
    Static4D texMap = mMesh.getTextureMap(NUM_FACES*cubit + face);
349
    return (int)(texMap.get0() / texMap.get2());
349

  
350
    int x = (int)(texMap.get0()/texMap.get2());
351
    int y = (int)(texMap.get1()/texMap.get3());
352

  
353
    return (mNumTexRows-1-y)*NUM_STICKERS_IN_ROW + x;
350 354
    }
351 355

  
352 356
///////////////////////////////////////////////////////////////////////////////////////////////////
......
561 565

  
562 566
  public void setTextureMap(int cubit, int face, int newColor)
563 567
    {
564
    final float ratio = 1.0f/(NUM_TEXTURES+1);
568
    final float ratioW = 1.0f/mNumTexCols;
569
    final float ratioH = 1.0f/mNumTexRows;
565 570
    final Static4D[] maps = new Static4D[NUM_CUBIT_FACES];
571
    int row = (mNumTexRows-1) - newColor/mNumTexCols;
572
    int col = newColor%mNumTexCols;
566 573

  
567
    maps[face] = new Static4D( newColor*ratio, 0.0f, ratio, 1.0f);
574
    maps[face] = new Static4D( col*ratioW, row*ratioH, ratioW, ratioH);
568 575
    mMesh.setTextureMap(maps,NUM_CUBIT_FACES*cubit);
569 576
    }
570 577

  

Also available in: Unified diff