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;
....@@ -86,7 +84,7 @@
8684 static boolean FULLSCREEN = false;
8785 static boolean SUPPORT = true;
8886 static boolean INERTIA = true;
89
-static boolean FAST = true; // false;
87
+static boolean FAST = false;
9088 static boolean SLOWPOSE = false;
9189 static boolean FOOTCONTACT = true;
9290
....@@ -108,7 +106,7 @@
108106 static boolean OEIL = true;
109107 static boolean OEILONCE = false; // do oeilon then oeiloff
110108 static boolean LOOKAT = true;
111
-static boolean RANDOM = true; // false;
109
+static boolean SWITCH = true; // false;
112110 static boolean HANDLES = false; // selection doesn't work!!
113111 static boolean PAINTMODE = false;
114112
....@@ -1630,7 +1628,7 @@
16301628
16311629 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
16321630
1633
- float[] colorV = GrafreeD.colorV;
1631
+ float[] colorV = Grafreed.colorV;
16341632
16351633 /**/
16361634 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -2142,7 +2140,7 @@
21422140 System.err.println("LIVE = " + Globals.isLIVE());
21432141
21442142 if (!Globals.isLIVE()) // save sound
2145
- GrafreeD.savesound = true; // wav.save();
2143
+ Grafreed.savesound = true; // wav.save();
21462144 // else
21472145 repaint(); // start loop // may 2013
21482146 }
....@@ -2269,7 +2267,7 @@
22692267
22702268 void ToggleRandom()
22712269 {
2272
- RANDOM ^= true;
2270
+ SWITCH ^= true;
22732271 }
22742272
22752273 void ToggleHandles()
....@@ -4208,6 +4206,7 @@
42084206
42094207 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
42104208 {
4209
+ new Exception().printStackTrace();
42114210 System.exit(0);
42124211 com.sun.opengl.util.texture.Texture texture = null;
42134212
....@@ -8023,7 +8022,7 @@
80238022 }
80248023 }
80258024
8026
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8025
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
80278026 {
80288027 if (// DrawMode() != 0 || /*tex == null ||*/
80298028 ambientOcclusion ) // || !textureon)
....@@ -8068,7 +8067,7 @@
80688067 return; // true;
80698068 }
80708069
8071
- CacheTexture GetCacheTexture(String tex, boolean bump, int resolution)
8070
+ CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception
80728071 {
80738072 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
80748073
....@@ -8076,12 +8075,16 @@
80768075 {
80778076 String texname = tex;
80788077
8079
- String[] split = tex.split("Textures");
8080
- if (split.length > 1)
8081
- texname = "/Users/nbriere/Textures" + split[split.length-1];
8082
- else
8083
- if (!texname.startsWith("/"))
8084
- 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
+ }
80858088
80868089 if (CACHETEXTURE)
80878090 texture = textures.get(texname); // TEXTURE CACHE
....@@ -8181,7 +8184,9 @@
81818184 texturedata = GetFileTexture(cachename, processbump, resolution);
81828185
81838186
8184
- if (texturedata != null)
8187
+ if (texturedata == null)
8188
+ throw new Exception();
8189
+
81858190 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
81868191 //texture = GetTexture(tex, bump);
81878192 }
....@@ -8303,7 +8308,7 @@
83038308 return texture;
83048309 }
83058310
8306
- 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
83078312 {
83088313 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83098314
....@@ -8321,14 +8326,14 @@
83218326 return texture!=null?texture.texture:null;
83228327 }
83238328
8324
- 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
83258330 {
83268331 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83278332
83288333 return texture!=null?texture.texturedata:null;
83298334 }
83308335
8331
- boolean BindTexture(String tex, boolean bump, int resolution)
8336
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
83328337 {
83338338 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
83348339 {
....@@ -9394,7 +9399,7 @@
93949399 //gl.glFlush();
93959400 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93969401
9397
- if (ANIMATION && ABORTED)
9402
+ if (Globals.ANIMATION && ABORTED)
93989403 {
93999404 System.err.println(" ABORTED FRAME");
94009405 break;
....@@ -9424,7 +9429,7 @@
94249429 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94259430
94269431 // save image
9427
- if (ANIMATION && !ABORTED)
9432
+ if (Globals.ANIMATION && !ABORTED)
94289433 {
94299434 VPwidth = viewport[2];
94309435 VPheight = viewport[3];
....@@ -9535,11 +9540,11 @@
95359540
95369541 // imagecount++;
95379542
9538
- 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;
95399544
95409545 if (!BOXMODE)
95419546 {
9542
- 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) + ")");
95439548 }
95449549
95459550 if (!BOXMODE)
....@@ -9577,7 +9582,7 @@
95779582 ABORTED = false;
95789583 }
95799584 else
9580
- GrafreeD.wav.cursor += 735 * ACSIZE;
9585
+ Grafreed.wav.cursor += 735 * ACSIZE;
95819586
95829587 if (false)
95839588 {
....@@ -10240,11 +10245,11 @@
1024010245
1024110246 public void display(GLAutoDrawable drawable)
1024210247 {
10243
- if (GrafreeD.savesound && GrafreeD.hassound)
10248
+ if (Grafreed.savesound && Grafreed.hassound)
1024410249 {
10245
- GrafreeD.wav.save();
10246
- GrafreeD.savesound = false;
10247
- GrafreeD.hassound = false;
10250
+ Grafreed.wav.save();
10251
+ Grafreed.savesound = false;
10252
+ Grafreed.hassound = false;
1024810253 }
1024910254 // if (DEBUG_SELECTION)
1025010255 // {
....@@ -10374,7 +10379,7 @@
1037410379 Object3D theobject = object;
1037510380 Object3D theparent = object.parent;
1037610381 object.parent = null;
10377
- object = (Object3D)GrafreeD.clone(object);
10382
+ object = (Object3D)Grafreed.clone(object);
1037810383 object.Stripify();
1037910384 if (theobject.selection == null || theobject.selection.Size() == 0)
1038010385 theobject.PreprocessOcclusion(this);
....@@ -10795,7 +10800,16 @@
1079510800 // Bump noise
1079610801 gl.glActiveTexture(GL.GL_TEXTURE6);
1079710802 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10798
- 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
+
1079910813
1080010814 gl.glActiveTexture(GL.GL_TEXTURE0);
1080110815 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -11259,8 +11273,14 @@
1125911273 {
1126011274 renderpass++;
1126111275 // System.out.println("Draw object... ");
11276
+ STEP = 1;
1126211277 if (FAST) // in case there is no script
11263
- STEP = 16;
11278
+ STEP = 8;
11279
+
11280
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11281
+ {
11282
+ STEP *= 4;
11283
+ }
1126411284
1126511285 //object.FullInvariants();
1126611286
....@@ -11274,8 +11294,8 @@
1127411294 e.printStackTrace();
1127511295 }
1127611296
11277
- if (GrafreeD.RENDERME > 0)
11278
- GrafreeD.RENDERME--; // mechante magouille
11297
+ if (Grafreed.RENDERME > 0)
11298
+ Grafreed.RENDERME--; // mechante magouille
1127911299
1128011300 Globals.ONESTEP = false;
1128111301 }
....@@ -11345,7 +11365,14 @@
1134511365
1134611366 usedtextures.clear();
1134711367
11348
- 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
+ }
1134911376 }
1135011377 //System.out.println("--> " + stackdepth);
1135111378 // GrafreeD.traceon();
....@@ -11436,7 +11463,14 @@
1143611463 if (checker != null && DrawMode() == DEFAULT)
1143711464 {
1143811465 //BindTexture(IMMORTAL_TEXTURE);
11439
- 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
+ }
1144011474 // NEAREST
1144111475 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1144211476 DrawChecker(gl);
....@@ -12468,8 +12502,8 @@
1246812502
1246912503 // display shadow only (bump == 0)
1247012504 "SUB temp.x, half.x, shadow.x;" +
12471
- "MOV temp.y, -params6.x;" +
12472
- "SLT temp.z, temp.y, zero.x;" +
12505
+ "MOV temp.y, -params5.z;" + // params6.x;" +
12506
+ "SLT temp.z, temp.y, -one2048th.x;" +
1247312507 "SUB temp.y, one.x, temp.z;" +
1247412508 "MUL temp.x, temp.x, temp.y;" +
1247512509 "KIL temp.x;" +
....@@ -12598,8 +12632,10 @@
1259812632 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1259912633
1260012634 "SUB temp.x, one.x, ndotl.x;" +
12601
- "ADD temp.x, temp.x, options2.z;" + // lightsheen
12602
- "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
1260312639 "MUL temp.x, temp.x, temp.y;" +
1260412640
1260512641 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12798,7 +12834,7 @@
1279812834 //once = true;
1279912835 }
1280012836
12801
- System.out.print("Program #" + mode + "; length = " + program.length());
12837
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1280212838 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1280312839 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1280412840
....@@ -12931,12 +12967,16 @@
1293112967
1293212968 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1293312969 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
12970
+
12971
+ // Compare fragment depth in light space with shadowmap.
1293412972 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1293512973 "SGE temp.y, temp.x, zero.x;" +
12936
- "SUB " + shadow + ".y, one.x, temp.y;" +
12974
+ "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded
12975
+
12976
+ // Reverse comparison
1293712977 "SUB temp.x, one.x, temp.x;" +
1293812978 "MUL " + shadow + ".x, temp.x, temp.y;" +
12939
- "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded
12979
+ "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse
1294012980 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1294112981
1294212982 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12950,6 +12990,10 @@
1295012990 // No shadow for backface
1295112991 "DP3 temp.x, normal, lightd;" +
1295212992 "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;" +
1295312997 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1295412998 "";
1295512999 }
....@@ -13508,7 +13552,7 @@
1350813552 public void mousePressed(MouseEvent e)
1350913553 {
1351013554 //System.out.println("mousePressed: " + e);
13511
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13555
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1351213556 }
1351313557
1351413558 static long prevtime = 0;
....@@ -13584,8 +13628,8 @@
1358413628 // mode |= META;
1358513629 //}
1358613630
13587
- SetMouseMode(WHEEL | e.getModifiersEx());
13588
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13631
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13632
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1358913633 anchorX = ax;
1359013634 anchorY = ay;
1359113635 prevX = px;
....@@ -13645,6 +13689,10 @@
1364513689 // wasliveok = true;
1364613690 // waslive = false;
1364713691
13692
+ // May 2019 Forget it:
13693
+ if (true)
13694
+ return;
13695
+
1364813696 // source == timer
1364913697 if (mouseDown)
1365013698 {
....@@ -13683,7 +13731,7 @@
1368313731
1368413732 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1368513733
13686
- void clickStart(int x, int y, int modifiers)
13734
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1368713735 {
1368813736 if (!wasliveok)
1368913737 return;
....@@ -13700,7 +13748,7 @@
1370013748 // touched = true; // main DL
1370113749 if (isRenderer)
1370213750 {
13703
- SetMouseMode(modifiers);
13751
+ SetMouseMode(modifiers, modifiersex);
1370413752 }
1370513753
1370613754 selectX = anchorX = x;
....@@ -13713,7 +13761,7 @@
1371313761 clicked = true;
1371413762 hold = false;
1371513763
13716
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13764
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1371713765 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1371813766 {
1371913767 // System.out.println("RESTART II " + modifiers);
....@@ -13744,7 +13792,7 @@
1374413792 info.camera = renderCamera;
1374513793 info.x = x;
1374613794 info.y = y;
13747
- info.modifiers = modifiers;
13795
+ info.modifiers = modifiersex;
1374813796 editObj = object.doEditClick(info, 0);
1374913797 if (!editObj)
1375013798 {
....@@ -13773,7 +13821,7 @@
1377313821 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1377413822 }
1377513823 else
13776
- drag(e.getX(), e.getY(), e.getModifiersEx());
13824
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1377713825
1377813826 //try { Thread.sleep(1); } catch (Exception ex) {}
1377913827 }
....@@ -13946,6 +13994,7 @@
1394613994
1394713995 public void run()
1394813996 {
13997
+ new Exception().printStackTrace();
1394913998 System.exit(0);
1395013999 for (;;)
1395114000 {
....@@ -14009,7 +14058,7 @@
1400914058 {
1401014059 Globals.lighttouched = true;
1401114060 }
14012
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14061
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1401314062 }
1401414063 //else
1401514064 }
....@@ -14109,7 +14158,7 @@
1410914158 int X, Y;
1411014159 boolean SX, SY;
1411114160
14112
- void drag(int x, int y, int modifiers)
14161
+ void drag(int x, int y, int modifiers, int modifiersex)
1411314162 {
1411414163 if (IsFrozen())
1411514164 {
....@@ -14118,17 +14167,17 @@
1411814167
1411914168 drag = true; // NEW
1412014169
14121
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14170
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1412214171
1412314172 X = x;
1412414173 Y = y;
1412514174 // floating state for animation
14126
- MODIFIERS = modifiers;
14127
- modifiers &= ~1024;
14175
+ MODIFIERS = modifiersex;
14176
+ modifiersex &= ~1024;
1412814177 if (false) // modifiers != 0)
1412914178 {
1413014179 //new Exception().printStackTrace();
14131
- System.out.println("mouseDragged: " + modifiers);
14180
+ System.out.println("mouseDragged: " + modifiersex);
1413214181 System.out.println("SHIFT = " + SHIFT);
1413314182 System.out.println("CONTROL = " + COMMAND);
1413414183 System.out.println("META = " + META);
....@@ -14148,7 +14197,7 @@
1414814197 info.camera = renderCamera;
1414914198 info.x = x;
1415014199 info.y = y;
14151
- object.editWindow.copy.doEditDrag(info);
14200
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1415214201 } else
1415314202 {
1415414203 if (x < startX)
....@@ -14347,9 +14396,9 @@
1434714396 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1434814397 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1434914398
14350
- if (control || command || IsFrozen())
14399
+// No delay if (control || command || IsFrozen())
1435114400 timeout = true;
14352
- else
14401
+// ?? May 2019 else
1435314402 // timer.setDelay((modifiers & 128) != 0?0:350);
1435414403 mouseDown = false;
1435514404 if (!control && !command) // june 2013
....@@ -14459,7 +14508,7 @@
1445914508 System.out.println("keyReleased: " + e);
1446014509 }
1446114510
14462
- void SetMouseMode(int modifiers)
14511
+ void SetMouseMode(int modifiers, int modifiersex)
1446314512 {
1446414513 //System.out.println("SetMouseMode = " + modifiers);
1446514514 //modifiers &= ~1024;
....@@ -14471,25 +14520,25 @@
1447114520 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1447214521 // return;
1447314522 //System.out.println("SetMode = " + modifiers);
14474
- if ((modifiers & WHEEL) == WHEEL)
14523
+ if ((modifiersex & WHEEL) == WHEEL)
1447514524 {
1447614525 mouseMode |= ZOOM;
1447714526 }
1447814527
1447914528 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14480
- if (capsLocked || (modifiers & META) == META)
14529
+ if (capsLocked) // || (modifiers & META) == META)
1448114530 {
1448214531 mouseMode |= VR; // BACKFORTH;
1448314532 }
14484
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14533
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1448514534 {
1448614535 mouseMode |= SELECT;
1448714536 }
14488
- if ((modifiers & COMMAND) == COMMAND)
14537
+ if ((modifiersex & COMMAND) == COMMAND)
1448914538 {
1449014539 mouseMode |= SELECT;
1449114540 }
14492
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14541
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1449314542 {
1449414543 mouseMode &= ~VR;
1449514544 mouseMode |= TRANSLATE;
....@@ -14518,7 +14567,7 @@
1451814567
1451914568 if (isRenderer) //
1452014569 {
14521
- SetMouseMode(modifiers);
14570
+ SetMouseMode(0, modifiers);
1452214571 }
1452314572
1452414573 Globals.theRenderer.keyPressed(key);
....@@ -14854,7 +14903,7 @@
1485414903 //RESIZETEXTURE ^= true;
1485514904 //break;
1485614905 case 'z':
14857
- RENDERSHADOW ^= true;
14906
+ Globals.RENDERSHADOW ^= true;
1485814907 Globals.lighttouched = true;
1485914908 repaint();
1486014909 break;
....@@ -14978,7 +15027,7 @@
1497815027 //mode = ROTATE;
1497915028 if ((MODIFIERS & COMMAND) == 0) // VR??
1498015029 {
14981
- SetMouseMode(modifiers);
15030
+ SetMouseMode(0, modifiers);
1498215031 }
1498315032 }
1498415033
....@@ -15114,7 +15163,7 @@
1511415163 {
1511515164 //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
1511615165 //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15117
- if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
15166
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1511815167 {
1511915168 mouseMoved(e);
1512015169 } else
....@@ -15144,6 +15193,7 @@
1514415193
1514515194 void SelectParent()
1514615195 {
15196
+ new Exception().printStackTrace();
1514715197 System.exit(0);
1514815198 Composite group = (Composite) object;
1514915199 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -15167,6 +15217,7 @@
1516715217
1516815218 void SelectChildren()
1516915219 {
15220
+ new Exception().printStackTrace();
1517015221 System.exit(0);
1517115222 /*
1517215223 Composite group = (Composite) object;
....@@ -15549,6 +15600,7 @@
1554915600 public boolean mouseDown(Event evt, int x, int y)
1555015601 {
1555115602 System.out.println("mouseDown: " + evt);
15603
+ System.exit(0);
1555215604 /*
1555315605 locked = true;
1555415606 drag = false;
....@@ -15592,7 +15644,7 @@
1559215644 {
1559315645 keyPressed(0, modifiers);
1559415646 }
15595
- clickStart(x, y, modifiers);
15647
+ // clickStart(x, y, modifiers);
1559615648 return true;
1559715649 }
1559815650
....@@ -15710,7 +15762,7 @@
1571015762 {
1571115763 keyReleased(0, 0);
1571215764 }
15713
- drag(x, y, modifiers);
15765
+ drag(x, y, 0, modifiers);
1571415766 return true;
1571515767 }
1571615768
....@@ -16280,6 +16332,7 @@
1628016332 {
1628116333 if (!selection)
1628216334 {
16335
+ new Exception().printStackTrace();
1628316336 System.exit(0);
1628416337 return;
1628516338 }
....@@ -16407,16 +16460,16 @@
1640716460 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]));
1640816461 }
1640916462
16410
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16463
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1641116464 }
1641216465 }
1641316466
1641416467 if (!movingcamera && !PAINTMODE)
1641516468 object.editWindow.ScreenFitPoint(); // fev 2014
1641616469
16417
- 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)
1641816471 {
16419
- 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);
1642016473
1642116474 Object3D group = new Object3D("inst" + paintcount++);
1642216475
....@@ -16572,7 +16625,7 @@
1657216625 gl.glDisable(gl.GL_CULL_FACE);
1657316626 }
1657416627
16575
- if (!RENDERSHADOW)
16628
+ if (!Globals.RENDERSHADOW)
1657616629 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1657716630
1657816631 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16582,7 +16635,7 @@
1658216635 //gl.glColorMask(false, false, false, false);
1658316636
1658416637 //render_scene_from_light_view(gl, drawable, 0, 0);
16585
- if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16638
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1658616639 {
1658716640 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1658816641