.. | .. |
---|
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 | |
---|
.. | .. |
---|
1628 | 1628 | |
---|
1629 | 1629 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1630 | 1630 | |
---|
1631 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1631 | + float[] colorV = Grafreed.colorV; |
---|
1632 | 1632 | |
---|
1633 | 1633 | /**/ |
---|
1634 | 1634 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
2140 | 2140 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2141 | 2141 | |
---|
2142 | 2142 | if (!Globals.isLIVE()) // save sound |
---|
2143 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2143 | + Grafreed.savesound = true; // wav.save(); |
---|
2144 | 2144 | // else |
---|
2145 | 2145 | repaint(); // start loop // may 2013 |
---|
2146 | 2146 | } |
---|
.. | .. |
---|
2267 | 2267 | |
---|
2268 | 2268 | void ToggleRandom() |
---|
2269 | 2269 | { |
---|
2270 | | - RANDOM ^= true; |
---|
| 2270 | + SWITCH ^= true; |
---|
2271 | 2271 | } |
---|
2272 | 2272 | |
---|
2273 | 2273 | void ToggleHandles() |
---|
.. | .. |
---|
8022 | 8022 | } |
---|
8023 | 8023 | } |
---|
8024 | 8024 | |
---|
8025 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8025 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8026 | 8026 | { |
---|
8027 | 8027 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8028 | 8028 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8067 | 8067 | return; // true; |
---|
8068 | 8068 | } |
---|
8069 | 8069 | |
---|
8070 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8070 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8071 | 8071 | { |
---|
8072 | 8072 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8073 | 8073 | |
---|
.. | .. |
---|
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 |
---|
.. | .. |
---|
8180 | 8184 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8181 | 8185 | |
---|
8182 | 8186 | |
---|
8183 | | - if (texturedata != null) |
---|
| 8187 | + if (texturedata == null) |
---|
| 8188 | + throw new Exception(); |
---|
| 8189 | + |
---|
8184 | 8190 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8185 | 8191 | //texture = GetTexture(tex, bump); |
---|
8186 | 8192 | } |
---|
.. | .. |
---|
8302 | 8308 | return texture; |
---|
8303 | 8309 | } |
---|
8304 | 8310 | |
---|
8305 | | - 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 |
---|
8306 | 8312 | { |
---|
8307 | 8313 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8308 | 8314 | |
---|
.. | .. |
---|
8320 | 8326 | return texture!=null?texture.texture:null; |
---|
8321 | 8327 | } |
---|
8322 | 8328 | |
---|
8323 | | - 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 |
---|
8324 | 8330 | { |
---|
8325 | 8331 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8326 | 8332 | |
---|
8327 | 8333 | return texture!=null?texture.texturedata:null; |
---|
8328 | 8334 | } |
---|
8329 | 8335 | |
---|
8330 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8336 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8331 | 8337 | { |
---|
8332 | 8338 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8333 | 8339 | { |
---|
.. | .. |
---|
9538 | 9544 | |
---|
9539 | 9545 | if (!BOXMODE) |
---|
9540 | 9546 | { |
---|
9541 | | - 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) + ")"); |
---|
9542 | 9548 | } |
---|
9543 | 9549 | |
---|
9544 | 9550 | if (!BOXMODE) |
---|
.. | .. |
---|
9576 | 9582 | ABORTED = false; |
---|
9577 | 9583 | } |
---|
9578 | 9584 | else |
---|
9579 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9585 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9580 | 9586 | |
---|
9581 | 9587 | if (false) |
---|
9582 | 9588 | { |
---|
.. | .. |
---|
10239 | 10245 | |
---|
10240 | 10246 | public void display(GLAutoDrawable drawable) |
---|
10241 | 10247 | { |
---|
10242 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10248 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10243 | 10249 | { |
---|
10244 | | - GrafreeD.wav.save(); |
---|
10245 | | - GrafreeD.savesound = false; |
---|
10246 | | - GrafreeD.hassound = false; |
---|
| 10250 | + Grafreed.wav.save(); |
---|
| 10251 | + Grafreed.savesound = false; |
---|
| 10252 | + Grafreed.hassound = false; |
---|
10247 | 10253 | } |
---|
10248 | 10254 | // if (DEBUG_SELECTION) |
---|
10249 | 10255 | // { |
---|
.. | .. |
---|
10373 | 10379 | Object3D theobject = object; |
---|
10374 | 10380 | Object3D theparent = object.parent; |
---|
10375 | 10381 | object.parent = null; |
---|
10376 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10382 | + object = (Object3D)Grafreed.clone(object); |
---|
10377 | 10383 | object.Stripify(); |
---|
10378 | 10384 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10379 | 10385 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
10794 | 10800 | // Bump noise |
---|
10795 | 10801 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10796 | 10802 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10797 | | - 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 | + |
---|
10798 | 10813 | |
---|
10799 | 10814 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10800 | 10815 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11279 | 11294 | e.printStackTrace(); |
---|
11280 | 11295 | } |
---|
11281 | 11296 | |
---|
11282 | | - if (GrafreeD.RENDERME > 0) |
---|
11283 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11297 | + if (Grafreed.RENDERME > 0) |
---|
| 11298 | + Grafreed.RENDERME--; // mechante magouille |
---|
11284 | 11299 | |
---|
11285 | 11300 | Globals.ONESTEP = false; |
---|
11286 | 11301 | } |
---|
.. | .. |
---|
11350 | 11365 | |
---|
11351 | 11366 | usedtextures.clear(); |
---|
11352 | 11367 | |
---|
11353 | | - 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 | + } |
---|
11354 | 11376 | } |
---|
11355 | 11377 | //System.out.println("--> " + stackdepth); |
---|
11356 | 11378 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11441 | 11463 | if (checker != null && DrawMode() == DEFAULT) |
---|
11442 | 11464 | { |
---|
11443 | 11465 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11444 | | - 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 | + } |
---|
11445 | 11474 | // NEAREST |
---|
11446 | 11475 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11447 | 11476 | DrawChecker(gl); |
---|
.. | .. |
---|
12473 | 12502 | |
---|
12474 | 12503 | // display shadow only (bump == 0) |
---|
12475 | 12504 | "SUB temp.x, half.x, shadow.x;" + |
---|
12476 | | - "MOV temp.y, -params6.x;" + |
---|
12477 | | - "SLT temp.z, temp.y, zero.x;" + |
---|
| 12505 | + "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
| 12506 | + "SLT temp.z, temp.y, -one2048th.x;" + |
---|
12478 | 12507 | "SUB temp.y, one.x, temp.z;" + |
---|
12479 | 12508 | "MUL temp.x, temp.x, temp.y;" + |
---|
12480 | 12509 | "KIL temp.x;" + |
---|
.. | .. |
---|
12603 | 12632 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12604 | 12633 | |
---|
12605 | 12634 | "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 |
---|
| 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 |
---|
12608 | 12639 | "MUL temp.x, temp.x, temp.y;" + |
---|
12609 | 12640 | |
---|
12610 | 12641 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
12752 | 12783 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12753 | 12784 | "FLR final.x, final.y;" + |
---|
12754 | 12785 | "SUB final.y, final.y, final.x;" + |
---|
12755 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12786 | + "MUL final.x, final.x, c256i;" + |
---|
12756 | 12787 | "MOV final.z, zero.x;" + |
---|
12757 | 12788 | "MOV final.a, one.w;":"" |
---|
12758 | 12789 | ) + |
---|
.. | .. |
---|
12760 | 12791 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12761 | 12792 | "FLR final.x, final.y;" + |
---|
12762 | 12793 | "SUB final.y, final.y, final.x;" + |
---|
12763 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12794 | + "MUL final.x, final.x, c256i;" + |
---|
12764 | 12795 | "MOV final.z, zero.x;" + |
---|
12765 | 12796 | "MOV final.a, one.w;":"" |
---|
12766 | 12797 | ) + |
---|
.. | .. |
---|
12803 | 12834 | //once = true; |
---|
12804 | 12835 | } |
---|
12805 | 12836 | |
---|
12806 | | - System.out.print("Program #" + mode + "; length = " + program.length()); |
---|
| 12837 | + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
12807 | 12838 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
12808 | 12839 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
12809 | 12840 | |
---|
.. | .. |
---|
12936 | 12967 | |
---|
12937 | 12968 | "ADD " + depth + ".z, " + depth + ".z, temp.x;" + |
---|
12938 | 12969 | //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing! |
---|
| 12970 | + |
---|
| 12971 | + // Compare fragment depth in light space with shadowmap. |
---|
12939 | 12972 | "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
12940 | 12973 | "SGE temp.y, temp.x, zero.x;" + |
---|
12941 | | - "SUB " + shadow + ".y, one.x, temp.y;" + |
---|
| 12974 | + "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded |
---|
| 12975 | + |
---|
| 12976 | + // Reverse comparison |
---|
12942 | 12977 | "SUB temp.x, one.x, temp.x;" + |
---|
12943 | 12978 | "MUL " + shadow + ".x, temp.x, temp.y;" + |
---|
12944 | | - "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded |
---|
| 12979 | + "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse |
---|
12945 | 12980 | "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth |
---|
12946 | 12981 | |
---|
12947 | 12982 | "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
.. | .. |
---|
12955 | 12990 | // No shadow for backface |
---|
12956 | 12991 | "DP3 temp.x, normal, lightd;" + |
---|
12957 | 12992 | "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;" + |
---|
12958 | 12997 | "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
12959 | 12998 | ""; |
---|
12960 | 12999 | } |
---|
.. | .. |
---|
13513 | 13552 | public void mousePressed(MouseEvent e) |
---|
13514 | 13553 | { |
---|
13515 | 13554 | //System.out.println("mousePressed: " + e); |
---|
13516 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13555 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13517 | 13556 | } |
---|
13518 | 13557 | |
---|
13519 | 13558 | static long prevtime = 0; |
---|
.. | .. |
---|
13589 | 13628 | // mode |= META; |
---|
13590 | 13629 | //} |
---|
13591 | 13630 | |
---|
13592 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13593 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13631 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13632 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13594 | 13633 | anchorX = ax; |
---|
13595 | 13634 | anchorY = ay; |
---|
13596 | 13635 | prevX = px; |
---|
.. | .. |
---|
13650 | 13689 | // wasliveok = true; |
---|
13651 | 13690 | // waslive = false; |
---|
13652 | 13691 | |
---|
| 13692 | + // May 2019 Forget it: |
---|
| 13693 | + if (true) |
---|
| 13694 | + return; |
---|
| 13695 | + |
---|
13653 | 13696 | // source == timer |
---|
13654 | 13697 | if (mouseDown) |
---|
13655 | 13698 | { |
---|
.. | .. |
---|
13688 | 13731 | |
---|
13689 | 13732 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13690 | 13733 | |
---|
13691 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13734 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13692 | 13735 | { |
---|
13693 | 13736 | if (!wasliveok) |
---|
13694 | 13737 | return; |
---|
.. | .. |
---|
13705 | 13748 | // touched = true; // main DL |
---|
13706 | 13749 | if (isRenderer) |
---|
13707 | 13750 | { |
---|
13708 | | - SetMouseMode(modifiers); |
---|
| 13751 | + SetMouseMode(modifiers, modifiersex); |
---|
13709 | 13752 | } |
---|
13710 | 13753 | |
---|
13711 | 13754 | selectX = anchorX = x; |
---|
.. | .. |
---|
13718 | 13761 | clicked = true; |
---|
13719 | 13762 | hold = false; |
---|
13720 | 13763 | |
---|
13721 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13764 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13722 | 13765 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13723 | 13766 | { |
---|
13724 | 13767 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13749 | 13792 | info.camera = renderCamera; |
---|
13750 | 13793 | info.x = x; |
---|
13751 | 13794 | info.y = y; |
---|
13752 | | - info.modifiers = modifiers; |
---|
| 13795 | + info.modifiers = modifiersex; |
---|
13753 | 13796 | editObj = object.doEditClick(info, 0); |
---|
13754 | 13797 | if (!editObj) |
---|
13755 | 13798 | { |
---|
.. | .. |
---|
13778 | 13821 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13779 | 13822 | } |
---|
13780 | 13823 | else |
---|
13781 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13824 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13782 | 13825 | |
---|
13783 | 13826 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13784 | 13827 | } |
---|
.. | .. |
---|
14015 | 14058 | { |
---|
14016 | 14059 | Globals.lighttouched = true; |
---|
14017 | 14060 | } |
---|
14018 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14061 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14019 | 14062 | } |
---|
14020 | 14063 | //else |
---|
14021 | 14064 | } |
---|
.. | .. |
---|
14115 | 14158 | int X, Y; |
---|
14116 | 14159 | boolean SX, SY; |
---|
14117 | 14160 | |
---|
14118 | | - void drag(int x, int y, int modifiers) |
---|
| 14161 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14119 | 14162 | { |
---|
14120 | 14163 | if (IsFrozen()) |
---|
14121 | 14164 | { |
---|
.. | .. |
---|
14124 | 14167 | |
---|
14125 | 14168 | drag = true; // NEW |
---|
14126 | 14169 | |
---|
14127 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14170 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14128 | 14171 | |
---|
14129 | 14172 | X = x; |
---|
14130 | 14173 | Y = y; |
---|
14131 | 14174 | // floating state for animation |
---|
14132 | | - MODIFIERS = modifiers; |
---|
14133 | | - modifiers &= ~1024; |
---|
| 14175 | + MODIFIERS = modifiersex; |
---|
| 14176 | + modifiersex &= ~1024; |
---|
14134 | 14177 | if (false) // modifiers != 0) |
---|
14135 | 14178 | { |
---|
14136 | 14179 | //new Exception().printStackTrace(); |
---|
14137 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14180 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14138 | 14181 | System.out.println("SHIFT = " + SHIFT); |
---|
14139 | 14182 | System.out.println("CONTROL = " + COMMAND); |
---|
14140 | 14183 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14154 | 14197 | info.camera = renderCamera; |
---|
14155 | 14198 | info.x = x; |
---|
14156 | 14199 | info.y = y; |
---|
14157 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14200 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14158 | 14201 | } else |
---|
14159 | 14202 | { |
---|
14160 | 14203 | if (x < startX) |
---|
.. | .. |
---|
14353 | 14396 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14354 | 14397 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14355 | 14398 | |
---|
14356 | | - if (control || command || IsFrozen()) |
---|
| 14399 | +// No delay if (control || command || IsFrozen()) |
---|
14357 | 14400 | timeout = true; |
---|
14358 | | - else |
---|
| 14401 | +// ?? May 2019 else |
---|
14359 | 14402 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14360 | 14403 | mouseDown = false; |
---|
14361 | 14404 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14465 | 14508 | System.out.println("keyReleased: " + e); |
---|
14466 | 14509 | } |
---|
14467 | 14510 | |
---|
14468 | | - void SetMouseMode(int modifiers) |
---|
| 14511 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14469 | 14512 | { |
---|
14470 | 14513 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14471 | 14514 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14477 | 14520 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14478 | 14521 | // return; |
---|
14479 | 14522 | //System.out.println("SetMode = " + modifiers); |
---|
14480 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14523 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14481 | 14524 | { |
---|
14482 | 14525 | mouseMode |= ZOOM; |
---|
14483 | 14526 | } |
---|
14484 | 14527 | |
---|
14485 | 14528 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14486 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14529 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14487 | 14530 | { |
---|
14488 | 14531 | mouseMode |= VR; // BACKFORTH; |
---|
14489 | 14532 | } |
---|
14490 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14533 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14491 | 14534 | { |
---|
14492 | 14535 | mouseMode |= SELECT; |
---|
14493 | 14536 | } |
---|
14494 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14537 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14495 | 14538 | { |
---|
14496 | 14539 | mouseMode |= SELECT; |
---|
14497 | 14540 | } |
---|
14498 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14541 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14499 | 14542 | { |
---|
14500 | 14543 | mouseMode &= ~VR; |
---|
14501 | 14544 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14524 | 14567 | |
---|
14525 | 14568 | if (isRenderer) // |
---|
14526 | 14569 | { |
---|
14527 | | - SetMouseMode(modifiers); |
---|
| 14570 | + SetMouseMode(0, modifiers); |
---|
14528 | 14571 | } |
---|
14529 | 14572 | |
---|
14530 | 14573 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14860 | 14903 | //RESIZETEXTURE ^= true; |
---|
14861 | 14904 | //break; |
---|
14862 | 14905 | case 'z': |
---|
14863 | | - RENDERSHADOW ^= true; |
---|
| 14906 | + Globals.RENDERSHADOW ^= true; |
---|
14864 | 14907 | Globals.lighttouched = true; |
---|
14865 | 14908 | repaint(); |
---|
14866 | 14909 | break; |
---|
.. | .. |
---|
14984 | 15027 | //mode = ROTATE; |
---|
14985 | 15028 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14986 | 15029 | { |
---|
14987 | | - SetMouseMode(modifiers); |
---|
| 15030 | + SetMouseMode(0, modifiers); |
---|
14988 | 15031 | } |
---|
14989 | 15032 | } |
---|
14990 | 15033 | |
---|
.. | .. |
---|
15120 | 15163 | { |
---|
15121 | 15164 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15122 | 15165 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15123 | | - 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) |
---|
15124 | 15167 | { |
---|
15125 | 15168 | mouseMoved(e); |
---|
15126 | 15169 | } else |
---|
.. | .. |
---|
15557 | 15600 | public boolean mouseDown(Event evt, int x, int y) |
---|
15558 | 15601 | { |
---|
15559 | 15602 | System.out.println("mouseDown: " + evt); |
---|
| 15603 | + System.exit(0); |
---|
15560 | 15604 | /* |
---|
15561 | 15605 | locked = true; |
---|
15562 | 15606 | drag = false; |
---|
.. | .. |
---|
15600 | 15644 | { |
---|
15601 | 15645 | keyPressed(0, modifiers); |
---|
15602 | 15646 | } |
---|
15603 | | - clickStart(x, y, modifiers); |
---|
| 15647 | + // clickStart(x, y, modifiers); |
---|
15604 | 15648 | return true; |
---|
15605 | 15649 | } |
---|
15606 | 15650 | |
---|
.. | .. |
---|
15718 | 15762 | { |
---|
15719 | 15763 | keyReleased(0, 0); |
---|
15720 | 15764 | } |
---|
15721 | | - drag(x, y, modifiers); |
---|
| 15765 | + drag(x, y, 0, modifiers); |
---|
15722 | 15766 | return true; |
---|
15723 | 15767 | } |
---|
15724 | 15768 | |
---|
.. | .. |
---|
16416 | 16460 | 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])); |
---|
16417 | 16461 | } |
---|
16418 | 16462 | |
---|
16419 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16463 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16420 | 16464 | } |
---|
16421 | 16465 | } |
---|
16422 | 16466 | |
---|
16423 | 16467 | if (!movingcamera && !PAINTMODE) |
---|
16424 | 16468 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16425 | 16469 | |
---|
16426 | | - 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) |
---|
16427 | 16471 | { |
---|
16428 | | - 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); |
---|
16429 | 16473 | |
---|
16430 | 16474 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16431 | 16475 | |
---|
.. | .. |
---|
16581 | 16625 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16582 | 16626 | } |
---|
16583 | 16627 | |
---|
16584 | | - if (!RENDERSHADOW) |
---|
| 16628 | + if (!Globals.RENDERSHADOW) |
---|
16585 | 16629 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16586 | 16630 | |
---|
16587 | 16631 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16591 | 16635 | //gl.glColorMask(false, false, false, false); |
---|
16592 | 16636 | |
---|
16593 | 16637 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16594 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16638 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16595 | 16639 | { |
---|
16596 | 16640 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16597 | 16641 | |
---|