Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
CameraPane.java
....@@ -56,8 +56,6 @@
5656 static int CURRENTANTIALIAS = 0; // 1;
5757 /*static*/ boolean RENDERSHADOW = true;
5858 /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal
59
- static boolean ANIMATION = false;
60
- static String filename;
6159
6260 boolean DISPLAYTEXT = false;
6361 //boolean REDUCETEXTURE = true;
....@@ -92,6 +90,8 @@
9290
9391 static int tickcount = 0; // slow pose issue
9492
93
+static boolean BUTTONLESSWHEEL = false;
94
+static boolean ZOOMBOXMODE = false;
9595 static boolean BOXMODE = false;
9696 static boolean IMAGEFLIP = false;
9797 static boolean SMOOTHFOCUS = false;
....@@ -106,7 +106,7 @@
106106 static boolean OEIL = true;
107107 static boolean OEILONCE = false; // do oeilon then oeiloff
108108 static boolean LOOKAT = true;
109
-static boolean RANDOM = true; // false;
109
+static boolean SWITCH = true; // false;
110110 static boolean HANDLES = false; // selection doesn't work!!
111111 static boolean PAINTMODE = false;
112112
....@@ -223,6 +223,11 @@
223223 public boolean IsBoxMode()
224224 {
225225 return BOXMODE;
226
+ }
227
+
228
+ public boolean IsZoomBoxMode()
229
+ {
230
+ return ZOOMBOXMODE;
226231 }
227232
228233 public void ClearDepth()
....@@ -1612,18 +1617,18 @@
16121617 //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
16131618 if (!material.multiply)
16141619 {
1615
- display.color = color;
1620
+ display.color = material.color;
16161621 display.saturation = material.modulation;
16171622 }
16181623 else
16191624 {
1620
- display.color *= color*2;
1625
+ display.color *= material.color*2;
16211626 display.saturation *= material.modulation*2;
16221627 }
16231628
16241629 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
16251630
1626
- float[] colorV = GrafreeD.colorV;
1631
+ float[] colorV = Grafreed.colorV;
16271632
16281633 /**/
16291634 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -2135,7 +2140,7 @@
21352140 System.err.println("LIVE = " + Globals.isLIVE());
21362141
21372142 if (!Globals.isLIVE()) // save sound
2138
- GrafreeD.savesound = true; // wav.save();
2143
+ Grafreed.savesound = true; // wav.save();
21392144 // else
21402145 repaint(); // start loop // may 2013
21412146 }
....@@ -2168,6 +2173,11 @@
21682173 public void ToggleBoxMode()
21692174 {
21702175 BOXMODE ^= true;
2176
+ }
2177
+
2178
+ public void ToggleZoomBoxMode()
2179
+ {
2180
+ ZOOMBOXMODE ^= true;
21712181 }
21722182
21732183 public void ToggleSmoothFocus()
....@@ -2257,7 +2267,7 @@
22572267
22582268 void ToggleRandom()
22592269 {
2260
- RANDOM ^= true;
2270
+ SWITCH ^= true;
22612271 }
22622272
22632273 void ToggleHandles()
....@@ -4196,6 +4206,7 @@
41964206
41974207 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
41984208 {
4209
+ new Exception().printStackTrace();
41994210 System.exit(0);
42004211 com.sun.opengl.util.texture.Texture texture = null;
42014212
....@@ -8011,7 +8022,7 @@
80118022 }
80128023 }
80138024
8014
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8025
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
80158026 {
80168027 if (// DrawMode() != 0 || /*tex == null ||*/
80178028 ambientOcclusion ) // || !textureon)
....@@ -8056,7 +8067,7 @@
80568067 return; // true;
80578068 }
80588069
8059
- CacheTexture GetCacheTexture(String tex, boolean bump, int resolution)
8070
+ CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception
80608071 {
80618072 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
80628073
....@@ -8064,12 +8075,16 @@
80648075 {
80658076 String texname = tex;
80668077
8067
- String[] split = tex.split("Textures");
8068
- if (split.length > 1)
8069
- texname = "/Users/nbriere/Textures" + split[split.length-1];
8070
- else
8071
- if (!texname.startsWith("/"))
8072
- texname = "/Users/nbriere/Textures/" + texname;
8078
+// String[] split = tex.split("Textures");
8079
+// if (split.length > 1)
8080
+// texname = "/Users/nbriere/Textures" + split[split.length-1];
8081
+// else
8082
+// if (!texname.startsWith("/"))
8083
+// texname = "/Users/nbriere/Textures/" + texname;
8084
+ if (!new File(tex).exists())
8085
+ {
8086
+ texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname;
8087
+ }
80738088
80748089 if (CACHETEXTURE)
80758090 texture = textures.get(texname); // TEXTURE CACHE
....@@ -8169,7 +8184,9 @@
81698184 texturedata = GetFileTexture(cachename, processbump, resolution);
81708185
81718186
8172
- if (texturedata != null)
8187
+ if (texturedata == null)
8188
+ throw new Exception();
8189
+
81738190 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
81748191 //texture = GetTexture(tex, bump);
81758192 }
....@@ -8291,7 +8308,7 @@
82918308 return texture;
82928309 }
82938310
8294
- com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution)
8311
+ com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception
82958312 {
82968313 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
82978314
....@@ -8309,14 +8326,14 @@
83098326 return texture!=null?texture.texture:null;
83108327 }
83118328
8312
- public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution)
8329
+ public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception
83138330 {
83148331 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83158332
83168333 return texture!=null?texture.texturedata:null;
83178334 }
83188335
8319
- boolean BindTexture(String tex, boolean bump, int resolution)
8336
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
83208337 {
83218338 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
83228339 {
....@@ -9382,7 +9399,7 @@
93829399 //gl.glFlush();
93839400 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93849401
9385
- if (ANIMATION && ABORTED)
9402
+ if (Globals.ANIMATION && ABORTED)
93869403 {
93879404 System.err.println(" ABORTED FRAME");
93889405 break;
....@@ -9412,7 +9429,7 @@
94129429 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94139430
94149431 // save image
9415
- if (ANIMATION && !ABORTED)
9432
+ if (Globals.ANIMATION && !ABORTED)
94169433 {
94179434 VPwidth = viewport[2];
94189435 VPheight = viewport[3];
....@@ -9523,11 +9540,11 @@
95239540
95249541 // imagecount++;
95259542
9526
- String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
9543
+ String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
95279544
95289545 if (!BOXMODE)
95299546 {
9530
- System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")");
9547
+ System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")");
95319548 }
95329549
95339550 if (!BOXMODE)
....@@ -9565,7 +9582,7 @@
95659582 ABORTED = false;
95669583 }
95679584 else
9568
- GrafreeD.wav.cursor += 735 * ACSIZE;
9585
+ Grafreed.wav.cursor += 735 * ACSIZE;
95699586
95709587 if (false)
95719588 {
....@@ -10228,11 +10245,11 @@
1022810245
1022910246 public void display(GLAutoDrawable drawable)
1023010247 {
10231
- if (GrafreeD.savesound && GrafreeD.hassound)
10248
+ if (Grafreed.savesound && Grafreed.hassound)
1023210249 {
10233
- GrafreeD.wav.save();
10234
- GrafreeD.savesound = false;
10235
- GrafreeD.hassound = false;
10250
+ Grafreed.wav.save();
10251
+ Grafreed.savesound = false;
10252
+ Grafreed.hassound = false;
1023610253 }
1023710254 // if (DEBUG_SELECTION)
1023810255 // {
....@@ -10362,7 +10379,7 @@
1036210379 Object3D theobject = object;
1036310380 Object3D theparent = object.parent;
1036410381 object.parent = null;
10365
- object = (Object3D)GrafreeD.clone(object);
10382
+ object = (Object3D)Grafreed.clone(object);
1036610383 object.Stripify();
1036710384 if (theobject.selection == null || theobject.selection.Size() == 0)
1036810385 theobject.PreprocessOcclusion(this);
....@@ -10783,7 +10800,16 @@
1078310800 // Bump noise
1078410801 gl.glActiveTexture(GL.GL_TEXTURE6);
1078510802 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10786
- BindTexture(NOISE_TEXTURE, false, 2);
10803
+
10804
+ try
10805
+ {
10806
+ BindTexture(NOISE_TEXTURE, false, 2);
10807
+ }
10808
+ catch (Exception e)
10809
+ {
10810
+ System.err.println("FAILED: " + NOISE_TEXTURE);
10811
+ }
10812
+
1078710813
1078810814 gl.glActiveTexture(GL.GL_TEXTURE0);
1078910815 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -11247,8 +11273,14 @@
1124711273 {
1124811274 renderpass++;
1124911275 // System.out.println("Draw object... ");
11276
+ STEP = 1;
1125011277 if (FAST) // in case there is no script
11251
- STEP = 16;
11278
+ STEP = 8;
11279
+
11280
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11281
+ {
11282
+ STEP *= 4;
11283
+ }
1125211284
1125311285 //object.FullInvariants();
1125411286
....@@ -11262,8 +11294,8 @@
1126211294 e.printStackTrace();
1126311295 }
1126411296
11265
- if (GrafreeD.RENDERME > 0)
11266
- GrafreeD.RENDERME--; // mechante magouille
11297
+ if (Grafreed.RENDERME > 0)
11298
+ Grafreed.RENDERME--; // mechante magouille
1126711299
1126811300 Globals.ONESTEP = false;
1126911301 }
....@@ -11333,7 +11365,14 @@
1133311365
1133411366 usedtextures.clear();
1133511367
11336
- BindTextures(DEFAULT_TEXTURES, 2);
11368
+ try
11369
+ {
11370
+ BindTextures(DEFAULT_TEXTURES, 2);
11371
+ }
11372
+ catch (Exception e)
11373
+ {
11374
+ System.err.println("FAILED: " + DEFAULT_TEXTURES);
11375
+ }
1133711376 }
1133811377 //System.out.println("--> " + stackdepth);
1133911378 // GrafreeD.traceon();
....@@ -11424,7 +11463,14 @@
1142411463 if (checker != null && DrawMode() == DEFAULT)
1142511464 {
1142611465 //BindTexture(IMMORTAL_TEXTURE);
11427
- BindTextures(checker.GetTextures(), checker.texres);
11466
+ try
11467
+ {
11468
+ BindTextures(checker.GetTextures(), checker.texres);
11469
+ }
11470
+ catch (Exception e)
11471
+ {
11472
+ System.err.println("FAILED: " + checker.GetTextures());
11473
+ }
1142811474 // NEAREST
1142911475 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1143011476 DrawChecker(gl);
....@@ -12456,8 +12502,8 @@
1245612502
1245712503 // display shadow only (bump == 0)
1245812504 "SUB temp.x, half.x, shadow.x;" +
12459
- "MOV temp.y, -params6.x;" +
12460
- "SLT temp.z, temp.y, zero.x;" +
12505
+ "MOV temp.y, -params5.z;" + // params6.x;" +
12506
+ "SLT temp.z, temp.y, -one2048th.x;" +
1246112507 "SUB temp.y, one.x, temp.z;" +
1246212508 "MUL temp.x, temp.x, temp.y;" +
1246312509 "KIL temp.x;" +
....@@ -12586,8 +12632,10 @@
1258612632 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1258712633
1258812634 "SUB temp.x, one.x, ndotl.x;" +
12589
- "ADD temp.x, temp.x, options2.z;" + // lightsheen
12590
- "ADD temp.y, one.y, options2.y;" + // sursurface
12635
+ // Tuning for default skin
12636
+ //"ADD temp.x, temp.x, options2.z;" + // lightsheen
12637
+ "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen
12638
+ "ADD temp.y, one.y, options2.y;" + // subsurface
1259112639 "MUL temp.x, temp.x, temp.y;" +
1259212640
1259312641 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12786,7 +12834,7 @@
1278612834 //once = true;
1278712835 }
1278812836
12789
- System.out.print("Program #" + mode + "; length = " + program.length());
12837
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1279012838 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1279112839 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1279212840
....@@ -12919,12 +12967,16 @@
1291912967
1292012968 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1292112969 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
12970
+
12971
+ // Compare fragment depth in light space with shadowmap.
1292212972 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1292312973 "SGE temp.y, temp.x, zero.x;" +
12924
- "SUB " + shadow + ".y, one.x, temp.y;" +
12974
+ "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded
12975
+
12976
+ // Reverse comparison
1292512977 "SUB temp.x, one.x, temp.x;" +
1292612978 "MUL " + shadow + ".x, temp.x, temp.y;" +
12927
- "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded
12979
+ "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse
1292812980 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1292912981
1293012982 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12938,6 +12990,10 @@
1293812990 // No shadow for backface
1293912991 "DP3 temp.x, normal, lightd;" +
1294012992 "SLT temp.x, temp.x, zero.x;" + // shadoweps
12993
+ "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
12994
+
12995
+ // No shadow when out of frustrum
12996
+ "SGE temp.x, " + depth + ".z, one.z;" +
1294112997 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1294212998 "";
1294312999 }
....@@ -13496,7 +13552,7 @@
1349613552 public void mousePressed(MouseEvent e)
1349713553 {
1349813554 //System.out.println("mousePressed: " + e);
13499
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13555
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1350013556 }
1350113557
1350213558 static long prevtime = 0;
....@@ -13523,6 +13579,7 @@
1352313579
1352413580 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1352513581
13582
+ if (BUTTONLESSWHEEL)
1352613583 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1352713584 {
1352813585 return;
....@@ -13531,7 +13588,7 @@
1353113588 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1353213589
1353313590 // TIMER
13534
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13591
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1353513592 {
1353613593 keepboxmode = BOXMODE;
1353713594 keepsupport = SUPPORT;
....@@ -13571,8 +13628,8 @@
1357113628 // mode |= META;
1357213629 //}
1357313630
13574
- SetMouseMode(WHEEL | e.getModifiersEx());
13575
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13631
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13632
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1357613633 anchorX = ax;
1357713634 anchorY = ay;
1357813635 prevX = px;
....@@ -13632,6 +13689,10 @@
1363213689 // wasliveok = true;
1363313690 // waslive = false;
1363413691
13692
+ // May 2019 Forget it:
13693
+ if (true)
13694
+ return;
13695
+
1363513696 // source == timer
1363613697 if (mouseDown)
1363713698 {
....@@ -13670,7 +13731,7 @@
1367013731
1367113732 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1367213733
13673
- void clickStart(int x, int y, int modifiers)
13734
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1367413735 {
1367513736 if (!wasliveok)
1367613737 return;
....@@ -13687,7 +13748,7 @@
1368713748 // touched = true; // main DL
1368813749 if (isRenderer)
1368913750 {
13690
- SetMouseMode(modifiers);
13751
+ SetMouseMode(modifiers, modifiersex);
1369113752 }
1369213753
1369313754 selectX = anchorX = x;
....@@ -13700,7 +13761,7 @@
1370013761 clicked = true;
1370113762 hold = false;
1370213763
13703
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13764
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1370413765 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1370513766 {
1370613767 // System.out.println("RESTART II " + modifiers);
....@@ -13731,7 +13792,7 @@
1373113792 info.camera = renderCamera;
1373213793 info.x = x;
1373313794 info.y = y;
13734
- info.modifiers = modifiers;
13795
+ info.modifiers = modifiersex;
1373513796 editObj = object.doEditClick(info, 0);
1373613797 if (!editObj)
1373713798 {
....@@ -13748,11 +13809,11 @@
1374813809
1374913810 public void mouseDragged(MouseEvent e)
1375013811 {
13812
+ //System.out.println("mouseDragged: " + e);
1375113813 if (isRenderer)
1375213814 movingcamera = true;
1375313815 //if (drawing)
1375413816 //return;
13755
- //System.out.println("mouseDragged: " + e);
1375613817 if ((e.getModifiersEx() & CTRL) != 0
1375713818 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1375813819 {
....@@ -13760,7 +13821,7 @@
1376013821 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1376113822 }
1376213823 else
13763
- drag(e.getX(), e.getY(), e.getModifiersEx());
13824
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1376413825
1376513826 //try { Thread.sleep(1); } catch (Exception ex) {}
1376613827 }
....@@ -13933,6 +13994,7 @@
1393313994
1393413995 public void run()
1393513996 {
13997
+ new Exception().printStackTrace();
1393613998 System.exit(0);
1393713999 for (;;)
1393814000 {
....@@ -13996,7 +14058,7 @@
1399614058 {
1399714059 Globals.lighttouched = true;
1399814060 }
13999
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14061
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1400014062 }
1400114063 //else
1400214064 }
....@@ -14096,7 +14158,7 @@
1409614158 int X, Y;
1409714159 boolean SX, SY;
1409814160
14099
- void drag(int x, int y, int modifiers)
14161
+ void drag(int x, int y, int modifiers, int modifiersex)
1410014162 {
1410114163 if (IsFrozen())
1410214164 {
....@@ -14105,17 +14167,17 @@
1410514167
1410614168 drag = true; // NEW
1410714169
14108
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14170
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1410914171
1411014172 X = x;
1411114173 Y = y;
1411214174 // floating state for animation
14113
- MODIFIERS = modifiers;
14114
- modifiers &= ~1024;
14175
+ MODIFIERS = modifiersex;
14176
+ modifiersex &= ~1024;
1411514177 if (false) // modifiers != 0)
1411614178 {
1411714179 //new Exception().printStackTrace();
14118
- System.out.println("mouseDragged: " + modifiers);
14180
+ System.out.println("mouseDragged: " + modifiersex);
1411914181 System.out.println("SHIFT = " + SHIFT);
1412014182 System.out.println("CONTROL = " + COMMAND);
1412114183 System.out.println("META = " + META);
....@@ -14135,7 +14197,7 @@
1413514197 info.camera = renderCamera;
1413614198 info.x = x;
1413714199 info.y = y;
14138
- object.editWindow.copy.doEditDrag(info);
14200
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1413914201 } else
1414014202 {
1414114203 if (x < startX)
....@@ -14287,7 +14349,6 @@
1428714349 public void mouseMoved(MouseEvent e)
1428814350 {
1428914351 //System.out.println("mouseMoved: " + e);
14290
-
1429114352 if (isRenderer)
1429214353 return;
1429314354
....@@ -14335,9 +14396,9 @@
1433514396 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1433614397 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1433714398
14338
- if (control || command || IsFrozen())
14399
+// No delay if (control || command || IsFrozen())
1433914400 timeout = true;
14340
- else
14401
+// ?? May 2019 else
1434114402 // timer.setDelay((modifiers & 128) != 0?0:350);
1434214403 mouseDown = false;
1434314404 if (!control && !command) // june 2013
....@@ -14447,7 +14508,7 @@
1444714508 System.out.println("keyReleased: " + e);
1444814509 }
1444914510
14450
- void SetMouseMode(int modifiers)
14511
+ void SetMouseMode(int modifiers, int modifiersex)
1445114512 {
1445214513 //System.out.println("SetMouseMode = " + modifiers);
1445314514 //modifiers &= ~1024;
....@@ -14459,25 +14520,25 @@
1445914520 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1446014521 // return;
1446114522 //System.out.println("SetMode = " + modifiers);
14462
- if ((modifiers & WHEEL) == WHEEL)
14523
+ if ((modifiersex & WHEEL) == WHEEL)
1446314524 {
1446414525 mouseMode |= ZOOM;
1446514526 }
1446614527
1446714528 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14468
- if (capsLocked || (modifiers & META) == META)
14529
+ if (capsLocked) // || (modifiers & META) == META)
1446914530 {
1447014531 mouseMode |= VR; // BACKFORTH;
1447114532 }
14472
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14533
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1447314534 {
1447414535 mouseMode |= SELECT;
1447514536 }
14476
- if ((modifiers & COMMAND) == COMMAND)
14537
+ if ((modifiersex & COMMAND) == COMMAND)
1447714538 {
1447814539 mouseMode |= SELECT;
1447914540 }
14480
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14541
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1448114542 {
1448214543 mouseMode &= ~VR;
1448314544 mouseMode |= TRANSLATE;
....@@ -14506,7 +14567,7 @@
1450614567
1450714568 if (isRenderer) //
1450814569 {
14509
- SetMouseMode(modifiers);
14570
+ SetMouseMode(0, modifiers);
1451014571 }
1451114572
1451214573 Globals.theRenderer.keyPressed(key);
....@@ -14842,7 +14903,7 @@
1484214903 //RESIZETEXTURE ^= true;
1484314904 //break;
1484414905 case 'z':
14845
- RENDERSHADOW ^= true;
14906
+ Globals.RENDERSHADOW ^= true;
1484614907 Globals.lighttouched = true;
1484714908 repaint();
1484814909 break;
....@@ -14966,7 +15027,7 @@
1496615027 //mode = ROTATE;
1496715028 if ((MODIFIERS & COMMAND) == 0) // VR??
1496815029 {
14969
- SetMouseMode(modifiers);
15030
+ SetMouseMode(0, modifiers);
1497015031 }
1497115032 }
1497215033
....@@ -15100,8 +15161,9 @@
1510015161
1510115162 protected void processMouseMotionEvent(MouseEvent e)
1510215163 {
15103
- //System.out.println("processMouseMotionEvent: " + mouseMode);
15104
- if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15164
+ //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
15165
+ //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15166
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1510515167 {
1510615168 mouseMoved(e);
1510715169 } else
....@@ -15131,6 +15193,7 @@
1513115193
1513215194 void SelectParent()
1513315195 {
15196
+ new Exception().printStackTrace();
1513415197 System.exit(0);
1513515198 Composite group = (Composite) object;
1513615199 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -15154,6 +15217,7 @@
1515415217
1515515218 void SelectChildren()
1515615219 {
15220
+ new Exception().printStackTrace();
1515715221 System.exit(0);
1515815222 /*
1515915223 Composite group = (Composite) object;
....@@ -15536,6 +15600,7 @@
1553615600 public boolean mouseDown(Event evt, int x, int y)
1553715601 {
1553815602 System.out.println("mouseDown: " + evt);
15603
+ System.exit(0);
1553915604 /*
1554015605 locked = true;
1554115606 drag = false;
....@@ -15579,7 +15644,7 @@
1557915644 {
1558015645 keyPressed(0, modifiers);
1558115646 }
15582
- clickStart(x, y, modifiers);
15647
+ // clickStart(x, y, modifiers);
1558315648 return true;
1558415649 }
1558515650
....@@ -15697,7 +15762,7 @@
1569715762 {
1569815763 keyReleased(0, 0);
1569915764 }
15700
- drag(x, y, modifiers);
15765
+ drag(x, y, 0, modifiers);
1570115766 return true;
1570215767 }
1570315768
....@@ -16267,6 +16332,7 @@
1626716332 {
1626816333 if (!selection)
1626916334 {
16335
+ new Exception().printStackTrace();
1627016336 System.exit(0);
1627116337 return;
1627216338 }
....@@ -16394,16 +16460,16 @@
1639416460 System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2]));
1639516461 }
1639616462
16397
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16463
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1639816464 }
1639916465 }
1640016466
1640116467 if (!movingcamera && !PAINTMODE)
1640216468 object.editWindow.ScreenFitPoint(); // fev 2014
1640316469
16404
- if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
16470
+ if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1640516471 {
16406
- Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16472
+ Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1640716473
1640816474 Object3D group = new Object3D("inst" + paintcount++);
1640916475
....@@ -16559,7 +16625,7 @@
1655916625 gl.glDisable(gl.GL_CULL_FACE);
1656016626 }
1656116627
16562
- if (!RENDERSHADOW)
16628
+ if (!Globals.RENDERSHADOW)
1656316629 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1656416630
1656516631 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16569,7 +16635,7 @@
1656916635 //gl.glColorMask(false, false, false, false);
1657016636
1657116637 //render_scene_from_light_view(gl, drawable, 0, 0);
16572
- if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16638
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1657316639 {
1657416640 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1657516641