.. | .. |
---|
56 | 56 | static int CURRENTANTIALIAS = 0; // 1; |
---|
57 | 57 | /*static*/ boolean RENDERSHADOW = true; |
---|
58 | 58 | /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal |
---|
59 | | - static boolean ANIMATION = false; |
---|
60 | | - static String filename; |
---|
61 | 59 | |
---|
62 | 60 | boolean DISPLAYTEXT = false; |
---|
63 | 61 | //boolean REDUCETEXTURE = true; |
---|
.. | .. |
---|
86 | 84 | static boolean FULLSCREEN = false; |
---|
87 | 85 | static boolean SUPPORT = true; |
---|
88 | 86 | static boolean INERTIA = true; |
---|
89 | | -static boolean FAST = true; // false; |
---|
| 87 | +static boolean FAST = false; |
---|
90 | 88 | static boolean SLOWPOSE = false; |
---|
91 | 89 | static boolean FOOTCONTACT = true; |
---|
92 | 90 | |
---|
.. | .. |
---|
108 | 106 | static boolean OEIL = true; |
---|
109 | 107 | static boolean OEILONCE = false; // do oeilon then oeiloff |
---|
110 | 108 | static boolean LOOKAT = true; |
---|
111 | | -static boolean RANDOM = true; // false; |
---|
| 109 | +static boolean SWITCH = true; // false; |
---|
112 | 110 | static boolean HANDLES = false; // selection doesn't work!! |
---|
113 | 111 | static boolean PAINTMODE = false; |
---|
114 | 112 | |
---|
.. | .. |
---|
2269 | 2267 | |
---|
2270 | 2268 | void ToggleRandom() |
---|
2271 | 2269 | { |
---|
2272 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2273 | 2271 | } |
---|
2274 | 2272 | |
---|
2275 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
4208 | 4206 | |
---|
4209 | 4207 | com.sun.opengl.util.texture.Texture CompressTexture2(String name) |
---|
4210 | 4208 | { |
---|
| 4209 | + new Exception().printStackTrace(); |
---|
4211 | 4210 | System.exit(0); |
---|
4212 | 4211 | com.sun.opengl.util.texture.Texture texture = null; |
---|
4213 | 4212 | |
---|
.. | .. |
---|
8076 | 8075 | { |
---|
8077 | 8076 | String texname = tex; |
---|
8078 | 8077 | |
---|
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 | + } |
---|
8085 | 8088 | |
---|
8086 | 8089 | if (CACHETEXTURE) |
---|
8087 | 8090 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
9394 | 9397 | //gl.glFlush(); |
---|
9395 | 9398 | gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE); |
---|
9396 | 9399 | |
---|
9397 | | - if (ANIMATION && ABORTED) |
---|
| 9400 | + if (Globals.ANIMATION && ABORTED) |
---|
9398 | 9401 | { |
---|
9399 | 9402 | System.err.println(" ABORTED FRAME"); |
---|
9400 | 9403 | break; |
---|
.. | .. |
---|
9424 | 9427 | setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
---|
9425 | 9428 | |
---|
9426 | 9429 | // save image |
---|
9427 | | - if (ANIMATION && !ABORTED) |
---|
| 9430 | + if (Globals.ANIMATION && !ABORTED) |
---|
9428 | 9431 | { |
---|
9429 | 9432 | VPwidth = viewport[2]; |
---|
9430 | 9433 | VPheight = viewport[3]; |
---|
.. | .. |
---|
9535 | 9538 | |
---|
9536 | 9539 | // imagecount++; |
---|
9537 | 9540 | |
---|
9538 | | - String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
| 9541 | + String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
9539 | 9542 | |
---|
9540 | 9543 | if (!BOXMODE) |
---|
9541 | 9544 | { |
---|
.. | .. |
---|
11259 | 11262 | { |
---|
11260 | 11263 | renderpass++; |
---|
11261 | 11264 | // System.out.println("Draw object... "); |
---|
| 11265 | + STEP = 1; |
---|
11262 | 11266 | if (FAST) // in case there is no script |
---|
11263 | | - STEP = 16; |
---|
| 11267 | + STEP = 8; |
---|
| 11268 | + |
---|
| 11269 | + if (CURRENTANTIALIAS == 0 || ACSIZE == 1) |
---|
| 11270 | + { |
---|
| 11271 | + STEP *= 4; |
---|
| 11272 | + } |
---|
11264 | 11273 | |
---|
11265 | 11274 | //object.FullInvariants(); |
---|
11266 | 11275 | |
---|
.. | .. |
---|
12598 | 12607 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12599 | 12608 | |
---|
12600 | 12609 | "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 |
---|
| 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 |
---|
12603 | 12614 | "MUL temp.x, temp.x, temp.y;" + |
---|
12604 | 12615 | |
---|
12605 | 12616 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
13508 | 13519 | public void mousePressed(MouseEvent e) |
---|
13509 | 13520 | { |
---|
13510 | 13521 | //System.out.println("mousePressed: " + e); |
---|
13511 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13522 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13512 | 13523 | } |
---|
13513 | 13524 | |
---|
13514 | 13525 | static long prevtime = 0; |
---|
.. | .. |
---|
13584 | 13595 | // mode |= META; |
---|
13585 | 13596 | //} |
---|
13586 | 13597 | |
---|
13587 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13588 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13598 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13599 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13589 | 13600 | anchorX = ax; |
---|
13590 | 13601 | anchorY = ay; |
---|
13591 | 13602 | prevX = px; |
---|
.. | .. |
---|
13683 | 13694 | |
---|
13684 | 13695 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13685 | 13696 | |
---|
13686 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13697 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13687 | 13698 | { |
---|
13688 | 13699 | if (!wasliveok) |
---|
13689 | 13700 | return; |
---|
.. | .. |
---|
13700 | 13711 | // touched = true; // main DL |
---|
13701 | 13712 | if (isRenderer) |
---|
13702 | 13713 | { |
---|
13703 | | - SetMouseMode(modifiers); |
---|
| 13714 | + SetMouseMode(modifiers, modifiersex); |
---|
13704 | 13715 | } |
---|
13705 | 13716 | |
---|
13706 | 13717 | selectX = anchorX = x; |
---|
.. | .. |
---|
13713 | 13724 | clicked = true; |
---|
13714 | 13725 | hold = false; |
---|
13715 | 13726 | |
---|
13716 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13727 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13717 | 13728 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13718 | 13729 | { |
---|
13719 | 13730 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13744 | 13755 | info.camera = renderCamera; |
---|
13745 | 13756 | info.x = x; |
---|
13746 | 13757 | info.y = y; |
---|
13747 | | - info.modifiers = modifiers; |
---|
| 13758 | + info.modifiers = modifiersex; |
---|
13748 | 13759 | editObj = object.doEditClick(info, 0); |
---|
13749 | 13760 | if (!editObj) |
---|
13750 | 13761 | { |
---|
.. | .. |
---|
13773 | 13784 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13774 | 13785 | } |
---|
13775 | 13786 | else |
---|
13776 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13787 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13777 | 13788 | |
---|
13778 | 13789 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13779 | 13790 | } |
---|
.. | .. |
---|
13946 | 13957 | |
---|
13947 | 13958 | public void run() |
---|
13948 | 13959 | { |
---|
| 13960 | + new Exception().printStackTrace(); |
---|
13949 | 13961 | System.exit(0); |
---|
13950 | 13962 | for (;;) |
---|
13951 | 13963 | { |
---|
.. | .. |
---|
14009 | 14021 | { |
---|
14010 | 14022 | Globals.lighttouched = true; |
---|
14011 | 14023 | } |
---|
14012 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14024 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14013 | 14025 | } |
---|
14014 | 14026 | //else |
---|
14015 | 14027 | } |
---|
.. | .. |
---|
14109 | 14121 | int X, Y; |
---|
14110 | 14122 | boolean SX, SY; |
---|
14111 | 14123 | |
---|
14112 | | - void drag(int x, int y, int modifiers) |
---|
| 14124 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14113 | 14125 | { |
---|
14114 | 14126 | if (IsFrozen()) |
---|
14115 | 14127 | { |
---|
.. | .. |
---|
14118 | 14130 | |
---|
14119 | 14131 | drag = true; // NEW |
---|
14120 | 14132 | |
---|
14121 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14133 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14122 | 14134 | |
---|
14123 | 14135 | X = x; |
---|
14124 | 14136 | Y = y; |
---|
14125 | 14137 | // floating state for animation |
---|
14126 | | - MODIFIERS = modifiers; |
---|
14127 | | - modifiers &= ~1024; |
---|
| 14138 | + MODIFIERS = modifiersex; |
---|
| 14139 | + modifiersex &= ~1024; |
---|
14128 | 14140 | if (false) // modifiers != 0) |
---|
14129 | 14141 | { |
---|
14130 | 14142 | //new Exception().printStackTrace(); |
---|
14131 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14143 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14132 | 14144 | System.out.println("SHIFT = " + SHIFT); |
---|
14133 | 14145 | System.out.println("CONTROL = " + COMMAND); |
---|
14134 | 14146 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14148 | 14160 | info.camera = renderCamera; |
---|
14149 | 14161 | info.x = x; |
---|
14150 | 14162 | info.y = y; |
---|
14151 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14163 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14152 | 14164 | } else |
---|
14153 | 14165 | { |
---|
14154 | 14166 | if (x < startX) |
---|
.. | .. |
---|
14349 | 14361 | |
---|
14350 | 14362 | if (control || command || IsFrozen()) |
---|
14351 | 14363 | timeout = true; |
---|
14352 | | - else |
---|
| 14364 | +// ?? May 2019 else |
---|
14353 | 14365 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14354 | 14366 | mouseDown = false; |
---|
14355 | 14367 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14459 | 14471 | System.out.println("keyReleased: " + e); |
---|
14460 | 14472 | } |
---|
14461 | 14473 | |
---|
14462 | | - void SetMouseMode(int modifiers) |
---|
| 14474 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14463 | 14475 | { |
---|
14464 | 14476 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14465 | 14477 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14471 | 14483 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14472 | 14484 | // return; |
---|
14473 | 14485 | //System.out.println("SetMode = " + modifiers); |
---|
14474 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14486 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14475 | 14487 | { |
---|
14476 | 14488 | mouseMode |= ZOOM; |
---|
14477 | 14489 | } |
---|
14478 | 14490 | |
---|
14479 | 14491 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14480 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14492 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14481 | 14493 | { |
---|
14482 | 14494 | mouseMode |= VR; // BACKFORTH; |
---|
14483 | 14495 | } |
---|
14484 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14496 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14485 | 14497 | { |
---|
14486 | 14498 | mouseMode |= SELECT; |
---|
14487 | 14499 | } |
---|
14488 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14500 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14489 | 14501 | { |
---|
14490 | 14502 | mouseMode |= SELECT; |
---|
14491 | 14503 | } |
---|
14492 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14504 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14493 | 14505 | { |
---|
14494 | 14506 | mouseMode &= ~VR; |
---|
14495 | 14507 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14518 | 14530 | |
---|
14519 | 14531 | if (isRenderer) // |
---|
14520 | 14532 | { |
---|
14521 | | - SetMouseMode(modifiers); |
---|
| 14533 | + SetMouseMode(0, modifiers); |
---|
14522 | 14534 | } |
---|
14523 | 14535 | |
---|
14524 | 14536 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14978 | 14990 | //mode = ROTATE; |
---|
14979 | 14991 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14980 | 14992 | { |
---|
14981 | | - SetMouseMode(modifiers); |
---|
| 14993 | + SetMouseMode(0, modifiers); |
---|
14982 | 14994 | } |
---|
14983 | 14995 | } |
---|
14984 | 14996 | |
---|
.. | .. |
---|
15114 | 15126 | { |
---|
15115 | 15127 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15116 | 15128 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15117 | | - 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) |
---|
15118 | 15130 | { |
---|
15119 | 15131 | mouseMoved(e); |
---|
15120 | 15132 | } else |
---|
.. | .. |
---|
15144 | 15156 | |
---|
15145 | 15157 | void SelectParent() |
---|
15146 | 15158 | { |
---|
| 15159 | + new Exception().printStackTrace(); |
---|
15147 | 15160 | System.exit(0); |
---|
15148 | 15161 | Composite group = (Composite) object; |
---|
15149 | 15162 | java.util.Vector selectees = new java.util.Vector(group.selection); |
---|
.. | .. |
---|
15167 | 15180 | |
---|
15168 | 15181 | void SelectChildren() |
---|
15169 | 15182 | { |
---|
| 15183 | + new Exception().printStackTrace(); |
---|
15170 | 15184 | System.exit(0); |
---|
15171 | 15185 | /* |
---|
15172 | 15186 | Composite group = (Composite) object; |
---|
.. | .. |
---|
15549 | 15563 | public boolean mouseDown(Event evt, int x, int y) |
---|
15550 | 15564 | { |
---|
15551 | 15565 | System.out.println("mouseDown: " + evt); |
---|
| 15566 | + System.exit(0); |
---|
15552 | 15567 | /* |
---|
15553 | 15568 | locked = true; |
---|
15554 | 15569 | drag = false; |
---|
.. | .. |
---|
15592 | 15607 | { |
---|
15593 | 15608 | keyPressed(0, modifiers); |
---|
15594 | 15609 | } |
---|
15595 | | - clickStart(x, y, modifiers); |
---|
| 15610 | + // clickStart(x, y, modifiers); |
---|
15596 | 15611 | return true; |
---|
15597 | 15612 | } |
---|
15598 | 15613 | |
---|
.. | .. |
---|
15710 | 15725 | { |
---|
15711 | 15726 | keyReleased(0, 0); |
---|
15712 | 15727 | } |
---|
15713 | | - drag(x, y, modifiers); |
---|
| 15728 | + drag(x, y, 0, modifiers); |
---|
15714 | 15729 | return true; |
---|
15715 | 15730 | } |
---|
15716 | 15731 | |
---|
.. | .. |
---|
16280 | 16295 | { |
---|
16281 | 16296 | if (!selection) |
---|
16282 | 16297 | { |
---|
| 16298 | + new Exception().printStackTrace(); |
---|
16283 | 16299 | System.exit(0); |
---|
16284 | 16300 | return; |
---|
16285 | 16301 | } |
---|