Project

General

Profile

« Previous | Next » 

Revision 1c55e462

Added by Leszek Koltunski over 2 years ago

Progress with BandagedCreator: joining cubits together. Still at least one (probably two) bugs here remain:

1) sometimes some of the walls of the newly creaed joined cubit are incorrectly rotated
2) there is an unpleasant flash when joining

View differences:

src/main/java/org/distorted/objectlib/helpers/FactoryBandaged3x3Cubit.java
1191 1191
    int numComponents    = indices.length;
1192 1192

  
1193 1193
    FactoryCubit factory = FactoryCubit.getInstance();
1194
    factory.clear();
1194 1195
    factory.createNewFaceTransform(shape,null);
1195 1196
    return factory.createRoundedSolid(shape,face,MESH_NICE,numComponents);
1196 1197
    }
src/main/java/org/distorted/objectlib/helpers/FactoryCubit.java
73 73
  private static final ArrayList<FaceTransform> mOldFaceTransf = new ArrayList<>();
74 74
  private static final ArrayList<StickerCoords> mStickerCoords = new ArrayList<>();
75 75

  
76
private final float[] mqx,mqy,mqz,mqw;
77
private int mnum;
78

  
76 79
///////////////////////////////////////////////////////////////////////////////////////////////////
77 80

  
78 81
  private FactoryCubit()
79 82
    {
80

  
83
int num= 100;
84
mqx = new float[num];
85
mqy = new float[num];
86
mqz = new float[num];
87
mqw = new float[num];
81 88
    }
82 89

  
83 90
///////////////////////////////////////////////////////////////////////////////////////////////////
......
816 823
      {
817 824
      printTransform(mNewFaceTransf.get(f));
818 825
      }
826

  
827
    android.util.Log.d("D", "---- used quats ---");
828

  
829
    for(int i=0; i<mnum; i++)
830
      {
831
      android.util.Log.e("D", mqx[i]+" "+mqy[i]+" "+mqz[i]+" "+mqw[i]);
832
      }
819 833
    }
820 834

  
821 835
///////////////////////////////////////////////////////////////////////////////////////////////////
......
1058 1072
    MeshBase mesh = new MeshJoined(meshes);
1059 1073
    Static3D center = new Static3D(0,0,0);
1060 1074

  
1075
mnum = numFaces;
1076

  
1061 1077
    for(int face=0; face<numFaces; face++)
1062 1078
      {
1063 1079
      int assoc = (1<<face);
......
1072 1088
      float qz = fInfo.qz;
1073 1089
      float qw = fInfo.qw;
1074 1090

  
1091
mqx[face]=qx;
1092
mqy[face]=qy;
1093
mqz[face]=qz;
1094
mqw[face]=qw;
1095

  
1075 1096
      Static3D scale = new Static3D(sc,sc,sc);
1076 1097
      Static3D move3D= new Static3D(vx,vy,vz);
1077 1098
      Static4D quat  = new Static4D(qx,qy,qz,qw);

Also available in: Unified diff