.. | .. |
---|
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 | |
---|
.. | .. |
---|
151 | 149 | defaultcaps.setAccumBlueBits(16); |
---|
152 | 150 | defaultcaps.setAccumAlphaBits(16); |
---|
153 | 151 | } |
---|
| 152 | + |
---|
| 153 | + private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory(); |
---|
154 | 154 | |
---|
155 | 155 | void SetAsGLRenderer(boolean b) |
---|
156 | 156 | { |
---|
.. | .. |
---|
464 | 464 | if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
465 | 465 | { |
---|
466 | 466 | //gl.glBegin(gl.GL_TRIANGLES); |
---|
467 | | - boolean hasnorm = pv.norm != null; // && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0); |
---|
| 467 | + boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0); |
---|
468 | 468 | if (!hasnorm) |
---|
469 | 469 | { |
---|
470 | 470 | // System.out.println("FUCK!!"); |
---|
.. | .. |
---|
1630 | 1630 | |
---|
1631 | 1631 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1632 | 1632 | |
---|
1633 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1633 | + float[] colorV = Grafreed.colorV; |
---|
1634 | 1634 | |
---|
1635 | 1635 | /**/ |
---|
1636 | 1636 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
1890 | 1890 | void PushMatrix(double[][] matrix) |
---|
1891 | 1891 | { |
---|
1892 | 1892 | // GrafreeD.tracein(matrix); |
---|
1893 | | - PushMatrix(matrix,1); |
---|
| 1893 | + PushMatrix(matrix, 1); |
---|
1894 | 1894 | } |
---|
1895 | 1895 | |
---|
1896 | 1896 | void PushMatrix() |
---|
.. | .. |
---|
2142 | 2142 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2143 | 2143 | |
---|
2144 | 2144 | if (!Globals.isLIVE()) // save sound |
---|
2145 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2145 | + Grafreed.savesound = true; // wav.save(); |
---|
2146 | 2146 | // else |
---|
2147 | 2147 | repaint(); // start loop // may 2013 |
---|
2148 | 2148 | } |
---|
.. | .. |
---|
2267 | 2267 | LOOKAT ^= true; |
---|
2268 | 2268 | } |
---|
2269 | 2269 | |
---|
2270 | | - void ToggleRandom() |
---|
| 2270 | + void ToggleSwitch() |
---|
2271 | 2271 | { |
---|
2272 | | - RANDOM ^= true; |
---|
| 2272 | + SWITCH ^= true; |
---|
2273 | 2273 | } |
---|
2274 | 2274 | |
---|
2275 | 2275 | void ToggleHandles() |
---|
.. | .. |
---|
2376 | 2376 | { |
---|
2377 | 2377 | return currentGL; |
---|
2378 | 2378 | } |
---|
2379 | | - |
---|
| 2379 | + |
---|
2380 | 2380 | /**/ |
---|
2381 | 2381 | class CacheTexture |
---|
2382 | 2382 | { |
---|
.. | .. |
---|
8024 | 8024 | } |
---|
8025 | 8025 | } |
---|
8026 | 8026 | |
---|
8027 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8027 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8028 | 8028 | { |
---|
8029 | 8029 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8030 | 8030 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8069 | 8069 | return; // true; |
---|
8070 | 8070 | } |
---|
8071 | 8071 | |
---|
8072 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8072 | + java.util.HashSet<String> missingTextures = new java.util.HashSet<String>(); |
---|
| 8073 | + |
---|
| 8074 | + private boolean FileExists(String tex) |
---|
| 8075 | + { |
---|
| 8076 | + if (missingTextures.contains(tex)) |
---|
| 8077 | + { |
---|
| 8078 | + return false; |
---|
| 8079 | + } |
---|
| 8080 | + |
---|
| 8081 | + boolean fileExists = new File(tex).exists(); |
---|
| 8082 | + |
---|
| 8083 | + if (!fileExists) |
---|
| 8084 | + { |
---|
| 8085 | + // If file exists, the "new File()" is not executed sgain |
---|
| 8086 | + missingTextures.add(tex); |
---|
| 8087 | + } |
---|
| 8088 | + |
---|
| 8089 | + return fileExists; |
---|
| 8090 | + } |
---|
| 8091 | + |
---|
| 8092 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8073 | 8093 | { |
---|
8074 | 8094 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8075 | 8095 | |
---|
.. | .. |
---|
8077 | 8097 | { |
---|
8078 | 8098 | String texname = tex; |
---|
8079 | 8099 | |
---|
8080 | | - String[] split = tex.split("Textures"); |
---|
8081 | | - if (split.length > 1) |
---|
8082 | | - texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8083 | | - else |
---|
8084 | | - if (!texname.startsWith("/")) |
---|
8085 | | - texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8100 | + String fallbackTextureName = defaultDirectory + "/Textures/" + texname; |
---|
| 8101 | + |
---|
| 8102 | +// String[] split = tex.split("Textures"); |
---|
| 8103 | +// if (split.length > 1) |
---|
| 8104 | +// texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
| 8105 | +// else |
---|
| 8106 | +// if (!texname.startsWith("/")) |
---|
| 8107 | +// texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8108 | + if (!FileExists(tex)) |
---|
| 8109 | + { |
---|
| 8110 | + texname = fallbackTextureName; |
---|
| 8111 | + } |
---|
8086 | 8112 | |
---|
8087 | 8113 | if (CACHETEXTURE) |
---|
8088 | 8114 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
8151 | 8177 | } |
---|
8152 | 8178 | |
---|
8153 | 8179 | cachename = texname.substring(0, texname.length()-4)+ext+".jpg"; |
---|
8154 | | - if (!new File(cachename).exists()) |
---|
| 8180 | + if (!FileExists(cachename)) |
---|
8155 | 8181 | cachename = texname; |
---|
8156 | 8182 | else |
---|
8157 | 8183 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8173 | 8199 | } |
---|
8174 | 8200 | |
---|
8175 | 8201 | cachename = texname.substring(0, texname.length()-4)+ext+".png"; |
---|
8176 | | - if (!new File(cachename).exists()) |
---|
| 8202 | + if (!FileExists(cachename)) |
---|
8177 | 8203 | cachename = texname; |
---|
8178 | 8204 | else |
---|
8179 | 8205 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8182 | 8208 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8183 | 8209 | |
---|
8184 | 8210 | |
---|
8185 | | - if (texturedata != null) |
---|
| 8211 | + if (texturedata == null) |
---|
| 8212 | + throw new Exception(); |
---|
| 8213 | + |
---|
8186 | 8214 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8187 | 8215 | //texture = GetTexture(tex, bump); |
---|
8188 | 8216 | } |
---|
.. | .. |
---|
8304 | 8332 | return texture; |
---|
8305 | 8333 | } |
---|
8306 | 8334 | |
---|
8307 | | - com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) |
---|
| 8335 | + com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8308 | 8336 | { |
---|
8309 | 8337 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8310 | 8338 | |
---|
.. | .. |
---|
8322 | 8350 | return texture!=null?texture.texture:null; |
---|
8323 | 8351 | } |
---|
8324 | 8352 | |
---|
8325 | | - public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
| 8353 | + public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception |
---|
8326 | 8354 | { |
---|
8327 | 8355 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8328 | 8356 | |
---|
8329 | 8357 | return texture!=null?texture.texturedata:null; |
---|
8330 | 8358 | } |
---|
8331 | 8359 | |
---|
8332 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8360 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8333 | 8361 | { |
---|
8334 | 8362 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8335 | 8363 | { |
---|
.. | .. |
---|
9306 | 9334 | assert (parentcam != renderCamera); |
---|
9307 | 9335 | |
---|
9308 | 9336 | if (renderCamera != lightCamera) |
---|
9309 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9310 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 9337 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9338 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
9311 | 9339 | |
---|
9312 | 9340 | // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix); |
---|
9313 | 9341 | |
---|
.. | .. |
---|
9322 | 9350 | LA.matCopy(renderCamera.fromScreen, matrix); |
---|
9323 | 9351 | |
---|
9324 | 9352 | if (renderCamera != lightCamera) |
---|
9325 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9326 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 9353 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9354 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
9327 | 9355 | |
---|
9328 | 9356 | // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix); |
---|
9329 | 9357 | |
---|
.. | .. |
---|
9395 | 9423 | //gl.glFlush(); |
---|
9396 | 9424 | gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE); |
---|
9397 | 9425 | |
---|
9398 | | - if (ANIMATION && ABORTED) |
---|
| 9426 | + if (Globals.ANIMATION && ABORTED) |
---|
9399 | 9427 | { |
---|
9400 | 9428 | System.err.println(" ABORTED FRAME"); |
---|
9401 | 9429 | break; |
---|
.. | .. |
---|
9425 | 9453 | setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
---|
9426 | 9454 | |
---|
9427 | 9455 | // save image |
---|
9428 | | - if (ANIMATION && !ABORTED) |
---|
| 9456 | + if (Globals.ANIMATION && !ABORTED) |
---|
9429 | 9457 | { |
---|
9430 | 9458 | VPwidth = viewport[2]; |
---|
9431 | 9459 | VPheight = viewport[3]; |
---|
.. | .. |
---|
9536 | 9564 | |
---|
9537 | 9565 | // imagecount++; |
---|
9538 | 9566 | |
---|
9539 | | - String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
| 9567 | + String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext; |
---|
9540 | 9568 | |
---|
9541 | 9569 | if (!BOXMODE) |
---|
9542 | 9570 | { |
---|
9543 | | - System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
| 9571 | + System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")"); |
---|
9544 | 9572 | } |
---|
9545 | 9573 | |
---|
9546 | 9574 | if (!BOXMODE) |
---|
.. | .. |
---|
9578 | 9606 | ABORTED = false; |
---|
9579 | 9607 | } |
---|
9580 | 9608 | else |
---|
9581 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9609 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9582 | 9610 | |
---|
9583 | 9611 | if (false) |
---|
9584 | 9612 | { |
---|
.. | .. |
---|
10241 | 10269 | |
---|
10242 | 10270 | public void display(GLAutoDrawable drawable) |
---|
10243 | 10271 | { |
---|
10244 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10272 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10245 | 10273 | { |
---|
10246 | | - GrafreeD.wav.save(); |
---|
10247 | | - GrafreeD.savesound = false; |
---|
10248 | | - GrafreeD.hassound = false; |
---|
| 10274 | + Grafreed.wav.save(); |
---|
| 10275 | + Grafreed.savesound = false; |
---|
| 10276 | + Grafreed.hassound = false; |
---|
10249 | 10277 | } |
---|
10250 | 10278 | // if (DEBUG_SELECTION) |
---|
10251 | 10279 | // { |
---|
.. | .. |
---|
10375 | 10403 | Object3D theobject = object; |
---|
10376 | 10404 | Object3D theparent = object.parent; |
---|
10377 | 10405 | object.parent = null; |
---|
10378 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10406 | + object = (Object3D)Grafreed.clone(object); |
---|
10379 | 10407 | object.Stripify(); |
---|
10380 | 10408 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10381 | 10409 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
10388 | 10416 | ambientOcclusion = false; |
---|
10389 | 10417 | } |
---|
10390 | 10418 | |
---|
10391 | | - if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN) |
---|
| 10419 | + if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10392 | 10420 | { |
---|
10393 | 10421 | //if (RENDERSHADOW) // ? |
---|
10394 | 10422 | if (!IsFrozen()) |
---|
10395 | 10423 | { |
---|
10396 | 10424 | // dec 2012 |
---|
10397 | | - if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
| 10425 | + if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
10398 | 10426 | { |
---|
10399 | 10427 | Globals.framecount++; |
---|
10400 | 10428 | shadowbuffer.display(); |
---|
.. | .. |
---|
10521 | 10549 | |
---|
10522 | 10550 | // if (parentcam != renderCamera) // not a light |
---|
10523 | 10551 | if (cam != lightCamera) |
---|
10524 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10525 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 10552 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10553 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
10526 | 10554 | |
---|
10527 | 10555 | for (int j = 0; j < 4; j++) |
---|
10528 | 10556 | { |
---|
.. | .. |
---|
10536 | 10564 | |
---|
10537 | 10565 | // if (parentcam != renderCamera) // not a light |
---|
10538 | 10566 | if (cam != lightCamera) |
---|
10539 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10540 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 10567 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10568 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
10541 | 10569 | |
---|
10542 | 10570 | //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix); |
---|
10543 | 10571 | |
---|
.. | .. |
---|
10796 | 10824 | // Bump noise |
---|
10797 | 10825 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10798 | 10826 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10799 | | - BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10827 | + |
---|
| 10828 | + try |
---|
| 10829 | + { |
---|
| 10830 | + BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10831 | + } |
---|
| 10832 | + catch (Exception e) |
---|
| 10833 | + { |
---|
| 10834 | + System.err.println("FAILED: " + NOISE_TEXTURE); |
---|
| 10835 | + } |
---|
| 10836 | + |
---|
10800 | 10837 | |
---|
10801 | 10838 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10802 | 10839 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
10921 | 10958 | System.err.println("parentcam != renderCamera"); |
---|
10922 | 10959 | |
---|
10923 | 10960 | // if (cam != lightCamera) |
---|
10924 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10925 | | - LA.xformDir(lightposition, parentcam.toParent, lightposition); // may 2013 |
---|
| 10961 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10962 | + LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013 |
---|
10926 | 10963 | } |
---|
10927 | 10964 | |
---|
10928 | 10965 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
10943 | 10980 | if (true) // TODO |
---|
10944 | 10981 | { |
---|
10945 | 10982 | if (cam != lightCamera) |
---|
10946 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10947 | | - LA.xformDir(light0, parentcam.toParent, light0); // may 2013 |
---|
| 10983 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10984 | + LA.xformDir(light0, parentcam.GlobalTransform(), light0); // may 2013 |
---|
10948 | 10985 | } |
---|
10949 | 10986 | |
---|
10950 | 10987 | LA.xformPos(light0, cam.toScreen, light0); |
---|
.. | .. |
---|
11260 | 11297 | { |
---|
11261 | 11298 | renderpass++; |
---|
11262 | 11299 | // System.out.println("Draw object... "); |
---|
| 11300 | + STEP = 1; |
---|
11263 | 11301 | if (FAST) // in case there is no script |
---|
11264 | | - STEP = 16; |
---|
| 11302 | + STEP = 8; |
---|
| 11303 | + |
---|
| 11304 | + if (CURRENTANTIALIAS == 0 || ACSIZE == 1) |
---|
| 11305 | + { |
---|
| 11306 | + STEP *= 4; |
---|
| 11307 | + } |
---|
11265 | 11308 | |
---|
11266 | 11309 | //object.FullInvariants(); |
---|
11267 | 11310 | |
---|
.. | .. |
---|
11275 | 11318 | e.printStackTrace(); |
---|
11276 | 11319 | } |
---|
11277 | 11320 | |
---|
11278 | | - if (GrafreeD.RENDERME > 0) |
---|
11279 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11321 | + if (Grafreed.RENDERME > 0) |
---|
| 11322 | + Grafreed.RENDERME--; // mechante magouille |
---|
11280 | 11323 | |
---|
11281 | 11324 | Globals.ONESTEP = false; |
---|
11282 | 11325 | } |
---|
.. | .. |
---|
11346 | 11389 | |
---|
11347 | 11390 | usedtextures.clear(); |
---|
11348 | 11391 | |
---|
11349 | | - BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11392 | + try |
---|
| 11393 | + { |
---|
| 11394 | + BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11395 | + } |
---|
| 11396 | + catch (Exception e) |
---|
| 11397 | + { |
---|
| 11398 | + System.err.println("FAILED: " + DEFAULT_TEXTURES); |
---|
| 11399 | + } |
---|
11350 | 11400 | } |
---|
11351 | 11401 | //System.out.println("--> " + stackdepth); |
---|
11352 | 11402 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11437 | 11487 | if (checker != null && DrawMode() == DEFAULT) |
---|
11438 | 11488 | { |
---|
11439 | 11489 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11440 | | - BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11490 | + try |
---|
| 11491 | + { |
---|
| 11492 | + BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11493 | + } |
---|
| 11494 | + catch (Exception e) |
---|
| 11495 | + { |
---|
| 11496 | + System.err.println("FAILED: " + checker.GetTextures()); |
---|
| 11497 | + } |
---|
11441 | 11498 | // NEAREST |
---|
11442 | 11499 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11443 | 11500 | DrawChecker(gl); |
---|
.. | .. |
---|
11519 | 11576 | return; |
---|
11520 | 11577 | } |
---|
11521 | 11578 | |
---|
11522 | | - String string = obj.GetToolTip(); |
---|
| 11579 | + String string = obj.toString(); //.GetToolTip(); |
---|
11523 | 11580 | |
---|
11524 | 11581 | GL gl = GetGL(); |
---|
11525 | 11582 | |
---|
.. | .. |
---|
11836 | 11893 | //obj.TransformToWorld(light, light); |
---|
11837 | 11894 | for (int i = tp.size(); --i >= 0;) |
---|
11838 | 11895 | { |
---|
11839 | | - for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
11840 | | - LA.xformPos(light, tp.get(i).toParent, light); |
---|
| 11896 | + //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
| 11897 | + LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
11841 | 11898 | } |
---|
11842 | 11899 | |
---|
11843 | 11900 | |
---|
.. | .. |
---|
11854 | 11911 | parentcam = cameras[0]; |
---|
11855 | 11912 | } |
---|
11856 | 11913 | |
---|
11857 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
11858 | | - LA.xformPos(light, parentcam.toParent, light); // may 2013 |
---|
| 11914 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 11915 | + LA.xformPos(light, parentcam.GlobalTransform(), light); // may 2013 |
---|
11859 | 11916 | |
---|
11860 | 11917 | LA.xformPos(light, renderCamera.toScreen, light); |
---|
11861 | 11918 | |
---|
.. | .. |
---|
12469 | 12526 | |
---|
12470 | 12527 | // display shadow only (bump == 0) |
---|
12471 | 12528 | "SUB temp.x, half.x, shadow.x;" + |
---|
12472 | | - "MOV temp.y, -params6.x;" + |
---|
12473 | | - "SLT temp.z, temp.y, zero.x;" + |
---|
| 12529 | + "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
| 12530 | + "SLT temp.z, temp.y, -one2048th.x;" + |
---|
12474 | 12531 | "SUB temp.y, one.x, temp.z;" + |
---|
12475 | 12532 | "MUL temp.x, temp.x, temp.y;" + |
---|
12476 | 12533 | "KIL temp.x;" + |
---|
.. | .. |
---|
12599 | 12656 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12600 | 12657 | |
---|
12601 | 12658 | "SUB temp.x, one.x, ndotl.x;" + |
---|
12602 | | - "ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
12603 | | - "ADD temp.y, one.y, options2.y;" + // sursurface |
---|
| 12659 | + // Tuning for default skin |
---|
| 12660 | + //"ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
| 12661 | + "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen |
---|
| 12662 | + "ADD temp.y, one.y, options2.y;" + // subsurface |
---|
12604 | 12663 | "MUL temp.x, temp.x, temp.y;" + |
---|
12605 | 12664 | |
---|
12606 | 12665 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
12748 | 12807 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12749 | 12808 | "FLR final.x, final.y;" + |
---|
12750 | 12809 | "SUB final.y, final.y, final.x;" + |
---|
12751 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12810 | + "MUL final.x, final.x, c256i;" + |
---|
12752 | 12811 | "MOV final.z, zero.x;" + |
---|
12753 | 12812 | "MOV final.a, one.w;":"" |
---|
12754 | 12813 | ) + |
---|
.. | .. |
---|
12756 | 12815 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12757 | 12816 | "FLR final.x, final.y;" + |
---|
12758 | 12817 | "SUB final.y, final.y, final.x;" + |
---|
12759 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12818 | + "MUL final.x, final.x, c256i;" + |
---|
12760 | 12819 | "MOV final.z, zero.x;" + |
---|
12761 | 12820 | "MOV final.a, one.w;":"" |
---|
12762 | 12821 | ) + |
---|
.. | .. |
---|
12799 | 12858 | //once = true; |
---|
12800 | 12859 | } |
---|
12801 | 12860 | |
---|
12802 | | - System.out.print("Program #" + mode + "; length = " + program.length()); |
---|
| 12861 | + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
12803 | 12862 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
12804 | 12863 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
12805 | 12864 | |
---|
.. | .. |
---|
12932 | 12991 | |
---|
12933 | 12992 | "ADD " + depth + ".z, " + depth + ".z, temp.x;" + |
---|
12934 | 12993 | //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing! |
---|
| 12994 | + |
---|
| 12995 | + // Compare fragment depth in light space with shadowmap. |
---|
12935 | 12996 | "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
12936 | 12997 | "SGE temp.y, temp.x, zero.x;" + |
---|
12937 | | - "SUB " + shadow + ".y, one.x, temp.y;" + |
---|
| 12998 | + "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded |
---|
| 12999 | + |
---|
| 13000 | + // Reverse comparison |
---|
12938 | 13001 | "SUB temp.x, one.x, temp.x;" + |
---|
12939 | 13002 | "MUL " + shadow + ".x, temp.x, temp.y;" + |
---|
12940 | | - "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded |
---|
| 13003 | + "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse |
---|
12941 | 13004 | "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth |
---|
12942 | 13005 | |
---|
12943 | 13006 | "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
.. | .. |
---|
12951 | 13014 | // No shadow for backface |
---|
12952 | 13015 | "DP3 temp.x, normal, lightd;" + |
---|
12953 | 13016 | "SLT temp.x, temp.x, zero.x;" + // shadoweps |
---|
| 13017 | + "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
| 13018 | + |
---|
| 13019 | + // No shadow when out of frustrum |
---|
| 13020 | + "SGE temp.x, " + depth + ".z, one.z;" + |
---|
12954 | 13021 | "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
12955 | 13022 | ""; |
---|
12956 | 13023 | } |
---|
.. | .. |
---|
13509 | 13576 | public void mousePressed(MouseEvent e) |
---|
13510 | 13577 | { |
---|
13511 | 13578 | //System.out.println("mousePressed: " + e); |
---|
13512 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13579 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13513 | 13580 | } |
---|
13514 | 13581 | |
---|
13515 | 13582 | static long prevtime = 0; |
---|
.. | .. |
---|
13585 | 13652 | // mode |= META; |
---|
13586 | 13653 | //} |
---|
13587 | 13654 | |
---|
13588 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13589 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13655 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13656 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13590 | 13657 | anchorX = ax; |
---|
13591 | 13658 | anchorY = ay; |
---|
13592 | 13659 | prevX = px; |
---|
.. | .. |
---|
13646 | 13713 | // wasliveok = true; |
---|
13647 | 13714 | // waslive = false; |
---|
13648 | 13715 | |
---|
| 13716 | + // May 2019 Forget it: |
---|
| 13717 | + if (true) |
---|
| 13718 | + return; |
---|
| 13719 | + |
---|
13649 | 13720 | // source == timer |
---|
13650 | 13721 | if (mouseDown) |
---|
13651 | 13722 | { |
---|
.. | .. |
---|
13684 | 13755 | |
---|
13685 | 13756 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13686 | 13757 | |
---|
13687 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13758 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13688 | 13759 | { |
---|
13689 | 13760 | if (!wasliveok) |
---|
13690 | 13761 | return; |
---|
.. | .. |
---|
13701 | 13772 | // touched = true; // main DL |
---|
13702 | 13773 | if (isRenderer) |
---|
13703 | 13774 | { |
---|
13704 | | - SetMouseMode(modifiers); |
---|
| 13775 | + SetMouseMode(modifiers, modifiersex); |
---|
13705 | 13776 | } |
---|
13706 | 13777 | |
---|
13707 | 13778 | selectX = anchorX = x; |
---|
.. | .. |
---|
13714 | 13785 | clicked = true; |
---|
13715 | 13786 | hold = false; |
---|
13716 | 13787 | |
---|
13717 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13788 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13718 | 13789 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13719 | 13790 | { |
---|
13720 | 13791 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13745 | 13816 | info.camera = renderCamera; |
---|
13746 | 13817 | info.x = x; |
---|
13747 | 13818 | info.y = y; |
---|
13748 | | - info.modifiers = modifiers; |
---|
| 13819 | + info.modifiers = modifiersex; |
---|
13749 | 13820 | editObj = object.doEditClick(info, 0); |
---|
13750 | 13821 | if (!editObj) |
---|
13751 | 13822 | { |
---|
.. | .. |
---|
13762 | 13833 | |
---|
13763 | 13834 | public void mouseDragged(MouseEvent e) |
---|
13764 | 13835 | { |
---|
| 13836 | + Globals.MOUSEDRAGGED = true; |
---|
| 13837 | + |
---|
13765 | 13838 | //System.out.println("mouseDragged: " + e); |
---|
13766 | 13839 | if (isRenderer) |
---|
13767 | 13840 | movingcamera = true; |
---|
| 13841 | + |
---|
13768 | 13842 | //if (drawing) |
---|
13769 | 13843 | //return; |
---|
13770 | 13844 | if ((e.getModifiersEx() & CTRL) != 0 |
---|
.. | .. |
---|
13774 | 13848 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13775 | 13849 | } |
---|
13776 | 13850 | else |
---|
13777 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13851 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13778 | 13852 | |
---|
13779 | 13853 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13780 | 13854 | } |
---|
.. | .. |
---|
14011 | 14085 | { |
---|
14012 | 14086 | Globals.lighttouched = true; |
---|
14013 | 14087 | } |
---|
14014 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14088 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14015 | 14089 | } |
---|
14016 | 14090 | //else |
---|
14017 | 14091 | } |
---|
.. | .. |
---|
14111 | 14185 | int X, Y; |
---|
14112 | 14186 | boolean SX, SY; |
---|
14113 | 14187 | |
---|
14114 | | - void drag(int x, int y, int modifiers) |
---|
| 14188 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14115 | 14189 | { |
---|
14116 | 14190 | if (IsFrozen()) |
---|
14117 | 14191 | { |
---|
.. | .. |
---|
14120 | 14194 | |
---|
14121 | 14195 | drag = true; // NEW |
---|
14122 | 14196 | |
---|
14123 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14197 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14124 | 14198 | |
---|
14125 | 14199 | X = x; |
---|
14126 | 14200 | Y = y; |
---|
14127 | 14201 | // floating state for animation |
---|
14128 | | - MODIFIERS = modifiers; |
---|
14129 | | - modifiers &= ~1024; |
---|
| 14202 | + MODIFIERS = modifiersex; |
---|
| 14203 | + modifiersex &= ~1024; |
---|
14130 | 14204 | if (false) // modifiers != 0) |
---|
14131 | 14205 | { |
---|
14132 | 14206 | //new Exception().printStackTrace(); |
---|
14133 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14207 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14134 | 14208 | System.out.println("SHIFT = " + SHIFT); |
---|
14135 | 14209 | System.out.println("CONTROL = " + COMMAND); |
---|
14136 | 14210 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14150 | 14224 | info.camera = renderCamera; |
---|
14151 | 14225 | info.x = x; |
---|
14152 | 14226 | info.y = y; |
---|
14153 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14227 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14154 | 14228 | } else |
---|
14155 | 14229 | { |
---|
14156 | 14230 | if (x < startX) |
---|
.. | .. |
---|
14326 | 14400 | |
---|
14327 | 14401 | public void mouseReleased(MouseEvent e) |
---|
14328 | 14402 | { |
---|
| 14403 | + Globals.MOUSEDRAGGED = false; |
---|
| 14404 | + |
---|
14329 | 14405 | movingcamera = false; |
---|
| 14406 | + X = Y = 0; |
---|
14330 | 14407 | //System.out.println("mouseReleased: " + e); |
---|
14331 | 14408 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14332 | 14409 | } |
---|
.. | .. |
---|
14349 | 14426 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14350 | 14427 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14351 | 14428 | |
---|
14352 | | - if (control || command || IsFrozen()) |
---|
| 14429 | +// No delay if (control || command || IsFrozen()) |
---|
14353 | 14430 | timeout = true; |
---|
14354 | | - else |
---|
| 14431 | +// ?? May 2019 else |
---|
14355 | 14432 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14356 | 14433 | mouseDown = false; |
---|
14357 | 14434 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14461 | 14538 | System.out.println("keyReleased: " + e); |
---|
14462 | 14539 | } |
---|
14463 | 14540 | |
---|
14464 | | - void SetMouseMode(int modifiers) |
---|
| 14541 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14465 | 14542 | { |
---|
14466 | 14543 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14467 | 14544 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14473 | 14550 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14474 | 14551 | // return; |
---|
14475 | 14552 | //System.out.println("SetMode = " + modifiers); |
---|
14476 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14553 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14477 | 14554 | { |
---|
14478 | 14555 | mouseMode |= ZOOM; |
---|
14479 | 14556 | } |
---|
14480 | 14557 | |
---|
14481 | 14558 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14482 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14559 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14483 | 14560 | { |
---|
14484 | 14561 | mouseMode |= VR; // BACKFORTH; |
---|
14485 | 14562 | } |
---|
14486 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14563 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14487 | 14564 | { |
---|
14488 | 14565 | mouseMode |= SELECT; |
---|
14489 | 14566 | } |
---|
14490 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14567 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14491 | 14568 | { |
---|
14492 | 14569 | mouseMode |= SELECT; |
---|
14493 | 14570 | } |
---|
14494 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14571 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14495 | 14572 | { |
---|
14496 | 14573 | mouseMode &= ~VR; |
---|
14497 | 14574 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14520 | 14597 | |
---|
14521 | 14598 | if (isRenderer) // |
---|
14522 | 14599 | { |
---|
14523 | | - SetMouseMode(modifiers); |
---|
| 14600 | + SetMouseMode(0, modifiers); |
---|
14524 | 14601 | } |
---|
14525 | 14602 | |
---|
14526 | 14603 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14856 | 14933 | //RESIZETEXTURE ^= true; |
---|
14857 | 14934 | //break; |
---|
14858 | 14935 | case 'z': |
---|
14859 | | - RENDERSHADOW ^= true; |
---|
| 14936 | + Globals.RENDERSHADOW ^= true; |
---|
14860 | 14937 | Globals.lighttouched = true; |
---|
14861 | 14938 | repaint(); |
---|
14862 | 14939 | break; |
---|
.. | .. |
---|
14980 | 15057 | //mode = ROTATE; |
---|
14981 | 15058 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14982 | 15059 | { |
---|
14983 | | - SetMouseMode(modifiers); |
---|
| 15060 | + SetMouseMode(0, modifiers); |
---|
14984 | 15061 | } |
---|
14985 | 15062 | } |
---|
14986 | 15063 | |
---|
.. | .. |
---|
15116 | 15193 | { |
---|
15117 | 15194 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15118 | 15195 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15119 | | - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
| 15196 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15120 | 15197 | { |
---|
15121 | 15198 | mouseMoved(e); |
---|
15122 | 15199 | } else |
---|
.. | .. |
---|
15335 | 15412 | info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom)); |
---|
15336 | 15413 | //Image img = CreateImage(width, height); |
---|
15337 | 15414 | //System.out.println("width = " + width + "; height = " + height + "\n"); |
---|
| 15415 | + |
---|
15338 | 15416 | Graphics gr = g; // img.getGraphics(); |
---|
| 15417 | + |
---|
15339 | 15418 | if (!hasMarquee) |
---|
15340 | 15419 | { |
---|
15341 | 15420 | if (Xmin < Xmax) // !locked) |
---|
.. | .. |
---|
15433 | 15512 | if (!isRenderer) |
---|
15434 | 15513 | { |
---|
15435 | 15514 | object.drawEditHandles(info, 0); |
---|
| 15515 | + |
---|
| 15516 | + if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15517 | + { |
---|
| 15518 | + switch (object.selection.get(0).hitSomething) |
---|
| 15519 | + { |
---|
| 15520 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15521 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15522 | + break; |
---|
| 15523 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15524 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15525 | + break; |
---|
| 15526 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15527 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15528 | + break; |
---|
| 15529 | + } |
---|
| 15530 | + |
---|
| 15531 | + } |
---|
15436 | 15532 | } |
---|
15437 | 15533 | } |
---|
| 15534 | + |
---|
15438 | 15535 | if (isRenderer) |
---|
15439 | 15536 | { |
---|
15440 | 15537 | //gr.setColor(Color.black); |
---|
15441 | 15538 | //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1); |
---|
15442 | 15539 | //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3); |
---|
15443 | 15540 | } |
---|
| 15541 | + |
---|
15444 | 15542 | if (hasMarquee) |
---|
15445 | 15543 | { |
---|
15446 | 15544 | gr.setXORMode(Color.white); |
---|
.. | .. |
---|
15553 | 15651 | public boolean mouseDown(Event evt, int x, int y) |
---|
15554 | 15652 | { |
---|
15555 | 15653 | System.out.println("mouseDown: " + evt); |
---|
| 15654 | + System.exit(0); |
---|
15556 | 15655 | /* |
---|
15557 | 15656 | locked = true; |
---|
15558 | 15657 | drag = false; |
---|
.. | .. |
---|
15596 | 15695 | { |
---|
15597 | 15696 | keyPressed(0, modifiers); |
---|
15598 | 15697 | } |
---|
15599 | | - clickStart(x, y, modifiers); |
---|
| 15698 | + // clickStart(x, y, modifiers); |
---|
15600 | 15699 | return true; |
---|
15601 | 15700 | } |
---|
15602 | 15701 | |
---|
.. | .. |
---|
15714 | 15813 | { |
---|
15715 | 15814 | keyReleased(0, 0); |
---|
15716 | 15815 | } |
---|
15717 | | - drag(x, y, modifiers); |
---|
| 15816 | + drag(x, y, 0, modifiers); |
---|
15718 | 15817 | return true; |
---|
15719 | 15818 | } |
---|
15720 | 15819 | |
---|
.. | .. |
---|
15846 | 15945 | Object3D object; |
---|
15847 | 15946 | static Object3D trackedobject; |
---|
15848 | 15947 | Camera renderCamera; // Light or Eye (or Occlusion) |
---|
15849 | | - /*static*/ Camera manipCamera; // Light or Eye |
---|
| 15948 | + /*static*/ Camera manipCamera; // Light or Eye. Can be Light when Eye, not Eye when Light |
---|
15850 | 15949 | /*static*/ Camera eyeCamera; |
---|
15851 | 15950 | /*static*/ Camera lightCamera; |
---|
15852 | 15951 | int cameracount; |
---|
.. | .. |
---|
16412 | 16511 | 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])); |
---|
16413 | 16512 | } |
---|
16414 | 16513 | |
---|
16415 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16514 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16416 | 16515 | } |
---|
16417 | 16516 | } |
---|
16418 | 16517 | |
---|
16419 | 16518 | if (!movingcamera && !PAINTMODE) |
---|
16420 | 16519 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16421 | 16520 | |
---|
16422 | | - if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16521 | + if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16423 | 16522 | { |
---|
16424 | | - Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16523 | + Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16425 | 16524 | |
---|
16426 | 16525 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16427 | 16526 | |
---|
.. | .. |
---|
16577 | 16676 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16578 | 16677 | } |
---|
16579 | 16678 | |
---|
16580 | | - if (!RENDERSHADOW) |
---|
| 16679 | + if (!Globals.RENDERSHADOW) |
---|
16581 | 16680 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16582 | 16681 | |
---|
16583 | 16682 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16587 | 16686 | //gl.glColorMask(false, false, false, false); |
---|
16588 | 16687 | |
---|
16589 | 16688 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16590 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16689 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16591 | 16690 | { |
---|
16592 | 16691 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16593 | 16692 | |
---|