.. | .. |
---|
150 | 150 | defaultcaps.setAccumAlphaBits(16); |
---|
151 | 151 | } |
---|
152 | 152 | |
---|
| 153 | + private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory(); |
---|
| 154 | + |
---|
153 | 155 | void SetAsGLRenderer(boolean b) |
---|
154 | 156 | { |
---|
155 | 157 | isRenderer = b; |
---|
.. | .. |
---|
462 | 464 | if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
463 | 465 | { |
---|
464 | 466 | //gl.glBegin(gl.GL_TRIANGLES); |
---|
465 | | - 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); |
---|
466 | 468 | if (!hasnorm) |
---|
467 | 469 | { |
---|
468 | 470 | // System.out.println("FUCK!!"); |
---|
.. | .. |
---|
1628 | 1630 | |
---|
1629 | 1631 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1630 | 1632 | |
---|
1631 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1633 | + float[] colorV = Grafreed.colorV; |
---|
1632 | 1634 | |
---|
1633 | 1635 | /**/ |
---|
1634 | 1636 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
1888 | 1890 | void PushMatrix(double[][] matrix) |
---|
1889 | 1891 | { |
---|
1890 | 1892 | // GrafreeD.tracein(matrix); |
---|
1891 | | - PushMatrix(matrix,1); |
---|
| 1893 | + PushMatrix(matrix, 1); |
---|
1892 | 1894 | } |
---|
1893 | 1895 | |
---|
1894 | 1896 | void PushMatrix() |
---|
.. | .. |
---|
2140 | 2142 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2141 | 2143 | |
---|
2142 | 2144 | if (!Globals.isLIVE()) // save sound |
---|
2143 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2145 | + Grafreed.savesound = true; // wav.save(); |
---|
2144 | 2146 | // else |
---|
2145 | 2147 | repaint(); // start loop // may 2013 |
---|
2146 | 2148 | } |
---|
.. | .. |
---|
2265 | 2267 | LOOKAT ^= true; |
---|
2266 | 2268 | } |
---|
2267 | 2269 | |
---|
2268 | | - void ToggleRandom() |
---|
| 2270 | + void ToggleSwitch() |
---|
2269 | 2271 | { |
---|
2270 | 2272 | SWITCH ^= true; |
---|
2271 | 2273 | } |
---|
.. | .. |
---|
2374 | 2376 | { |
---|
2375 | 2377 | return currentGL; |
---|
2376 | 2378 | } |
---|
2377 | | - |
---|
| 2379 | + |
---|
2378 | 2380 | /**/ |
---|
2379 | 2381 | class CacheTexture |
---|
2380 | 2382 | { |
---|
.. | .. |
---|
7919 | 7921 | ReleaseTexture(pigment, false); |
---|
7920 | 7922 | } |
---|
7921 | 7923 | |
---|
| 7924 | + public void ReleasePigmentTexture(cTexture tex) // INTERFACE |
---|
| 7925 | + { |
---|
| 7926 | + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
| 7927 | + { |
---|
| 7928 | + return; |
---|
| 7929 | + } |
---|
| 7930 | + |
---|
| 7931 | + if (tex == null) |
---|
| 7932 | + { |
---|
| 7933 | + ReleaseTexture(null, false); |
---|
| 7934 | + return; |
---|
| 7935 | + } |
---|
| 7936 | + |
---|
| 7937 | + String pigment = Object3D.GetPigment(tex); |
---|
| 7938 | + |
---|
| 7939 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7940 | + { |
---|
| 7941 | + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
| 7942 | + // System.out.println("; bump = " + bump); |
---|
| 7943 | + } |
---|
| 7944 | + |
---|
| 7945 | + if (pigment.equals("")) |
---|
| 7946 | + { |
---|
| 7947 | + pigment = null; |
---|
| 7948 | + } |
---|
| 7949 | + |
---|
| 7950 | + ReleaseTexture(pigment, false); |
---|
| 7951 | + } |
---|
| 7952 | + |
---|
| 7953 | + public void ReleaseBumpTexture(cTexture tex) // INTERFACE |
---|
| 7954 | + { |
---|
| 7955 | + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
| 7956 | + { |
---|
| 7957 | + return; |
---|
| 7958 | + } |
---|
| 7959 | + |
---|
| 7960 | + if (tex == null) |
---|
| 7961 | + { |
---|
| 7962 | + ReleaseTexture(null, true); |
---|
| 7963 | + return; |
---|
| 7964 | + } |
---|
| 7965 | + |
---|
| 7966 | + String bump = Object3D.GetBump(tex); |
---|
| 7967 | + |
---|
| 7968 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7969 | + { |
---|
| 7970 | + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
| 7971 | + // System.out.println("; bump = " + bump); |
---|
| 7972 | + } |
---|
| 7973 | + |
---|
| 7974 | + if (bump.equals("")) |
---|
| 7975 | + { |
---|
| 7976 | + bump = null; |
---|
| 7977 | + } |
---|
| 7978 | + |
---|
| 7979 | + ReleaseTexture(bump, true); |
---|
| 7980 | + } |
---|
| 7981 | + |
---|
7922 | 7982 | void ReleaseTexture(String tex, boolean bump) |
---|
7923 | 7983 | { |
---|
7924 | 7984 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
.. | .. |
---|
8022 | 8082 | } |
---|
8023 | 8083 | } |
---|
8024 | 8084 | |
---|
8025 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8085 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8026 | 8086 | { |
---|
8027 | 8087 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8028 | 8088 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8067 | 8127 | return; // true; |
---|
8068 | 8128 | } |
---|
8069 | 8129 | |
---|
8070 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8130 | + /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
| 8131 | + { |
---|
| 8132 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8133 | + ambientOcclusion ) // || !textureon) |
---|
| 8134 | + { |
---|
| 8135 | + return; // false; |
---|
| 8136 | + } |
---|
| 8137 | + |
---|
| 8138 | + if (tex == null) |
---|
| 8139 | + { |
---|
| 8140 | + BindTexture(null,false,resolution); |
---|
| 8141 | + return; |
---|
| 8142 | + } |
---|
| 8143 | + |
---|
| 8144 | + String pigment = Object3D.GetPigment(tex); |
---|
| 8145 | + |
---|
| 8146 | + usedtextures.put(pigment, pigment); |
---|
| 8147 | + |
---|
| 8148 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8149 | + { |
---|
| 8150 | + // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8151 | + // System.out.println("; bump = " + bump); |
---|
| 8152 | + } |
---|
| 8153 | + |
---|
| 8154 | + if (pigment.equals("")) |
---|
| 8155 | + { |
---|
| 8156 | + pigment = null; |
---|
| 8157 | + } |
---|
| 8158 | + |
---|
| 8159 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8160 | + BindTexture(pigment, false, resolution); |
---|
| 8161 | + } |
---|
| 8162 | + |
---|
| 8163 | + /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
| 8164 | + { |
---|
| 8165 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8166 | + ambientOcclusion ) // || !textureon) |
---|
| 8167 | + { |
---|
| 8168 | + return; // false; |
---|
| 8169 | + } |
---|
| 8170 | + |
---|
| 8171 | + if (tex == null) |
---|
| 8172 | + { |
---|
| 8173 | + BindTexture(null,true,resolution); |
---|
| 8174 | + return; |
---|
| 8175 | + } |
---|
| 8176 | + |
---|
| 8177 | + String bump = Object3D.GetBump(tex); |
---|
| 8178 | + |
---|
| 8179 | + usedtextures.put(bump, bump); |
---|
| 8180 | + |
---|
| 8181 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8182 | + { |
---|
| 8183 | + // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8184 | + // System.out.println("; bump = " + bump); |
---|
| 8185 | + } |
---|
| 8186 | + |
---|
| 8187 | + if (bump.equals("")) |
---|
| 8188 | + { |
---|
| 8189 | + bump = null; |
---|
| 8190 | + } |
---|
| 8191 | + |
---|
| 8192 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE2); |
---|
| 8193 | + BindTexture(bump, true, resolution); |
---|
| 8194 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8195 | + } |
---|
| 8196 | + |
---|
| 8197 | + java.util.HashSet<String> missingTextures = new java.util.HashSet<String>(); |
---|
| 8198 | + |
---|
| 8199 | + private boolean FileExists(String tex) |
---|
| 8200 | + { |
---|
| 8201 | + if (missingTextures.contains(tex)) |
---|
| 8202 | + { |
---|
| 8203 | + return false; |
---|
| 8204 | + } |
---|
| 8205 | + |
---|
| 8206 | + boolean fileExists = new File(tex).exists(); |
---|
| 8207 | + |
---|
| 8208 | + if (!fileExists) |
---|
| 8209 | + { |
---|
| 8210 | + // If file exists, the "new File()" is not executed sgain |
---|
| 8211 | + missingTextures.add(tex); |
---|
| 8212 | + } |
---|
| 8213 | + |
---|
| 8214 | + return fileExists; |
---|
| 8215 | + } |
---|
| 8216 | + |
---|
| 8217 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8071 | 8218 | { |
---|
8072 | 8219 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8073 | 8220 | |
---|
.. | .. |
---|
8075 | 8222 | { |
---|
8076 | 8223 | String texname = tex; |
---|
8077 | 8224 | |
---|
| 8225 | + String fallbackTextureName = defaultDirectory + "/Textures/" + texname; |
---|
| 8226 | + |
---|
8078 | 8227 | // String[] split = tex.split("Textures"); |
---|
8079 | 8228 | // if (split.length > 1) |
---|
8080 | 8229 | // texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8081 | 8230 | // else |
---|
8082 | 8231 | // if (!texname.startsWith("/")) |
---|
8083 | 8232 | // texname = "/Users/nbriere/Textures/" + texname; |
---|
8084 | | - if (!new File(tex).exists()) |
---|
| 8233 | + if (!FileExists(tex)) |
---|
8085 | 8234 | { |
---|
8086 | | - texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname; |
---|
| 8235 | + texname = fallbackTextureName; |
---|
8087 | 8236 | } |
---|
8088 | 8237 | |
---|
8089 | 8238 | if (CACHETEXTURE) |
---|
.. | .. |
---|
8153 | 8302 | } |
---|
8154 | 8303 | |
---|
8155 | 8304 | cachename = texname.substring(0, texname.length()-4)+ext+".jpg"; |
---|
8156 | | - if (!new File(cachename).exists()) |
---|
| 8305 | + if (!FileExists(cachename)) |
---|
8157 | 8306 | cachename = texname; |
---|
8158 | 8307 | else |
---|
8159 | 8308 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8175 | 8324 | } |
---|
8176 | 8325 | |
---|
8177 | 8326 | cachename = texname.substring(0, texname.length()-4)+ext+".png"; |
---|
8178 | | - if (!new File(cachename).exists()) |
---|
| 8327 | + if (!FileExists(cachename)) |
---|
8179 | 8328 | cachename = texname; |
---|
8180 | 8329 | else |
---|
8181 | 8330 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8184 | 8333 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8185 | 8334 | |
---|
8186 | 8335 | |
---|
8187 | | - if (texturedata != null) |
---|
| 8336 | + if (texturedata == null) |
---|
| 8337 | + throw new Exception(); |
---|
| 8338 | + |
---|
8188 | 8339 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8189 | 8340 | //texture = GetTexture(tex, bump); |
---|
8190 | 8341 | } |
---|
.. | .. |
---|
8306 | 8457 | return texture; |
---|
8307 | 8458 | } |
---|
8308 | 8459 | |
---|
8309 | | - com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) |
---|
| 8460 | + com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8310 | 8461 | { |
---|
8311 | 8462 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8312 | 8463 | |
---|
.. | .. |
---|
8324 | 8475 | return texture!=null?texture.texture:null; |
---|
8325 | 8476 | } |
---|
8326 | 8477 | |
---|
8327 | | - public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
| 8478 | + public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception |
---|
8328 | 8479 | { |
---|
8329 | 8480 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8330 | 8481 | |
---|
8331 | 8482 | return texture!=null?texture.texturedata:null; |
---|
8332 | 8483 | } |
---|
8333 | 8484 | |
---|
8334 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8485 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8335 | 8486 | { |
---|
8336 | 8487 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8337 | 8488 | { |
---|
.. | .. |
---|
9308 | 9459 | assert (parentcam != renderCamera); |
---|
9309 | 9460 | |
---|
9310 | 9461 | if (renderCamera != lightCamera) |
---|
9311 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9312 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 9462 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9463 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
9313 | 9464 | |
---|
9314 | 9465 | // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix); |
---|
9315 | 9466 | |
---|
.. | .. |
---|
9324 | 9475 | LA.matCopy(renderCamera.fromScreen, matrix); |
---|
9325 | 9476 | |
---|
9326 | 9477 | if (renderCamera != lightCamera) |
---|
9327 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9328 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 9478 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9479 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
9329 | 9480 | |
---|
9330 | 9481 | // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix); |
---|
9331 | 9482 | |
---|
.. | .. |
---|
9542 | 9693 | |
---|
9543 | 9694 | if (!BOXMODE) |
---|
9544 | 9695 | { |
---|
9545 | | - System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
| 9696 | + System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")"); |
---|
9546 | 9697 | } |
---|
9547 | 9698 | |
---|
9548 | 9699 | if (!BOXMODE) |
---|
.. | .. |
---|
9580 | 9731 | ABORTED = false; |
---|
9581 | 9732 | } |
---|
9582 | 9733 | else |
---|
9583 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9734 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9584 | 9735 | |
---|
9585 | 9736 | if (false) |
---|
9586 | 9737 | { |
---|
.. | .. |
---|
10243 | 10394 | |
---|
10244 | 10395 | public void display(GLAutoDrawable drawable) |
---|
10245 | 10396 | { |
---|
10246 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10397 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10247 | 10398 | { |
---|
10248 | | - GrafreeD.wav.save(); |
---|
10249 | | - GrafreeD.savesound = false; |
---|
10250 | | - GrafreeD.hassound = false; |
---|
| 10399 | + Grafreed.wav.save(); |
---|
| 10400 | + Grafreed.savesound = false; |
---|
| 10401 | + Grafreed.hassound = false; |
---|
10251 | 10402 | } |
---|
10252 | 10403 | // if (DEBUG_SELECTION) |
---|
10253 | 10404 | // { |
---|
.. | .. |
---|
10377 | 10528 | Object3D theobject = object; |
---|
10378 | 10529 | Object3D theparent = object.parent; |
---|
10379 | 10530 | object.parent = null; |
---|
10380 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10531 | + object = (Object3D)Grafreed.clone(object); |
---|
10381 | 10532 | object.Stripify(); |
---|
10382 | 10533 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10383 | 10534 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
10390 | 10541 | ambientOcclusion = false; |
---|
10391 | 10542 | } |
---|
10392 | 10543 | |
---|
10393 | | - if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN) |
---|
| 10544 | + if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10394 | 10545 | { |
---|
10395 | 10546 | //if (RENDERSHADOW) // ? |
---|
10396 | 10547 | if (!IsFrozen()) |
---|
10397 | 10548 | { |
---|
10398 | 10549 | // dec 2012 |
---|
10399 | | - if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
| 10550 | + if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
10400 | 10551 | { |
---|
10401 | 10552 | Globals.framecount++; |
---|
10402 | 10553 | shadowbuffer.display(); |
---|
.. | .. |
---|
10523 | 10674 | |
---|
10524 | 10675 | // if (parentcam != renderCamera) // not a light |
---|
10525 | 10676 | if (cam != lightCamera) |
---|
10526 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10527 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 10677 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10678 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
10528 | 10679 | |
---|
10529 | 10680 | for (int j = 0; j < 4; j++) |
---|
10530 | 10681 | { |
---|
.. | .. |
---|
10538 | 10689 | |
---|
10539 | 10690 | // if (parentcam != renderCamera) // not a light |
---|
10540 | 10691 | if (cam != lightCamera) |
---|
10541 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10542 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 10692 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10693 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
10543 | 10694 | |
---|
10544 | 10695 | //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix); |
---|
10545 | 10696 | |
---|
.. | .. |
---|
10798 | 10949 | // Bump noise |
---|
10799 | 10950 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10800 | 10951 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10801 | | - BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10952 | + |
---|
| 10953 | + try |
---|
| 10954 | + { |
---|
| 10955 | + BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10956 | + } |
---|
| 10957 | + catch (Exception e) |
---|
| 10958 | + { |
---|
| 10959 | + System.err.println("FAILED: " + NOISE_TEXTURE); |
---|
| 10960 | + } |
---|
| 10961 | + |
---|
10802 | 10962 | |
---|
10803 | 10963 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10804 | 10964 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
10923 | 11083 | System.err.println("parentcam != renderCamera"); |
---|
10924 | 11084 | |
---|
10925 | 11085 | // if (cam != lightCamera) |
---|
10926 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10927 | | - LA.xformDir(lightposition, parentcam.toParent, lightposition); // may 2013 |
---|
| 11086 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 11087 | + LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013 |
---|
10928 | 11088 | } |
---|
10929 | 11089 | |
---|
10930 | 11090 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
10945 | 11105 | if (true) // TODO |
---|
10946 | 11106 | { |
---|
10947 | 11107 | if (cam != lightCamera) |
---|
10948 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10949 | | - LA.xformDir(light0, parentcam.toParent, light0); // may 2013 |
---|
| 11108 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 11109 | + LA.xformDir(light0, parentcam.GlobalTransform(), light0); // may 2013 |
---|
10950 | 11110 | } |
---|
10951 | 11111 | |
---|
10952 | 11112 | LA.xformPos(light0, cam.toScreen, light0); |
---|
.. | .. |
---|
11283 | 11443 | e.printStackTrace(); |
---|
11284 | 11444 | } |
---|
11285 | 11445 | |
---|
11286 | | - if (GrafreeD.RENDERME > 0) |
---|
11287 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11446 | + if (Grafreed.RENDERME > 0) |
---|
| 11447 | + Grafreed.RENDERME--; // mechante magouille |
---|
11288 | 11448 | |
---|
11289 | 11449 | Globals.ONESTEP = false; |
---|
11290 | 11450 | } |
---|
.. | .. |
---|
11354 | 11514 | |
---|
11355 | 11515 | usedtextures.clear(); |
---|
11356 | 11516 | |
---|
11357 | | - BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11517 | + try |
---|
| 11518 | + { |
---|
| 11519 | + BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11520 | + } |
---|
| 11521 | + catch (Exception e) |
---|
| 11522 | + { |
---|
| 11523 | + System.err.println("FAILED: " + DEFAULT_TEXTURES); |
---|
| 11524 | + } |
---|
11358 | 11525 | } |
---|
11359 | 11526 | //System.out.println("--> " + stackdepth); |
---|
11360 | 11527 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11445 | 11612 | if (checker != null && DrawMode() == DEFAULT) |
---|
11446 | 11613 | { |
---|
11447 | 11614 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11448 | | - BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11615 | + try |
---|
| 11616 | + { |
---|
| 11617 | + BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11618 | + } |
---|
| 11619 | + catch (Exception e) |
---|
| 11620 | + { |
---|
| 11621 | + System.err.println("FAILED: " + checker.GetTextures()); |
---|
| 11622 | + } |
---|
11449 | 11623 | // NEAREST |
---|
11450 | 11624 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11451 | 11625 | DrawChecker(gl); |
---|
.. | .. |
---|
11527 | 11701 | return; |
---|
11528 | 11702 | } |
---|
11529 | 11703 | |
---|
11530 | | - String string = obj.GetToolTip(); |
---|
| 11704 | + String string = obj.toString(); //.GetToolTip(); |
---|
11531 | 11705 | |
---|
11532 | 11706 | GL gl = GetGL(); |
---|
11533 | 11707 | |
---|
.. | .. |
---|
11844 | 12018 | //obj.TransformToWorld(light, light); |
---|
11845 | 12019 | for (int i = tp.size(); --i >= 0;) |
---|
11846 | 12020 | { |
---|
11847 | | - for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
11848 | | - LA.xformPos(light, tp.get(i).toParent, light); |
---|
| 12021 | + //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
| 12022 | + LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
11849 | 12023 | } |
---|
11850 | 12024 | |
---|
11851 | 12025 | |
---|
.. | .. |
---|
11862 | 12036 | parentcam = cameras[0]; |
---|
11863 | 12037 | } |
---|
11864 | 12038 | |
---|
11865 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
11866 | | - LA.xformPos(light, parentcam.toParent, light); // may 2013 |
---|
| 12039 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 12040 | + LA.xformPos(light, parentcam.GlobalTransform(), light); // may 2013 |
---|
11867 | 12041 | |
---|
11868 | 12042 | LA.xformPos(light, renderCamera.toScreen, light); |
---|
11869 | 12043 | |
---|
.. | .. |
---|
12477 | 12651 | |
---|
12478 | 12652 | // display shadow only (bump == 0) |
---|
12479 | 12653 | "SUB temp.x, half.x, shadow.x;" + |
---|
12480 | | - "MOV temp.y, -params6.x;" + |
---|
12481 | | - "SLT temp.z, temp.y, zero.x;" + |
---|
| 12654 | + "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
| 12655 | + "SLT temp.z, temp.y, -one2048th.x;" + |
---|
12482 | 12656 | "SUB temp.y, one.x, temp.z;" + |
---|
12483 | 12657 | "MUL temp.x, temp.x, temp.y;" + |
---|
12484 | 12658 | "KIL temp.x;" + |
---|
.. | .. |
---|
12809 | 12983 | //once = true; |
---|
12810 | 12984 | } |
---|
12811 | 12985 | |
---|
12812 | | - System.out.print("Program #" + mode + "; length = " + program.length()); |
---|
| 12986 | + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
12813 | 12987 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
12814 | 12988 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
12815 | 12989 | |
---|
.. | .. |
---|
12942 | 13116 | |
---|
12943 | 13117 | "ADD " + depth + ".z, " + depth + ".z, temp.x;" + |
---|
12944 | 13118 | //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing! |
---|
| 13119 | + |
---|
| 13120 | + // Compare fragment depth in light space with shadowmap. |
---|
12945 | 13121 | "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
12946 | 13122 | "SGE temp.y, temp.x, zero.x;" + |
---|
12947 | | - "SUB " + shadow + ".y, one.x, temp.y;" + |
---|
| 13123 | + "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded |
---|
| 13124 | + |
---|
| 13125 | + // Reverse comparison |
---|
12948 | 13126 | "SUB temp.x, one.x, temp.x;" + |
---|
12949 | 13127 | "MUL " + shadow + ".x, temp.x, temp.y;" + |
---|
12950 | | - "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded |
---|
| 13128 | + "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse |
---|
12951 | 13129 | "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth |
---|
12952 | 13130 | |
---|
12953 | 13131 | "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
.. | .. |
---|
12961 | 13139 | // No shadow for backface |
---|
12962 | 13140 | "DP3 temp.x, normal, lightd;" + |
---|
12963 | 13141 | "SLT temp.x, temp.x, zero.x;" + // shadoweps |
---|
| 13142 | + "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
| 13143 | + |
---|
| 13144 | + // No shadow when out of frustrum |
---|
| 13145 | + "SGE temp.x, " + depth + ".z, one.z;" + |
---|
12964 | 13146 | "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
12965 | 13147 | ""; |
---|
12966 | 13148 | } |
---|
.. | .. |
---|
13519 | 13701 | public void mousePressed(MouseEvent e) |
---|
13520 | 13702 | { |
---|
13521 | 13703 | //System.out.println("mousePressed: " + e); |
---|
13522 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13704 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13523 | 13705 | } |
---|
13524 | 13706 | |
---|
13525 | 13707 | static long prevtime = 0; |
---|
.. | .. |
---|
13595 | 13777 | // mode |= META; |
---|
13596 | 13778 | //} |
---|
13597 | 13779 | |
---|
13598 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13599 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13780 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13781 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13600 | 13782 | anchorX = ax; |
---|
13601 | 13783 | anchorY = ay; |
---|
13602 | 13784 | prevX = px; |
---|
.. | .. |
---|
13656 | 13838 | // wasliveok = true; |
---|
13657 | 13839 | // waslive = false; |
---|
13658 | 13840 | |
---|
| 13841 | + // May 2019 Forget it: |
---|
| 13842 | + if (true) |
---|
| 13843 | + return; |
---|
| 13844 | + |
---|
13659 | 13845 | // source == timer |
---|
13660 | 13846 | if (mouseDown) |
---|
13661 | 13847 | { |
---|
.. | .. |
---|
13694 | 13880 | |
---|
13695 | 13881 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13696 | 13882 | |
---|
13697 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13883 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13698 | 13884 | { |
---|
13699 | 13885 | if (!wasliveok) |
---|
13700 | 13886 | return; |
---|
.. | .. |
---|
13711 | 13897 | // touched = true; // main DL |
---|
13712 | 13898 | if (isRenderer) |
---|
13713 | 13899 | { |
---|
13714 | | - SetMouseMode(modifiers); |
---|
| 13900 | + SetMouseMode(modifiers, modifiersex); |
---|
13715 | 13901 | } |
---|
13716 | 13902 | |
---|
13717 | 13903 | selectX = anchorX = x; |
---|
.. | .. |
---|
13724 | 13910 | clicked = true; |
---|
13725 | 13911 | hold = false; |
---|
13726 | 13912 | |
---|
13727 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13913 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13728 | 13914 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13729 | 13915 | { |
---|
13730 | 13916 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13755 | 13941 | info.camera = renderCamera; |
---|
13756 | 13942 | info.x = x; |
---|
13757 | 13943 | info.y = y; |
---|
13758 | | - info.modifiers = modifiers; |
---|
| 13944 | + info.modifiers = modifiersex; |
---|
13759 | 13945 | editObj = object.doEditClick(info, 0); |
---|
13760 | 13946 | if (!editObj) |
---|
13761 | 13947 | { |
---|
.. | .. |
---|
13772 | 13958 | |
---|
13773 | 13959 | public void mouseDragged(MouseEvent e) |
---|
13774 | 13960 | { |
---|
| 13961 | + Globals.MOUSEDRAGGED = true; |
---|
| 13962 | + |
---|
13775 | 13963 | //System.out.println("mouseDragged: " + e); |
---|
13776 | 13964 | if (isRenderer) |
---|
13777 | 13965 | movingcamera = true; |
---|
| 13966 | + |
---|
13778 | 13967 | //if (drawing) |
---|
13779 | 13968 | //return; |
---|
13780 | 13969 | if ((e.getModifiersEx() & CTRL) != 0 |
---|
.. | .. |
---|
13784 | 13973 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13785 | 13974 | } |
---|
13786 | 13975 | else |
---|
13787 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13976 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13788 | 13977 | |
---|
13789 | 13978 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13790 | 13979 | } |
---|
.. | .. |
---|
14021 | 14210 | { |
---|
14022 | 14211 | Globals.lighttouched = true; |
---|
14023 | 14212 | } |
---|
14024 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14213 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14025 | 14214 | } |
---|
14026 | 14215 | //else |
---|
14027 | 14216 | } |
---|
.. | .. |
---|
14121 | 14310 | int X, Y; |
---|
14122 | 14311 | boolean SX, SY; |
---|
14123 | 14312 | |
---|
14124 | | - void drag(int x, int y, int modifiers) |
---|
| 14313 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14125 | 14314 | { |
---|
14126 | 14315 | if (IsFrozen()) |
---|
14127 | 14316 | { |
---|
.. | .. |
---|
14130 | 14319 | |
---|
14131 | 14320 | drag = true; // NEW |
---|
14132 | 14321 | |
---|
14133 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14322 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14134 | 14323 | |
---|
14135 | 14324 | X = x; |
---|
14136 | 14325 | Y = y; |
---|
14137 | 14326 | // floating state for animation |
---|
14138 | | - MODIFIERS = modifiers; |
---|
14139 | | - modifiers &= ~1024; |
---|
| 14327 | + MODIFIERS = modifiersex; |
---|
| 14328 | + modifiersex &= ~1024; |
---|
14140 | 14329 | if (false) // modifiers != 0) |
---|
14141 | 14330 | { |
---|
14142 | 14331 | //new Exception().printStackTrace(); |
---|
14143 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14332 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14144 | 14333 | System.out.println("SHIFT = " + SHIFT); |
---|
14145 | 14334 | System.out.println("CONTROL = " + COMMAND); |
---|
14146 | 14335 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14160 | 14349 | info.camera = renderCamera; |
---|
14161 | 14350 | info.x = x; |
---|
14162 | 14351 | info.y = y; |
---|
14163 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14352 | + object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14164 | 14353 | } else |
---|
14165 | 14354 | { |
---|
14166 | 14355 | if (x < startX) |
---|
.. | .. |
---|
14336 | 14525 | |
---|
14337 | 14526 | public void mouseReleased(MouseEvent e) |
---|
14338 | 14527 | { |
---|
| 14528 | + Globals.MOUSEDRAGGED = false; |
---|
| 14529 | + |
---|
14339 | 14530 | movingcamera = false; |
---|
| 14531 | + X = Y = 0; |
---|
14340 | 14532 | //System.out.println("mouseReleased: " + e); |
---|
14341 | 14533 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14342 | 14534 | } |
---|
.. | .. |
---|
14359 | 14551 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14360 | 14552 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14361 | 14553 | |
---|
14362 | | - if (control || command || IsFrozen()) |
---|
| 14554 | +// No delay if (control || command || IsFrozen()) |
---|
14363 | 14555 | timeout = true; |
---|
14364 | | - else |
---|
| 14556 | +// ?? May 2019 else |
---|
14365 | 14557 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14366 | 14558 | mouseDown = false; |
---|
14367 | 14559 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14471 | 14663 | System.out.println("keyReleased: " + e); |
---|
14472 | 14664 | } |
---|
14473 | 14665 | |
---|
14474 | | - void SetMouseMode(int modifiers) |
---|
| 14666 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14475 | 14667 | { |
---|
14476 | 14668 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14477 | 14669 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14483 | 14675 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14484 | 14676 | // return; |
---|
14485 | 14677 | //System.out.println("SetMode = " + modifiers); |
---|
14486 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14678 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14487 | 14679 | { |
---|
14488 | 14680 | mouseMode |= ZOOM; |
---|
14489 | 14681 | } |
---|
.. | .. |
---|
14493 | 14685 | { |
---|
14494 | 14686 | mouseMode |= VR; // BACKFORTH; |
---|
14495 | 14687 | } |
---|
14496 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14688 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14497 | 14689 | { |
---|
14498 | 14690 | mouseMode |= SELECT; |
---|
14499 | 14691 | } |
---|
14500 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14692 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14501 | 14693 | { |
---|
14502 | 14694 | mouseMode |= SELECT; |
---|
14503 | 14695 | } |
---|
14504 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14696 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14505 | 14697 | { |
---|
14506 | 14698 | mouseMode &= ~VR; |
---|
14507 | 14699 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14530 | 14722 | |
---|
14531 | 14723 | if (isRenderer) // |
---|
14532 | 14724 | { |
---|
14533 | | - SetMouseMode(modifiers); |
---|
| 14725 | + SetMouseMode(0, modifiers); |
---|
14534 | 14726 | } |
---|
14535 | 14727 | |
---|
14536 | 14728 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14866 | 15058 | //RESIZETEXTURE ^= true; |
---|
14867 | 15059 | //break; |
---|
14868 | 15060 | case 'z': |
---|
14869 | | - RENDERSHADOW ^= true; |
---|
| 15061 | + Globals.RENDERSHADOW ^= true; |
---|
14870 | 15062 | Globals.lighttouched = true; |
---|
14871 | 15063 | repaint(); |
---|
14872 | 15064 | break; |
---|
.. | .. |
---|
14990 | 15182 | //mode = ROTATE; |
---|
14991 | 15183 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14992 | 15184 | { |
---|
14993 | | - SetMouseMode(modifiers); |
---|
| 15185 | + SetMouseMode(0, modifiers); |
---|
14994 | 15186 | } |
---|
14995 | 15187 | } |
---|
14996 | 15188 | |
---|
.. | .. |
---|
15345 | 15537 | info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom)); |
---|
15346 | 15538 | //Image img = CreateImage(width, height); |
---|
15347 | 15539 | //System.out.println("width = " + width + "; height = " + height + "\n"); |
---|
| 15540 | + |
---|
15348 | 15541 | Graphics gr = g; // img.getGraphics(); |
---|
| 15542 | + |
---|
15349 | 15543 | if (!hasMarquee) |
---|
15350 | 15544 | { |
---|
15351 | 15545 | if (Xmin < Xmax) // !locked) |
---|
.. | .. |
---|
15443 | 15637 | if (!isRenderer) |
---|
15444 | 15638 | { |
---|
15445 | 15639 | object.drawEditHandles(info, 0); |
---|
| 15640 | + |
---|
| 15641 | + if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15642 | + { |
---|
| 15643 | + switch (object.selection.get(0).hitSomething) |
---|
| 15644 | + { |
---|
| 15645 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15646 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15647 | + break; |
---|
| 15648 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15649 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15650 | + break; |
---|
| 15651 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15652 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15653 | + break; |
---|
| 15654 | + } |
---|
| 15655 | + |
---|
| 15656 | + } |
---|
15446 | 15657 | } |
---|
15447 | 15658 | } |
---|
| 15659 | + |
---|
15448 | 15660 | if (isRenderer) |
---|
15449 | 15661 | { |
---|
15450 | 15662 | //gr.setColor(Color.black); |
---|
15451 | 15663 | //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1); |
---|
15452 | 15664 | //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3); |
---|
15453 | 15665 | } |
---|
| 15666 | + |
---|
15454 | 15667 | if (hasMarquee) |
---|
15455 | 15668 | { |
---|
15456 | 15669 | gr.setXORMode(Color.white); |
---|
.. | .. |
---|
15563 | 15776 | public boolean mouseDown(Event evt, int x, int y) |
---|
15564 | 15777 | { |
---|
15565 | 15778 | System.out.println("mouseDown: " + evt); |
---|
| 15779 | + System.exit(0); |
---|
15566 | 15780 | /* |
---|
15567 | 15781 | locked = true; |
---|
15568 | 15782 | drag = false; |
---|
.. | .. |
---|
15606 | 15820 | { |
---|
15607 | 15821 | keyPressed(0, modifiers); |
---|
15608 | 15822 | } |
---|
15609 | | - clickStart(x, y, modifiers); |
---|
| 15823 | + // clickStart(x, y, modifiers); |
---|
15610 | 15824 | return true; |
---|
15611 | 15825 | } |
---|
15612 | 15826 | |
---|
.. | .. |
---|
15724 | 15938 | { |
---|
15725 | 15939 | keyReleased(0, 0); |
---|
15726 | 15940 | } |
---|
15727 | | - drag(x, y, modifiers); |
---|
| 15941 | + drag(x, y, 0, modifiers); |
---|
15728 | 15942 | return true; |
---|
15729 | 15943 | } |
---|
15730 | 15944 | |
---|
.. | .. |
---|
15856 | 16070 | Object3D object; |
---|
15857 | 16071 | static Object3D trackedobject; |
---|
15858 | 16072 | Camera renderCamera; // Light or Eye (or Occlusion) |
---|
15859 | | - /*static*/ Camera manipCamera; // Light or Eye |
---|
| 16073 | + /*static*/ Camera manipCamera; // Light or Eye. Can be Light when Eye, not Eye when Light |
---|
15860 | 16074 | /*static*/ Camera eyeCamera; |
---|
15861 | 16075 | /*static*/ Camera lightCamera; |
---|
15862 | 16076 | int cameracount; |
---|
.. | .. |
---|
16422 | 16636 | 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])); |
---|
16423 | 16637 | } |
---|
16424 | 16638 | |
---|
16425 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16639 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16426 | 16640 | } |
---|
16427 | 16641 | } |
---|
16428 | 16642 | |
---|
16429 | 16643 | if (!movingcamera && !PAINTMODE) |
---|
16430 | 16644 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16431 | 16645 | |
---|
16432 | | - if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16646 | + if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16433 | 16647 | { |
---|
16434 | | - Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16648 | + Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16435 | 16649 | |
---|
16436 | 16650 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16437 | 16651 | |
---|
.. | .. |
---|
16587 | 16801 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16588 | 16802 | } |
---|
16589 | 16803 | |
---|
16590 | | - if (!RENDERSHADOW) |
---|
| 16804 | + if (!Globals.RENDERSHADOW) |
---|
16591 | 16805 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16592 | 16806 | |
---|
16593 | 16807 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16597 | 16811 | //gl.glColorMask(false, false, false, false); |
---|
16598 | 16812 | |
---|
16599 | 16813 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16600 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16814 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16601 | 16815 | { |
---|
16602 | 16816 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16603 | 16817 | |
---|