Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
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,12 +1617,12 @@
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
....@@ -2170,6 +2175,11 @@
21702175 BOXMODE ^= true;
21712176 }
21722177
2178
+ public void ToggleZoomBoxMode()
2179
+ {
2180
+ ZOOMBOXMODE ^= true;
2181
+ }
2182
+
21732183 public void ToggleSmoothFocus()
21742184 {
21752185 SMOOTHFOCUS ^= true;
....@@ -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
....@@ -9382,7 +9393,7 @@
93829393 //gl.glFlush();
93839394 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93849395
9385
- if (ANIMATION && ABORTED)
9396
+ if (Globals.ANIMATION && ABORTED)
93869397 {
93879398 System.err.println(" ABORTED FRAME");
93889399 break;
....@@ -9412,7 +9423,7 @@
94129423 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94139424
94149425 // save image
9415
- if (ANIMATION && !ABORTED)
9426
+ if (Globals.ANIMATION && !ABORTED)
94169427 {
94179428 VPwidth = viewport[2];
94189429 VPheight = viewport[3];
....@@ -9523,7 +9534,7 @@
95239534
95249535 // imagecount++;
95259536
9526
- String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
9537
+ String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
95279538
95289539 if (!BOXMODE)
95299540 {
....@@ -11247,8 +11258,14 @@
1124711258 {
1124811259 renderpass++;
1124911260 // System.out.println("Draw object... ");
11261
+ STEP = 1;
1125011262 if (FAST) // in case there is no script
11251
- STEP = 16;
11263
+ STEP = 8;
11264
+
11265
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11266
+ {
11267
+ STEP *= 4;
11268
+ }
1125211269
1125311270 //object.FullInvariants();
1125411271
....@@ -12586,8 +12603,10 @@
1258612603 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1258712604
1258812605 "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
12606
+ // Tuning for default skin
12607
+ //"ADD temp.x, temp.x, options2.z;" + // lightsheen
12608
+ "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen
12609
+ "ADD temp.y, one.y, options2.y;" + // subsurface
1259112610 "MUL temp.x, temp.x, temp.y;" +
1259212611
1259312612 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12735,7 +12754,7 @@
1273512754 "MUL final.y, fragment.texcoord[0].x, c256;" +
1273612755 "FLR final.x, final.y;" +
1273712756 "SUB final.y, final.y, final.x;" +
12738
- "MUL final.x, final.x, c256i;" +
12757
+ //"MUL final.x, final.x, c256i;" +
1273912758 "MOV final.z, zero.x;" +
1274012759 "MOV final.a, one.w;":""
1274112760 ) +
....@@ -12743,7 +12762,7 @@
1274312762 "MUL final.y, fragment.texcoord[0].y, c256;" +
1274412763 "FLR final.x, final.y;" +
1274512764 "SUB final.y, final.y, final.x;" +
12746
- "MUL final.x, final.x, c256i;" +
12765
+ //"MUL final.x, final.x, c256i;" +
1274712766 "MOV final.z, zero.x;" +
1274812767 "MOV final.a, one.w;":""
1274912768 ) +
....@@ -13523,6 +13542,7 @@
1352313542
1352413543 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1352513544
13545
+ if (BUTTONLESSWHEEL)
1352613546 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1352713547 {
1352813548 return;
....@@ -13531,7 +13551,7 @@
1353113551 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1353213552
1353313553 // TIMER
13534
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13554
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1353513555 {
1353613556 keepboxmode = BOXMODE;
1353713557 keepsupport = SUPPORT;
....@@ -13748,11 +13768,11 @@
1374813768
1374913769 public void mouseDragged(MouseEvent e)
1375013770 {
13771
+ //System.out.println("mouseDragged: " + e);
1375113772 if (isRenderer)
1375213773 movingcamera = true;
1375313774 //if (drawing)
1375413775 //return;
13755
- //System.out.println("mouseDragged: " + e);
1375613776 if ((e.getModifiersEx() & CTRL) != 0
1375713777 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1375813778 {
....@@ -13933,6 +13953,7 @@
1393313953
1393413954 public void run()
1393513955 {
13956
+ new Exception().printStackTrace();
1393613957 System.exit(0);
1393713958 for (;;)
1393813959 {
....@@ -14287,7 +14308,6 @@
1428714308 public void mouseMoved(MouseEvent e)
1428814309 {
1428914310 //System.out.println("mouseMoved: " + e);
14290
-
1429114311 if (isRenderer)
1429214312 return;
1429314313
....@@ -15100,8 +15120,9 @@
1510015120
1510115121 protected void processMouseMotionEvent(MouseEvent e)
1510215122 {
15103
- //System.out.println("processMouseMotionEvent: " + mouseMode);
15104
- if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15123
+ //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
15124
+ //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15125
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
1510515126 {
1510615127 mouseMoved(e);
1510715128 } else
....@@ -15131,6 +15152,7 @@
1513115152
1513215153 void SelectParent()
1513315154 {
15155
+ new Exception().printStackTrace();
1513415156 System.exit(0);
1513515157 Composite group = (Composite) object;
1513615158 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -15154,6 +15176,7 @@
1515415176
1515515177 void SelectChildren()
1515615178 {
15179
+ new Exception().printStackTrace();
1515715180 System.exit(0);
1515815181 /*
1515915182 Composite group = (Composite) object;
....@@ -16267,6 +16290,7 @@
1626716290 {
1626816291 if (!selection)
1626916292 {
16293
+ new Exception().printStackTrace();
1627016294 System.exit(0);
1627116295 return;
1627216296 }