.. | .. |
---|
106 | 106 | static boolean OEIL = true; |
---|
107 | 107 | static boolean OEILONCE = false; // do oeilon then oeiloff |
---|
108 | 108 | static boolean LOOKAT = true; |
---|
109 | | -static boolean RANDOM = true; // false; |
---|
| 109 | +static boolean SWITCH = true; // false; |
---|
110 | 110 | static boolean HANDLES = false; // selection doesn't work!! |
---|
111 | 111 | static boolean PAINTMODE = false; |
---|
112 | 112 | |
---|
.. | .. |
---|
2267 | 2267 | |
---|
2268 | 2268 | void ToggleRandom() |
---|
2269 | 2269 | { |
---|
2270 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2271 | 2271 | } |
---|
2272 | 2272 | |
---|
2273 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
8075 | 8075 | { |
---|
8076 | 8076 | String texname = tex; |
---|
8077 | 8077 | |
---|
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 | + } |
---|
8084 | 8088 | |
---|
8085 | 8089 | if (CACHETEXTURE) |
---|
8086 | 8090 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
12603 | 12607 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12604 | 12608 | |
---|
12605 | 12609 | "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 |
---|
12608 | 12614 | "MUL temp.x, temp.x, temp.y;" + |
---|
12609 | 12615 | |
---|
12610 | 12616 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
12752 | 12758 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12753 | 12759 | "FLR final.x, final.y;" + |
---|
12754 | 12760 | "SUB final.y, final.y, final.x;" + |
---|
12755 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12761 | + "MUL final.x, final.x, c256i;" + |
---|
12756 | 12762 | "MOV final.z, zero.x;" + |
---|
12757 | 12763 | "MOV final.a, one.w;":"" |
---|
12758 | 12764 | ) + |
---|
.. | .. |
---|
12760 | 12766 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12761 | 12767 | "FLR final.x, final.y;" + |
---|
12762 | 12768 | "SUB final.y, final.y, final.x;" + |
---|
12763 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12769 | + "MUL final.x, final.x, c256i;" + |
---|
12764 | 12770 | "MOV final.z, zero.x;" + |
---|
12765 | 12771 | "MOV final.a, one.w;":"" |
---|
12766 | 12772 | ) + |
---|
.. | .. |
---|
13513 | 13519 | public void mousePressed(MouseEvent e) |
---|
13514 | 13520 | { |
---|
13515 | 13521 | //System.out.println("mousePressed: " + e); |
---|
13516 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13522 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13517 | 13523 | } |
---|
13518 | 13524 | |
---|
13519 | 13525 | static long prevtime = 0; |
---|
.. | .. |
---|
13589 | 13595 | // mode |= META; |
---|
13590 | 13596 | //} |
---|
13591 | 13597 | |
---|
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); |
---|
13594 | 13600 | anchorX = ax; |
---|
13595 | 13601 | anchorY = ay; |
---|
13596 | 13602 | prevX = px; |
---|
.. | .. |
---|
13688 | 13694 | |
---|
13689 | 13695 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13690 | 13696 | |
---|
13691 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13697 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13692 | 13698 | { |
---|
13693 | 13699 | if (!wasliveok) |
---|
13694 | 13700 | return; |
---|
.. | .. |
---|
13705 | 13711 | // touched = true; // main DL |
---|
13706 | 13712 | if (isRenderer) |
---|
13707 | 13713 | { |
---|
13708 | | - SetMouseMode(modifiers); |
---|
| 13714 | + SetMouseMode(modifiers, modifiersex); |
---|
13709 | 13715 | } |
---|
13710 | 13716 | |
---|
13711 | 13717 | selectX = anchorX = x; |
---|
.. | .. |
---|
13718 | 13724 | clicked = true; |
---|
13719 | 13725 | hold = false; |
---|
13720 | 13726 | |
---|
13721 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13727 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13722 | 13728 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13723 | 13729 | { |
---|
13724 | 13730 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13749 | 13755 | info.camera = renderCamera; |
---|
13750 | 13756 | info.x = x; |
---|
13751 | 13757 | info.y = y; |
---|
13752 | | - info.modifiers = modifiers; |
---|
| 13758 | + info.modifiers = modifiersex; |
---|
13753 | 13759 | editObj = object.doEditClick(info, 0); |
---|
13754 | 13760 | if (!editObj) |
---|
13755 | 13761 | { |
---|
.. | .. |
---|
13778 | 13784 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13779 | 13785 | } |
---|
13780 | 13786 | else |
---|
13781 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13787 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13782 | 13788 | |
---|
13783 | 13789 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13784 | 13790 | } |
---|
.. | .. |
---|
14015 | 14021 | { |
---|
14016 | 14022 | Globals.lighttouched = true; |
---|
14017 | 14023 | } |
---|
14018 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14024 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14019 | 14025 | } |
---|
14020 | 14026 | //else |
---|
14021 | 14027 | } |
---|
.. | .. |
---|
14115 | 14121 | int X, Y; |
---|
14116 | 14122 | boolean SX, SY; |
---|
14117 | 14123 | |
---|
14118 | | - void drag(int x, int y, int modifiers) |
---|
| 14124 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14119 | 14125 | { |
---|
14120 | 14126 | if (IsFrozen()) |
---|
14121 | 14127 | { |
---|
.. | .. |
---|
14124 | 14130 | |
---|
14125 | 14131 | drag = true; // NEW |
---|
14126 | 14132 | |
---|
14127 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14133 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14128 | 14134 | |
---|
14129 | 14135 | X = x; |
---|
14130 | 14136 | Y = y; |
---|
14131 | 14137 | // floating state for animation |
---|
14132 | | - MODIFIERS = modifiers; |
---|
14133 | | - modifiers &= ~1024; |
---|
| 14138 | + MODIFIERS = modifiersex; |
---|
| 14139 | + modifiersex &= ~1024; |
---|
14134 | 14140 | if (false) // modifiers != 0) |
---|
14135 | 14141 | { |
---|
14136 | 14142 | //new Exception().printStackTrace(); |
---|
14137 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14143 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14138 | 14144 | System.out.println("SHIFT = " + SHIFT); |
---|
14139 | 14145 | System.out.println("CONTROL = " + COMMAND); |
---|
14140 | 14146 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14154 | 14160 | info.camera = renderCamera; |
---|
14155 | 14161 | info.x = x; |
---|
14156 | 14162 | info.y = y; |
---|
14157 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14163 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14158 | 14164 | } else |
---|
14159 | 14165 | { |
---|
14160 | 14166 | if (x < startX) |
---|
.. | .. |
---|
14355 | 14361 | |
---|
14356 | 14362 | if (control || command || IsFrozen()) |
---|
14357 | 14363 | timeout = true; |
---|
14358 | | - else |
---|
| 14364 | +// ?? May 2019 else |
---|
14359 | 14365 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14360 | 14366 | mouseDown = false; |
---|
14361 | 14367 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14465 | 14471 | System.out.println("keyReleased: " + e); |
---|
14466 | 14472 | } |
---|
14467 | 14473 | |
---|
14468 | | - void SetMouseMode(int modifiers) |
---|
| 14474 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14469 | 14475 | { |
---|
14470 | 14476 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14471 | 14477 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14477 | 14483 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14478 | 14484 | // return; |
---|
14479 | 14485 | //System.out.println("SetMode = " + modifiers); |
---|
14480 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14486 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14481 | 14487 | { |
---|
14482 | 14488 | mouseMode |= ZOOM; |
---|
14483 | 14489 | } |
---|
14484 | 14490 | |
---|
14485 | 14491 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14486 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14492 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14487 | 14493 | { |
---|
14488 | 14494 | mouseMode |= VR; // BACKFORTH; |
---|
14489 | 14495 | } |
---|
14490 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14496 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14491 | 14497 | { |
---|
14492 | 14498 | mouseMode |= SELECT; |
---|
14493 | 14499 | } |
---|
14494 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14500 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14495 | 14501 | { |
---|
14496 | 14502 | mouseMode |= SELECT; |
---|
14497 | 14503 | } |
---|
14498 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14504 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14499 | 14505 | { |
---|
14500 | 14506 | mouseMode &= ~VR; |
---|
14501 | 14507 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14524 | 14530 | |
---|
14525 | 14531 | if (isRenderer) // |
---|
14526 | 14532 | { |
---|
14527 | | - SetMouseMode(modifiers); |
---|
| 14533 | + SetMouseMode(0, modifiers); |
---|
14528 | 14534 | } |
---|
14529 | 14535 | |
---|
14530 | 14536 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14984 | 14990 | //mode = ROTATE; |
---|
14985 | 14991 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14986 | 14992 | { |
---|
14987 | | - SetMouseMode(modifiers); |
---|
| 14993 | + SetMouseMode(0, modifiers); |
---|
14988 | 14994 | } |
---|
14989 | 14995 | } |
---|
14990 | 14996 | |
---|
.. | .. |
---|
15120 | 15126 | { |
---|
15121 | 15127 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15122 | 15128 | //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) |
---|
15124 | 15130 | { |
---|
15125 | 15131 | mouseMoved(e); |
---|
15126 | 15132 | } else |
---|
.. | .. |
---|
15557 | 15563 | public boolean mouseDown(Event evt, int x, int y) |
---|
15558 | 15564 | { |
---|
15559 | 15565 | System.out.println("mouseDown: " + evt); |
---|
| 15566 | + System.exit(0); |
---|
15560 | 15567 | /* |
---|
15561 | 15568 | locked = true; |
---|
15562 | 15569 | drag = false; |
---|
.. | .. |
---|
15600 | 15607 | { |
---|
15601 | 15608 | keyPressed(0, modifiers); |
---|
15602 | 15609 | } |
---|
15603 | | - clickStart(x, y, modifiers); |
---|
| 15610 | + // clickStart(x, y, modifiers); |
---|
15604 | 15611 | return true; |
---|
15605 | 15612 | } |
---|
15606 | 15613 | |
---|
.. | .. |
---|
15718 | 15725 | { |
---|
15719 | 15726 | keyReleased(0, 0); |
---|
15720 | 15727 | } |
---|
15721 | | - drag(x, y, modifiers); |
---|
| 15728 | + drag(x, y, 0, modifiers); |
---|
15722 | 15729 | return true; |
---|
15723 | 15730 | } |
---|
15724 | 15731 | |
---|