.. | .. |
---|
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 | |
---|
.. | .. |
---|
1630 | 1628 | |
---|
1631 | 1629 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1632 | 1630 | |
---|
1633 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1631 | + float[] colorV = Grafreed.colorV; |
---|
1634 | 1632 | |
---|
1635 | 1633 | /**/ |
---|
1636 | 1634 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
2142 | 2140 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2143 | 2141 | |
---|
2144 | 2142 | if (!Globals.isLIVE()) // save sound |
---|
2145 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2143 | + Grafreed.savesound = true; // wav.save(); |
---|
2146 | 2144 | // else |
---|
2147 | 2145 | repaint(); // start loop // may 2013 |
---|
2148 | 2146 | } |
---|
.. | .. |
---|
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 | |
---|
.. | .. |
---|
8023 | 8022 | } |
---|
8024 | 8023 | } |
---|
8025 | 8024 | |
---|
8026 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8025 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8027 | 8026 | { |
---|
8028 | 8027 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8029 | 8028 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8068 | 8067 | return; // true; |
---|
8069 | 8068 | } |
---|
8070 | 8069 | |
---|
8071 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8070 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8072 | 8071 | { |
---|
8073 | 8072 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8074 | 8073 | |
---|
.. | .. |
---|
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 |
---|
.. | .. |
---|
8181 | 8184 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8182 | 8185 | |
---|
8183 | 8186 | |
---|
8184 | | - if (texturedata != null) |
---|
| 8187 | + if (texturedata == null) |
---|
| 8188 | + throw new Exception(); |
---|
| 8189 | + |
---|
8185 | 8190 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8186 | 8191 | //texture = GetTexture(tex, bump); |
---|
8187 | 8192 | } |
---|
.. | .. |
---|
8303 | 8308 | return texture; |
---|
8304 | 8309 | } |
---|
8305 | 8310 | |
---|
8306 | | - 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 |
---|
8307 | 8312 | { |
---|
8308 | 8313 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8309 | 8314 | |
---|
.. | .. |
---|
8321 | 8326 | return texture!=null?texture.texture:null; |
---|
8322 | 8327 | } |
---|
8323 | 8328 | |
---|
8324 | | - 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 |
---|
8325 | 8330 | { |
---|
8326 | 8331 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8327 | 8332 | |
---|
8328 | 8333 | return texture!=null?texture.texturedata:null; |
---|
8329 | 8334 | } |
---|
8330 | 8335 | |
---|
8331 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8336 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8332 | 8337 | { |
---|
8333 | 8338 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8334 | 8339 | { |
---|
.. | .. |
---|
9394 | 9399 | //gl.glFlush(); |
---|
9395 | 9400 | gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE); |
---|
9396 | 9401 | |
---|
9397 | | - if (ANIMATION && ABORTED) |
---|
| 9402 | + if (Globals.ANIMATION && ABORTED) |
---|
9398 | 9403 | { |
---|
9399 | 9404 | System.err.println(" ABORTED FRAME"); |
---|
9400 | 9405 | break; |
---|
.. | .. |
---|
9424 | 9429 | setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
---|
9425 | 9430 | |
---|
9426 | 9431 | // save image |
---|
9427 | | - if (ANIMATION && !ABORTED) |
---|
| 9432 | + if (Globals.ANIMATION && !ABORTED) |
---|
9428 | 9433 | { |
---|
9429 | 9434 | VPwidth = viewport[2]; |
---|
9430 | 9435 | VPheight = viewport[3]; |
---|
.. | .. |
---|
9535 | 9540 | |
---|
9536 | 9541 | // imagecount++; |
---|
9537 | 9542 | |
---|
9538 | | - String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
| 9543 | + String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
9539 | 9544 | |
---|
9540 | 9545 | if (!BOXMODE) |
---|
9541 | 9546 | { |
---|
9542 | | - 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) + ")"); |
---|
9543 | 9548 | } |
---|
9544 | 9549 | |
---|
9545 | 9550 | if (!BOXMODE) |
---|
.. | .. |
---|
9577 | 9582 | ABORTED = false; |
---|
9578 | 9583 | } |
---|
9579 | 9584 | else |
---|
9580 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9585 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9581 | 9586 | |
---|
9582 | 9587 | if (false) |
---|
9583 | 9588 | { |
---|
.. | .. |
---|
10240 | 10245 | |
---|
10241 | 10246 | public void display(GLAutoDrawable drawable) |
---|
10242 | 10247 | { |
---|
10243 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10248 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10244 | 10249 | { |
---|
10245 | | - GrafreeD.wav.save(); |
---|
10246 | | - GrafreeD.savesound = false; |
---|
10247 | | - GrafreeD.hassound = false; |
---|
| 10250 | + Grafreed.wav.save(); |
---|
| 10251 | + Grafreed.savesound = false; |
---|
| 10252 | + Grafreed.hassound = false; |
---|
10248 | 10253 | } |
---|
10249 | 10254 | // if (DEBUG_SELECTION) |
---|
10250 | 10255 | // { |
---|
.. | .. |
---|
10374 | 10379 | Object3D theobject = object; |
---|
10375 | 10380 | Object3D theparent = object.parent; |
---|
10376 | 10381 | object.parent = null; |
---|
10377 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10382 | + object = (Object3D)Grafreed.clone(object); |
---|
10378 | 10383 | object.Stripify(); |
---|
10379 | 10384 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10380 | 10385 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
10795 | 10800 | // Bump noise |
---|
10796 | 10801 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10797 | 10802 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10798 | | - 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 | + |
---|
10799 | 10813 | |
---|
10800 | 10814 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10801 | 10815 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11259 | 11273 | { |
---|
11260 | 11274 | renderpass++; |
---|
11261 | 11275 | // System.out.println("Draw object... "); |
---|
| 11276 | + STEP = 1; |
---|
11262 | 11277 | if (FAST) // in case there is no script |
---|
11263 | | - STEP = 16; |
---|
| 11278 | + STEP = 8; |
---|
| 11279 | + |
---|
| 11280 | + if (CURRENTANTIALIAS == 0 || ACSIZE == 1) |
---|
| 11281 | + { |
---|
| 11282 | + STEP *= 4; |
---|
| 11283 | + } |
---|
11264 | 11284 | |
---|
11265 | 11285 | //object.FullInvariants(); |
---|
11266 | 11286 | |
---|
.. | .. |
---|
11274 | 11294 | e.printStackTrace(); |
---|
11275 | 11295 | } |
---|
11276 | 11296 | |
---|
11277 | | - if (GrafreeD.RENDERME > 0) |
---|
11278 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11297 | + if (Grafreed.RENDERME > 0) |
---|
| 11298 | + Grafreed.RENDERME--; // mechante magouille |
---|
11279 | 11299 | |
---|
11280 | 11300 | Globals.ONESTEP = false; |
---|
11281 | 11301 | } |
---|
.. | .. |
---|
11345 | 11365 | |
---|
11346 | 11366 | usedtextures.clear(); |
---|
11347 | 11367 | |
---|
11348 | | - 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 | + } |
---|
11349 | 11376 | } |
---|
11350 | 11377 | //System.out.println("--> " + stackdepth); |
---|
11351 | 11378 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11436 | 11463 | if (checker != null && DrawMode() == DEFAULT) |
---|
11437 | 11464 | { |
---|
11438 | 11465 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11439 | | - 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 | + } |
---|
11440 | 11474 | // NEAREST |
---|
11441 | 11475 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11442 | 11476 | DrawChecker(gl); |
---|
.. | .. |
---|
12598 | 12632 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12599 | 12633 | |
---|
12600 | 12634 | "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 |
---|
| 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 |
---|
12603 | 12639 | "MUL temp.x, temp.x, temp.y;" + |
---|
12604 | 12640 | |
---|
12605 | 12641 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
12747 | 12783 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12748 | 12784 | "FLR final.x, final.y;" + |
---|
12749 | 12785 | "SUB final.y, final.y, final.x;" + |
---|
12750 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12786 | + "MUL final.x, final.x, c256i;" + |
---|
12751 | 12787 | "MOV final.z, zero.x;" + |
---|
12752 | 12788 | "MOV final.a, one.w;":"" |
---|
12753 | 12789 | ) + |
---|
.. | .. |
---|
12755 | 12791 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12756 | 12792 | "FLR final.x, final.y;" + |
---|
12757 | 12793 | "SUB final.y, final.y, final.x;" + |
---|
12758 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12794 | + "MUL final.x, final.x, c256i;" + |
---|
12759 | 12795 | "MOV final.z, zero.x;" + |
---|
12760 | 12796 | "MOV final.a, one.w;":"" |
---|
12761 | 12797 | ) + |
---|
.. | .. |
---|
13508 | 13544 | public void mousePressed(MouseEvent e) |
---|
13509 | 13545 | { |
---|
13510 | 13546 | //System.out.println("mousePressed: " + e); |
---|
13511 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13547 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13512 | 13548 | } |
---|
13513 | 13549 | |
---|
13514 | 13550 | static long prevtime = 0; |
---|
.. | .. |
---|
13584 | 13620 | // mode |= META; |
---|
13585 | 13621 | //} |
---|
13586 | 13622 | |
---|
13587 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13588 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13623 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13624 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13589 | 13625 | anchorX = ax; |
---|
13590 | 13626 | anchorY = ay; |
---|
13591 | 13627 | prevX = px; |
---|
.. | .. |
---|
13645 | 13681 | // wasliveok = true; |
---|
13646 | 13682 | // waslive = false; |
---|
13647 | 13683 | |
---|
| 13684 | + // May 2019 Forget it: |
---|
| 13685 | + if (true) |
---|
| 13686 | + return; |
---|
| 13687 | + |
---|
13648 | 13688 | // source == timer |
---|
13649 | 13689 | if (mouseDown) |
---|
13650 | 13690 | { |
---|
.. | .. |
---|
13683 | 13723 | |
---|
13684 | 13724 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13685 | 13725 | |
---|
13686 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13726 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13687 | 13727 | { |
---|
13688 | 13728 | if (!wasliveok) |
---|
13689 | 13729 | return; |
---|
.. | .. |
---|
13700 | 13740 | // touched = true; // main DL |
---|
13701 | 13741 | if (isRenderer) |
---|
13702 | 13742 | { |
---|
13703 | | - SetMouseMode(modifiers); |
---|
| 13743 | + SetMouseMode(modifiers, modifiersex); |
---|
13704 | 13744 | } |
---|
13705 | 13745 | |
---|
13706 | 13746 | selectX = anchorX = x; |
---|
.. | .. |
---|
13713 | 13753 | clicked = true; |
---|
13714 | 13754 | hold = false; |
---|
13715 | 13755 | |
---|
13716 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13756 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13717 | 13757 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13718 | 13758 | { |
---|
13719 | 13759 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13744 | 13784 | info.camera = renderCamera; |
---|
13745 | 13785 | info.x = x; |
---|
13746 | 13786 | info.y = y; |
---|
13747 | | - info.modifiers = modifiers; |
---|
| 13787 | + info.modifiers = modifiersex; |
---|
13748 | 13788 | editObj = object.doEditClick(info, 0); |
---|
13749 | 13789 | if (!editObj) |
---|
13750 | 13790 | { |
---|
.. | .. |
---|
13773 | 13813 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13774 | 13814 | } |
---|
13775 | 13815 | else |
---|
13776 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13816 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13777 | 13817 | |
---|
13778 | 13818 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13779 | 13819 | } |
---|
.. | .. |
---|
13946 | 13986 | |
---|
13947 | 13987 | public void run() |
---|
13948 | 13988 | { |
---|
| 13989 | + new Exception().printStackTrace(); |
---|
13949 | 13990 | System.exit(0); |
---|
13950 | 13991 | for (;;) |
---|
13951 | 13992 | { |
---|
.. | .. |
---|
14009 | 14050 | { |
---|
14010 | 14051 | Globals.lighttouched = true; |
---|
14011 | 14052 | } |
---|
14012 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14053 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14013 | 14054 | } |
---|
14014 | 14055 | //else |
---|
14015 | 14056 | } |
---|
.. | .. |
---|
14109 | 14150 | int X, Y; |
---|
14110 | 14151 | boolean SX, SY; |
---|
14111 | 14152 | |
---|
14112 | | - void drag(int x, int y, int modifiers) |
---|
| 14153 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14113 | 14154 | { |
---|
14114 | 14155 | if (IsFrozen()) |
---|
14115 | 14156 | { |
---|
.. | .. |
---|
14118 | 14159 | |
---|
14119 | 14160 | drag = true; // NEW |
---|
14120 | 14161 | |
---|
14121 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14162 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14122 | 14163 | |
---|
14123 | 14164 | X = x; |
---|
14124 | 14165 | Y = y; |
---|
14125 | 14166 | // floating state for animation |
---|
14126 | | - MODIFIERS = modifiers; |
---|
14127 | | - modifiers &= ~1024; |
---|
| 14167 | + MODIFIERS = modifiersex; |
---|
| 14168 | + modifiersex &= ~1024; |
---|
14128 | 14169 | if (false) // modifiers != 0) |
---|
14129 | 14170 | { |
---|
14130 | 14171 | //new Exception().printStackTrace(); |
---|
14131 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14172 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14132 | 14173 | System.out.println("SHIFT = " + SHIFT); |
---|
14133 | 14174 | System.out.println("CONTROL = " + COMMAND); |
---|
14134 | 14175 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14148 | 14189 | info.camera = renderCamera; |
---|
14149 | 14190 | info.x = x; |
---|
14150 | 14191 | info.y = y; |
---|
14151 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14192 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14152 | 14193 | } else |
---|
14153 | 14194 | { |
---|
14154 | 14195 | if (x < startX) |
---|
.. | .. |
---|
14347 | 14388 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14348 | 14389 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14349 | 14390 | |
---|
14350 | | - if (control || command || IsFrozen()) |
---|
| 14391 | +// No delay if (control || command || IsFrozen()) |
---|
14351 | 14392 | timeout = true; |
---|
14352 | | - else |
---|
| 14393 | +// ?? May 2019 else |
---|
14353 | 14394 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14354 | 14395 | mouseDown = false; |
---|
14355 | 14396 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14459 | 14500 | System.out.println("keyReleased: " + e); |
---|
14460 | 14501 | } |
---|
14461 | 14502 | |
---|
14462 | | - void SetMouseMode(int modifiers) |
---|
| 14503 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14463 | 14504 | { |
---|
14464 | 14505 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14465 | 14506 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14471 | 14512 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14472 | 14513 | // return; |
---|
14473 | 14514 | //System.out.println("SetMode = " + modifiers); |
---|
14474 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14515 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14475 | 14516 | { |
---|
14476 | 14517 | mouseMode |= ZOOM; |
---|
14477 | 14518 | } |
---|
14478 | 14519 | |
---|
14479 | 14520 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14480 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14521 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14481 | 14522 | { |
---|
14482 | 14523 | mouseMode |= VR; // BACKFORTH; |
---|
14483 | 14524 | } |
---|
14484 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14525 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14485 | 14526 | { |
---|
14486 | 14527 | mouseMode |= SELECT; |
---|
14487 | 14528 | } |
---|
14488 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14529 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14489 | 14530 | { |
---|
14490 | 14531 | mouseMode |= SELECT; |
---|
14491 | 14532 | } |
---|
14492 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14533 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14493 | 14534 | { |
---|
14494 | 14535 | mouseMode &= ~VR; |
---|
14495 | 14536 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14518 | 14559 | |
---|
14519 | 14560 | if (isRenderer) // |
---|
14520 | 14561 | { |
---|
14521 | | - SetMouseMode(modifiers); |
---|
| 14562 | + SetMouseMode(0, modifiers); |
---|
14522 | 14563 | } |
---|
14523 | 14564 | |
---|
14524 | 14565 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14854 | 14895 | //RESIZETEXTURE ^= true; |
---|
14855 | 14896 | //break; |
---|
14856 | 14897 | case 'z': |
---|
14857 | | - RENDERSHADOW ^= true; |
---|
| 14898 | + Globals.RENDERSHADOW ^= true; |
---|
14858 | 14899 | Globals.lighttouched = true; |
---|
14859 | 14900 | repaint(); |
---|
14860 | 14901 | break; |
---|
.. | .. |
---|
14978 | 15019 | //mode = ROTATE; |
---|
14979 | 15020 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14980 | 15021 | { |
---|
14981 | | - SetMouseMode(modifiers); |
---|
| 15022 | + SetMouseMode(0, modifiers); |
---|
14982 | 15023 | } |
---|
14983 | 15024 | } |
---|
14984 | 15025 | |
---|
.. | .. |
---|
15114 | 15155 | { |
---|
15115 | 15156 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15116 | 15157 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15117 | | - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
| 15158 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15118 | 15159 | { |
---|
15119 | 15160 | mouseMoved(e); |
---|
15120 | 15161 | } else |
---|
.. | .. |
---|
15144 | 15185 | |
---|
15145 | 15186 | void SelectParent() |
---|
15146 | 15187 | { |
---|
| 15188 | + new Exception().printStackTrace(); |
---|
15147 | 15189 | System.exit(0); |
---|
15148 | 15190 | Composite group = (Composite) object; |
---|
15149 | 15191 | java.util.Vector selectees = new java.util.Vector(group.selection); |
---|
.. | .. |
---|
15167 | 15209 | |
---|
15168 | 15210 | void SelectChildren() |
---|
15169 | 15211 | { |
---|
| 15212 | + new Exception().printStackTrace(); |
---|
15170 | 15213 | System.exit(0); |
---|
15171 | 15214 | /* |
---|
15172 | 15215 | Composite group = (Composite) object; |
---|
.. | .. |
---|
15549 | 15592 | public boolean mouseDown(Event evt, int x, int y) |
---|
15550 | 15593 | { |
---|
15551 | 15594 | System.out.println("mouseDown: " + evt); |
---|
| 15595 | + System.exit(0); |
---|
15552 | 15596 | /* |
---|
15553 | 15597 | locked = true; |
---|
15554 | 15598 | drag = false; |
---|
.. | .. |
---|
15592 | 15636 | { |
---|
15593 | 15637 | keyPressed(0, modifiers); |
---|
15594 | 15638 | } |
---|
15595 | | - clickStart(x, y, modifiers); |
---|
| 15639 | + // clickStart(x, y, modifiers); |
---|
15596 | 15640 | return true; |
---|
15597 | 15641 | } |
---|
15598 | 15642 | |
---|
.. | .. |
---|
15710 | 15754 | { |
---|
15711 | 15755 | keyReleased(0, 0); |
---|
15712 | 15756 | } |
---|
15713 | | - drag(x, y, modifiers); |
---|
| 15757 | + drag(x, y, 0, modifiers); |
---|
15714 | 15758 | return true; |
---|
15715 | 15759 | } |
---|
15716 | 15760 | |
---|
.. | .. |
---|
16280 | 16324 | { |
---|
16281 | 16325 | if (!selection) |
---|
16282 | 16326 | { |
---|
| 16327 | + new Exception().printStackTrace(); |
---|
16283 | 16328 | System.exit(0); |
---|
16284 | 16329 | return; |
---|
16285 | 16330 | } |
---|
.. | .. |
---|
16407 | 16452 | 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])); |
---|
16408 | 16453 | } |
---|
16409 | 16454 | |
---|
16410 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16455 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16411 | 16456 | } |
---|
16412 | 16457 | } |
---|
16413 | 16458 | |
---|
16414 | 16459 | if (!movingcamera && !PAINTMODE) |
---|
16415 | 16460 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16416 | 16461 | |
---|
16417 | | - if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16462 | + if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16418 | 16463 | { |
---|
16419 | | - Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16464 | + Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16420 | 16465 | |
---|
16421 | 16466 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16422 | 16467 | |
---|
.. | .. |
---|
16572 | 16617 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16573 | 16618 | } |
---|
16574 | 16619 | |
---|
16575 | | - if (!RENDERSHADOW) |
---|
| 16620 | + if (!Globals.RENDERSHADOW) |
---|
16576 | 16621 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16577 | 16622 | |
---|
16578 | 16623 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16582 | 16627 | //gl.glColorMask(false, false, false, false); |
---|
16583 | 16628 | |
---|
16584 | 16629 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16585 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16630 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16586 | 16631 | { |
---|
16587 | 16632 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16588 | 16633 | |
---|