Normand Briere
2019-05-05 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6
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
....@@ -2267,7 +2267,7 @@
22672267
22682268 void ToggleRandom()
22692269 {
2270
- RANDOM ^= true;
2270
+ SWITCH ^= true;
22712271 }
22722272
22732273 void ToggleHandles()
....@@ -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
....@@ -12603,8 +12607,10 @@
1260312607 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1260412608
1260512609 "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
12610
+ // Tuning for default skin
12611
+ //"ADD temp.x, temp.x, options2.z;" + // lightsheen
12612
+ "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen
12613
+ "ADD temp.y, one.y, options2.y;" + // subsurface
1260812614 "MUL temp.x, temp.x, temp.y;" +
1260912615
1261012616 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12752,7 +12758,7 @@
1275212758 "MUL final.y, fragment.texcoord[0].x, c256;" +
1275312759 "FLR final.x, final.y;" +
1275412760 "SUB final.y, final.y, final.x;" +
12755
- //"MUL final.x, final.x, c256i;" +
12761
+ "MUL final.x, final.x, c256i;" +
1275612762 "MOV final.z, zero.x;" +
1275712763 "MOV final.a, one.w;":""
1275812764 ) +
....@@ -12760,7 +12766,7 @@
1276012766 "MUL final.y, fragment.texcoord[0].y, c256;" +
1276112767 "FLR final.x, final.y;" +
1276212768 "SUB final.y, final.y, final.x;" +
12763
- //"MUL final.x, final.x, c256i;" +
12769
+ "MUL final.x, final.x, c256i;" +
1276412770 "MOV final.z, zero.x;" +
1276512771 "MOV final.a, one.w;":""
1276612772 ) +
....@@ -13513,7 +13519,7 @@
1351313519 public void mousePressed(MouseEvent e)
1351413520 {
1351513521 //System.out.println("mousePressed: " + e);
13516
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13522
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1351713523 }
1351813524
1351913525 static long prevtime = 0;
....@@ -13589,8 +13595,8 @@
1358913595 // mode |= META;
1359013596 //}
1359113597
13592
- SetMouseMode(WHEEL | e.getModifiersEx());
13593
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13598
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13599
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1359413600 anchorX = ax;
1359513601 anchorY = ay;
1359613602 prevX = px;
....@@ -13688,7 +13694,7 @@
1368813694
1368913695 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1369013696
13691
- void clickStart(int x, int y, int modifiers)
13697
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1369213698 {
1369313699 if (!wasliveok)
1369413700 return;
....@@ -13705,7 +13711,7 @@
1370513711 // touched = true; // main DL
1370613712 if (isRenderer)
1370713713 {
13708
- SetMouseMode(modifiers);
13714
+ SetMouseMode(modifiers, modifiersex);
1370913715 }
1371013716
1371113717 selectX = anchorX = x;
....@@ -13718,7 +13724,7 @@
1371813724 clicked = true;
1371913725 hold = false;
1372013726
13721
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13727
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1372213728 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1372313729 {
1372413730 // System.out.println("RESTART II " + modifiers);
....@@ -13749,7 +13755,7 @@
1374913755 info.camera = renderCamera;
1375013756 info.x = x;
1375113757 info.y = y;
13752
- info.modifiers = modifiers;
13758
+ info.modifiers = modifiersex;
1375313759 editObj = object.doEditClick(info, 0);
1375413760 if (!editObj)
1375513761 {
....@@ -13778,7 +13784,7 @@
1377813784 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1377913785 }
1378013786 else
13781
- drag(e.getX(), e.getY(), e.getModifiersEx());
13787
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1378213788
1378313789 //try { Thread.sleep(1); } catch (Exception ex) {}
1378413790 }
....@@ -14015,7 +14021,7 @@
1401514021 {
1401614022 Globals.lighttouched = true;
1401714023 }
14018
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14024
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1401914025 }
1402014026 //else
1402114027 }
....@@ -14115,7 +14121,7 @@
1411514121 int X, Y;
1411614122 boolean SX, SY;
1411714123
14118
- void drag(int x, int y, int modifiers)
14124
+ void drag(int x, int y, int modifiers, int modifiersex)
1411914125 {
1412014126 if (IsFrozen())
1412114127 {
....@@ -14124,17 +14130,17 @@
1412414130
1412514131 drag = true; // NEW
1412614132
14127
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14133
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1412814134
1412914135 X = x;
1413014136 Y = y;
1413114137 // floating state for animation
14132
- MODIFIERS = modifiers;
14133
- modifiers &= ~1024;
14138
+ MODIFIERS = modifiersex;
14139
+ modifiersex &= ~1024;
1413414140 if (false) // modifiers != 0)
1413514141 {
1413614142 //new Exception().printStackTrace();
14137
- System.out.println("mouseDragged: " + modifiers);
14143
+ System.out.println("mouseDragged: " + modifiersex);
1413814144 System.out.println("SHIFT = " + SHIFT);
1413914145 System.out.println("CONTROL = " + COMMAND);
1414014146 System.out.println("META = " + META);
....@@ -14154,7 +14160,7 @@
1415414160 info.camera = renderCamera;
1415514161 info.x = x;
1415614162 info.y = y;
14157
- object.editWindow.copy.doEditDrag(info);
14163
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1415814164 } else
1415914165 {
1416014166 if (x < startX)
....@@ -14355,7 +14361,7 @@
1435514361
1435614362 if (control || command || IsFrozen())
1435714363 timeout = true;
14358
- else
14364
+// ?? May 2019 else
1435914365 // timer.setDelay((modifiers & 128) != 0?0:350);
1436014366 mouseDown = false;
1436114367 if (!control && !command) // june 2013
....@@ -14465,7 +14471,7 @@
1446514471 System.out.println("keyReleased: " + e);
1446614472 }
1446714473
14468
- void SetMouseMode(int modifiers)
14474
+ void SetMouseMode(int modifiers, int modifiersex)
1446914475 {
1447014476 //System.out.println("SetMouseMode = " + modifiers);
1447114477 //modifiers &= ~1024;
....@@ -14477,25 +14483,25 @@
1447714483 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1447814484 // return;
1447914485 //System.out.println("SetMode = " + modifiers);
14480
- if ((modifiers & WHEEL) == WHEEL)
14486
+ if ((modifiersex & WHEEL) == WHEEL)
1448114487 {
1448214488 mouseMode |= ZOOM;
1448314489 }
1448414490
1448514491 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14486
- if (capsLocked || (modifiers & META) == META)
14492
+ if (capsLocked) // || (modifiers & META) == META)
1448714493 {
1448814494 mouseMode |= VR; // BACKFORTH;
1448914495 }
14490
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14496
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1449114497 {
1449214498 mouseMode |= SELECT;
1449314499 }
14494
- if ((modifiers & COMMAND) == COMMAND)
14500
+ if ((modifiersex & COMMAND) == COMMAND)
1449514501 {
1449614502 mouseMode |= SELECT;
1449714503 }
14498
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14504
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1449914505 {
1450014506 mouseMode &= ~VR;
1450114507 mouseMode |= TRANSLATE;
....@@ -14524,7 +14530,7 @@
1452414530
1452514531 if (isRenderer) //
1452614532 {
14527
- SetMouseMode(modifiers);
14533
+ SetMouseMode(0, modifiers);
1452814534 }
1452914535
1453014536 Globals.theRenderer.keyPressed(key);
....@@ -14984,7 +14990,7 @@
1498414990 //mode = ROTATE;
1498514991 if ((MODIFIERS & COMMAND) == 0) // VR??
1498614992 {
14987
- SetMouseMode(modifiers);
14993
+ SetMouseMode(0, modifiers);
1498814994 }
1498914995 }
1499014996
....@@ -15120,7 +15126,7 @@
1512015126 {
1512115127 //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
1512215128 //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15123
- if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
15129
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1512415130 {
1512515131 mouseMoved(e);
1512615132 } else
....@@ -15557,6 +15563,7 @@
1555715563 public boolean mouseDown(Event evt, int x, int y)
1555815564 {
1555915565 System.out.println("mouseDown: " + evt);
15566
+ System.exit(0);
1556015567 /*
1556115568 locked = true;
1556215569 drag = false;
....@@ -15600,7 +15607,7 @@
1560015607 {
1560115608 keyPressed(0, modifiers);
1560215609 }
15603
- clickStart(x, y, modifiers);
15610
+ // clickStart(x, y, modifiers);
1560415611 return true;
1560515612 }
1560615613
....@@ -15718,7 +15725,7 @@
1571815725 {
1571915726 keyReleased(0, 0);
1572015727 }
15721
- drag(x, y, modifiers);
15728
+ drag(x, y, 0, modifiers);
1572215729 return true;
1572315730 }
1572415731