Normand Briere
2019-06-13 4629090fafbef256abd0686a85ee12042d658868
CameraPane.java
....@@ -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
....@@ -1628,7 +1628,7 @@
16281628
16291629 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
16301630
1631
- float[] colorV = GrafreeD.colorV;
1631
+ float[] colorV = Grafreed.colorV;
16321632
16331633 /**/
16341634 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -2140,7 +2140,7 @@
21402140 System.err.println("LIVE = " + Globals.isLIVE());
21412141
21422142 if (!Globals.isLIVE()) // save sound
2143
- GrafreeD.savesound = true; // wav.save();
2143
+ Grafreed.savesound = true; // wav.save();
21442144 // else
21452145 repaint(); // start loop // may 2013
21462146 }
....@@ -2265,9 +2265,9 @@
22652265 LOOKAT ^= true;
22662266 }
22672267
2268
- void ToggleRandom()
2268
+ void ToggleSwitch()
22692269 {
2270
- RANDOM ^= true;
2270
+ SWITCH ^= true;
22712271 }
22722272
22732273 void ToggleHandles()
....@@ -8022,7 +8022,7 @@
80228022 }
80238023 }
80248024
8025
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8025
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
80268026 {
80278027 if (// DrawMode() != 0 || /*tex == null ||*/
80288028 ambientOcclusion ) // || !textureon)
....@@ -8067,7 +8067,7 @@
80678067 return; // true;
80688068 }
80698069
8070
- CacheTexture GetCacheTexture(String tex, boolean bump, int resolution)
8070
+ CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception
80718071 {
80728072 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
80738073
....@@ -8075,12 +8075,16 @@
80758075 {
80768076 String texname = tex;
80778077
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;
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
+ }
80848088
80858089 if (CACHETEXTURE)
80868090 texture = textures.get(texname); // TEXTURE CACHE
....@@ -8180,7 +8184,9 @@
81808184 texturedata = GetFileTexture(cachename, processbump, resolution);
81818185
81828186
8183
- if (texturedata != null)
8187
+ if (texturedata == null)
8188
+ throw new Exception();
8189
+
81848190 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
81858191 //texture = GetTexture(tex, bump);
81868192 }
....@@ -8302,7 +8308,7 @@
83028308 return texture;
83038309 }
83048310
8305
- 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
83068312 {
83078313 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83088314
....@@ -8320,14 +8326,14 @@
83208326 return texture!=null?texture.texture:null;
83218327 }
83228328
8323
- 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
83248330 {
83258331 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83268332
83278333 return texture!=null?texture.texturedata:null;
83288334 }
83298335
8330
- boolean BindTexture(String tex, boolean bump, int resolution)
8336
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
83318337 {
83328338 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
83338339 {
....@@ -9538,7 +9544,7 @@
95389544
95399545 if (!BOXMODE)
95409546 {
9541
- 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) + ")");
95429548 }
95439549
95449550 if (!BOXMODE)
....@@ -9576,7 +9582,7 @@
95769582 ABORTED = false;
95779583 }
95789584 else
9579
- GrafreeD.wav.cursor += 735 * ACSIZE;
9585
+ Grafreed.wav.cursor += 735 * ACSIZE;
95809586
95819587 if (false)
95829588 {
....@@ -10239,11 +10245,11 @@
1023910245
1024010246 public void display(GLAutoDrawable drawable)
1024110247 {
10242
- if (GrafreeD.savesound && GrafreeD.hassound)
10248
+ if (Grafreed.savesound && Grafreed.hassound)
1024310249 {
10244
- GrafreeD.wav.save();
10245
- GrafreeD.savesound = false;
10246
- GrafreeD.hassound = false;
10250
+ Grafreed.wav.save();
10251
+ Grafreed.savesound = false;
10252
+ Grafreed.hassound = false;
1024710253 }
1024810254 // if (DEBUG_SELECTION)
1024910255 // {
....@@ -10373,7 +10379,7 @@
1037310379 Object3D theobject = object;
1037410380 Object3D theparent = object.parent;
1037510381 object.parent = null;
10376
- object = (Object3D)GrafreeD.clone(object);
10382
+ object = (Object3D)Grafreed.clone(object);
1037710383 object.Stripify();
1037810384 if (theobject.selection == null || theobject.selection.Size() == 0)
1037910385 theobject.PreprocessOcclusion(this);
....@@ -10386,13 +10392,13 @@
1038610392 ambientOcclusion = false;
1038710393 }
1038810394
10389
- if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN)
10395
+ if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1039010396 {
1039110397 //if (RENDERSHADOW) // ?
1039210398 if (!IsFrozen())
1039310399 {
1039410400 // dec 2012
10395
- if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0))
10401
+ if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0))
1039610402 {
1039710403 Globals.framecount++;
1039810404 shadowbuffer.display();
....@@ -10794,7 +10800,16 @@
1079410800 // Bump noise
1079510801 gl.glActiveTexture(GL.GL_TEXTURE6);
1079610802 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10797
- 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
+
1079810813
1079910814 gl.glActiveTexture(GL.GL_TEXTURE0);
1080010815 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -11279,8 +11294,8 @@
1127911294 e.printStackTrace();
1128011295 }
1128111296
11282
- if (GrafreeD.RENDERME > 0)
11283
- GrafreeD.RENDERME--; // mechante magouille
11297
+ if (Grafreed.RENDERME > 0)
11298
+ Grafreed.RENDERME--; // mechante magouille
1128411299
1128511300 Globals.ONESTEP = false;
1128611301 }
....@@ -11350,7 +11365,14 @@
1135011365
1135111366 usedtextures.clear();
1135211367
11353
- 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
+ }
1135411376 }
1135511377 //System.out.println("--> " + stackdepth);
1135611378 // GrafreeD.traceon();
....@@ -11441,7 +11463,14 @@
1144111463 if (checker != null && DrawMode() == DEFAULT)
1144211464 {
1144311465 //BindTexture(IMMORTAL_TEXTURE);
11444
- 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
+ }
1144511474 // NEAREST
1144611475 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1144711476 DrawChecker(gl);
....@@ -11523,7 +11552,7 @@
1152311552 return;
1152411553 }
1152511554
11526
- String string = obj.GetToolTip();
11555
+ String string = obj.toString(); //.GetToolTip();
1152711556
1152811557 GL gl = GetGL();
1152911558
....@@ -12473,8 +12502,8 @@
1247312502
1247412503 // display shadow only (bump == 0)
1247512504 "SUB temp.x, half.x, shadow.x;" +
12476
- "MOV temp.y, -params6.x;" +
12477
- "SLT temp.z, temp.y, zero.x;" +
12505
+ "MOV temp.y, -params5.z;" + // params6.x;" +
12506
+ "SLT temp.z, temp.y, -one2048th.x;" +
1247812507 "SUB temp.y, one.x, temp.z;" +
1247912508 "MUL temp.x, temp.x, temp.y;" +
1248012509 "KIL temp.x;" +
....@@ -12603,8 +12632,10 @@
1260312632 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1260412633
1260512634 "SUB temp.x, one.x, ndotl.x;" +
12606
- "ADD temp.x, temp.x, options2.z;" + // lightsheen
12607
- "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
1260812639 "MUL temp.x, temp.x, temp.y;" +
1260912640
1261012641 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12752,7 +12783,7 @@
1275212783 "MUL final.y, fragment.texcoord[0].x, c256;" +
1275312784 "FLR final.x, final.y;" +
1275412785 "SUB final.y, final.y, final.x;" +
12755
- //"MUL final.x, final.x, c256i;" +
12786
+ "MUL final.x, final.x, c256i;" +
1275612787 "MOV final.z, zero.x;" +
1275712788 "MOV final.a, one.w;":""
1275812789 ) +
....@@ -12760,7 +12791,7 @@
1276012791 "MUL final.y, fragment.texcoord[0].y, c256;" +
1276112792 "FLR final.x, final.y;" +
1276212793 "SUB final.y, final.y, final.x;" +
12763
- //"MUL final.x, final.x, c256i;" +
12794
+ "MUL final.x, final.x, c256i;" +
1276412795 "MOV final.z, zero.x;" +
1276512796 "MOV final.a, one.w;":""
1276612797 ) +
....@@ -12803,7 +12834,7 @@
1280312834 //once = true;
1280412835 }
1280512836
12806
- System.out.print("Program #" + mode + "; length = " + program.length());
12837
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1280712838 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1280812839 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1280912840
....@@ -12936,12 +12967,16 @@
1293612967
1293712968 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1293812969 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
12970
+
12971
+ // Compare fragment depth in light space with shadowmap.
1293912972 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1294012973 "SGE temp.y, temp.x, zero.x;" +
12941
- "SUB " + shadow + ".y, one.x, temp.y;" +
12974
+ "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded
12975
+
12976
+ // Reverse comparison
1294212977 "SUB temp.x, one.x, temp.x;" +
1294312978 "MUL " + shadow + ".x, temp.x, temp.y;" +
12944
- "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded
12979
+ "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse
1294512980 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1294612981
1294712982 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12955,6 +12990,10 @@
1295512990 // No shadow for backface
1295612991 "DP3 temp.x, normal, lightd;" +
1295712992 "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;" +
1295812997 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1295912998 "";
1296012999 }
....@@ -13513,7 +13552,7 @@
1351313552 public void mousePressed(MouseEvent e)
1351413553 {
1351513554 //System.out.println("mousePressed: " + e);
13516
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13555
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1351713556 }
1351813557
1351913558 static long prevtime = 0;
....@@ -13589,8 +13628,8 @@
1358913628 // mode |= META;
1359013629 //}
1359113630
13592
- SetMouseMode(WHEEL | e.getModifiersEx());
13593
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13631
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13632
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1359413633 anchorX = ax;
1359513634 anchorY = ay;
1359613635 prevX = px;
....@@ -13650,6 +13689,10 @@
1365013689 // wasliveok = true;
1365113690 // waslive = false;
1365213691
13692
+ // May 2019 Forget it:
13693
+ if (true)
13694
+ return;
13695
+
1365313696 // source == timer
1365413697 if (mouseDown)
1365513698 {
....@@ -13688,7 +13731,7 @@
1368813731
1368913732 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1369013733
13691
- void clickStart(int x, int y, int modifiers)
13734
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1369213735 {
1369313736 if (!wasliveok)
1369413737 return;
....@@ -13705,7 +13748,7 @@
1370513748 // touched = true; // main DL
1370613749 if (isRenderer)
1370713750 {
13708
- SetMouseMode(modifiers);
13751
+ SetMouseMode(modifiers, modifiersex);
1370913752 }
1371013753
1371113754 selectX = anchorX = x;
....@@ -13718,7 +13761,7 @@
1371813761 clicked = true;
1371913762 hold = false;
1372013763
13721
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13764
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1372213765 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1372313766 {
1372413767 // System.out.println("RESTART II " + modifiers);
....@@ -13749,7 +13792,7 @@
1374913792 info.camera = renderCamera;
1375013793 info.x = x;
1375113794 info.y = y;
13752
- info.modifiers = modifiers;
13795
+ info.modifiers = modifiersex;
1375313796 editObj = object.doEditClick(info, 0);
1375413797 if (!editObj)
1375513798 {
....@@ -13778,7 +13821,7 @@
1377813821 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1377913822 }
1378013823 else
13781
- drag(e.getX(), e.getY(), e.getModifiersEx());
13824
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1378213825
1378313826 //try { Thread.sleep(1); } catch (Exception ex) {}
1378413827 }
....@@ -14015,7 +14058,7 @@
1401514058 {
1401614059 Globals.lighttouched = true;
1401714060 }
14018
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14061
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1401914062 }
1402014063 //else
1402114064 }
....@@ -14115,7 +14158,7 @@
1411514158 int X, Y;
1411614159 boolean SX, SY;
1411714160
14118
- void drag(int x, int y, int modifiers)
14161
+ void drag(int x, int y, int modifiers, int modifiersex)
1411914162 {
1412014163 if (IsFrozen())
1412114164 {
....@@ -14124,17 +14167,17 @@
1412414167
1412514168 drag = true; // NEW
1412614169
14127
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14170
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1412814171
1412914172 X = x;
1413014173 Y = y;
1413114174 // floating state for animation
14132
- MODIFIERS = modifiers;
14133
- modifiers &= ~1024;
14175
+ MODIFIERS = modifiersex;
14176
+ modifiersex &= ~1024;
1413414177 if (false) // modifiers != 0)
1413514178 {
1413614179 //new Exception().printStackTrace();
14137
- System.out.println("mouseDragged: " + modifiers);
14180
+ System.out.println("mouseDragged: " + modifiersex);
1413814181 System.out.println("SHIFT = " + SHIFT);
1413914182 System.out.println("CONTROL = " + COMMAND);
1414014183 System.out.println("META = " + META);
....@@ -14154,7 +14197,7 @@
1415414197 info.camera = renderCamera;
1415514198 info.x = x;
1415614199 info.y = y;
14157
- object.editWindow.copy.doEditDrag(info);
14200
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1415814201 } else
1415914202 {
1416014203 if (x < startX)
....@@ -14331,6 +14374,7 @@
1433114374 public void mouseReleased(MouseEvent e)
1433214375 {
1433314376 movingcamera = false;
14377
+ X = Y = 0;
1433414378 //System.out.println("mouseReleased: " + e);
1433514379 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1433614380 }
....@@ -14353,9 +14397,9 @@
1435314397 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1435414398 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1435514399
14356
- if (control || command || IsFrozen())
14400
+// No delay if (control || command || IsFrozen())
1435714401 timeout = true;
14358
- else
14402
+// ?? May 2019 else
1435914403 // timer.setDelay((modifiers & 128) != 0?0:350);
1436014404 mouseDown = false;
1436114405 if (!control && !command) // june 2013
....@@ -14465,7 +14509,7 @@
1446514509 System.out.println("keyReleased: " + e);
1446614510 }
1446714511
14468
- void SetMouseMode(int modifiers)
14512
+ void SetMouseMode(int modifiers, int modifiersex)
1446914513 {
1447014514 //System.out.println("SetMouseMode = " + modifiers);
1447114515 //modifiers &= ~1024;
....@@ -14477,25 +14521,25 @@
1447714521 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1447814522 // return;
1447914523 //System.out.println("SetMode = " + modifiers);
14480
- if ((modifiers & WHEEL) == WHEEL)
14524
+ if ((modifiersex & WHEEL) == WHEEL)
1448114525 {
1448214526 mouseMode |= ZOOM;
1448314527 }
1448414528
1448514529 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14486
- if (capsLocked || (modifiers & META) == META)
14530
+ if (capsLocked) // || (modifiers & META) == META)
1448714531 {
1448814532 mouseMode |= VR; // BACKFORTH;
1448914533 }
14490
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14534
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1449114535 {
1449214536 mouseMode |= SELECT;
1449314537 }
14494
- if ((modifiers & COMMAND) == COMMAND)
14538
+ if ((modifiersex & COMMAND) == COMMAND)
1449514539 {
1449614540 mouseMode |= SELECT;
1449714541 }
14498
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14542
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1449914543 {
1450014544 mouseMode &= ~VR;
1450114545 mouseMode |= TRANSLATE;
....@@ -14524,7 +14568,7 @@
1452414568
1452514569 if (isRenderer) //
1452614570 {
14527
- SetMouseMode(modifiers);
14571
+ SetMouseMode(0, modifiers);
1452814572 }
1452914573
1453014574 Globals.theRenderer.keyPressed(key);
....@@ -14860,7 +14904,7 @@
1486014904 //RESIZETEXTURE ^= true;
1486114905 //break;
1486214906 case 'z':
14863
- RENDERSHADOW ^= true;
14907
+ Globals.RENDERSHADOW ^= true;
1486414908 Globals.lighttouched = true;
1486514909 repaint();
1486614910 break;
....@@ -14984,7 +15028,7 @@
1498415028 //mode = ROTATE;
1498515029 if ((MODIFIERS & COMMAND) == 0) // VR??
1498615030 {
14987
- SetMouseMode(modifiers);
15031
+ SetMouseMode(0, modifiers);
1498815032 }
1498915033 }
1499015034
....@@ -15120,7 +15164,7 @@
1512015164 {
1512115165 //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
1512215166 //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15123
- if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
15167
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1512415168 {
1512515169 mouseMoved(e);
1512615170 } else
....@@ -15339,7 +15383,9 @@
1533915383 info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1534015384 //Image img = CreateImage(width, height);
1534115385 //System.out.println("width = " + width + "; height = " + height + "\n");
15386
+
1534215387 Graphics gr = g; // img.getGraphics();
15388
+
1534315389 if (!hasMarquee)
1534415390 {
1534515391 if (Xmin < Xmax) // !locked)
....@@ -15437,14 +15483,28 @@
1543715483 if (!isRenderer)
1543815484 {
1543915485 object.drawEditHandles(info, 0);
15486
+
15487
+ if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15488
+ {
15489
+ switch (object.selection.get(0).hitSomething)
15490
+ {
15491
+ case Object3D.hitCenter: gr.setColor(Color.pink); break;
15492
+ case Object3D.hitRotate: gr.setColor(Color.green); break;
15493
+ case Object3D.hitScale: gr.setColor(Color.cyan); break;
15494
+ }
15495
+
15496
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15497
+ }
1544015498 }
1544115499 }
15500
+
1544215501 if (isRenderer)
1544315502 {
1544415503 //gr.setColor(Color.black);
1544515504 //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1);
1544615505 //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3);
1544715506 }
15507
+
1544815508 if (hasMarquee)
1544915509 {
1545015510 gr.setXORMode(Color.white);
....@@ -15557,6 +15617,7 @@
1555715617 public boolean mouseDown(Event evt, int x, int y)
1555815618 {
1555915619 System.out.println("mouseDown: " + evt);
15620
+ System.exit(0);
1556015621 /*
1556115622 locked = true;
1556215623 drag = false;
....@@ -15600,7 +15661,7 @@
1560015661 {
1560115662 keyPressed(0, modifiers);
1560215663 }
15603
- clickStart(x, y, modifiers);
15664
+ // clickStart(x, y, modifiers);
1560415665 return true;
1560515666 }
1560615667
....@@ -15718,7 +15779,7 @@
1571815779 {
1571915780 keyReleased(0, 0);
1572015781 }
15721
- drag(x, y, modifiers);
15782
+ drag(x, y, 0, modifiers);
1572215783 return true;
1572315784 }
1572415785
....@@ -16416,16 +16477,16 @@
1641616477 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]));
1641716478 }
1641816479
16419
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16480
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1642016481 }
1642116482 }
1642216483
1642316484 if (!movingcamera && !PAINTMODE)
1642416485 object.editWindow.ScreenFitPoint(); // fev 2014
1642516486
16426
- if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
16487
+ if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1642716488 {
16428
- Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16489
+ Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1642916490
1643016491 Object3D group = new Object3D("inst" + paintcount++);
1643116492
....@@ -16581,7 +16642,7 @@
1658116642 gl.glDisable(gl.GL_CULL_FACE);
1658216643 }
1658316644
16584
- if (!RENDERSHADOW)
16645
+ if (!Globals.RENDERSHADOW)
1658516646 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1658616647
1658716648 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16591,7 +16652,7 @@
1659116652 //gl.glColorMask(false, false, false, false);
1659216653
1659316654 //render_scene_from_light_view(gl, drawable, 0, 0);
16594
- if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16655
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1659516656 {
1659616657 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1659716658