.. | .. |
---|
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!!"); |
---|
.. | .. |
---|
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() |
---|
.. | .. |
---|
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 | { |
---|
.. | .. |
---|
8022 | 8024 | } |
---|
8023 | 8025 | } |
---|
8024 | 8026 | |
---|
8025 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8027 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8026 | 8028 | { |
---|
8027 | 8029 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8028 | 8030 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8067 | 8069 | return; // true; |
---|
8068 | 8070 | } |
---|
8069 | 8071 | |
---|
8070 | | - 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 |
---|
8071 | 8093 | { |
---|
8072 | 8094 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8073 | 8095 | |
---|
.. | .. |
---|
8075 | 8097 | { |
---|
8076 | 8098 | String texname = tex; |
---|
8077 | 8099 | |
---|
| 8100 | + String fallbackTextureName = defaultDirectory + "/Textures/" + texname; |
---|
| 8101 | + |
---|
8078 | 8102 | // String[] split = tex.split("Textures"); |
---|
8079 | 8103 | // if (split.length > 1) |
---|
8080 | 8104 | // texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8081 | 8105 | // else |
---|
8082 | 8106 | // if (!texname.startsWith("/")) |
---|
8083 | 8107 | // texname = "/Users/nbriere/Textures/" + texname; |
---|
8084 | | - if (!new File(tex).exists()) |
---|
| 8108 | + if (!FileExists(tex)) |
---|
8085 | 8109 | { |
---|
8086 | | - texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname; |
---|
| 8110 | + texname = fallbackTextureName; |
---|
8087 | 8111 | } |
---|
8088 | 8112 | |
---|
8089 | 8113 | if (CACHETEXTURE) |
---|
.. | .. |
---|
8153 | 8177 | } |
---|
8154 | 8178 | |
---|
8155 | 8179 | cachename = texname.substring(0, texname.length()-4)+ext+".jpg"; |
---|
8156 | | - if (!new File(cachename).exists()) |
---|
| 8180 | + if (!FileExists(cachename)) |
---|
8157 | 8181 | cachename = texname; |
---|
8158 | 8182 | else |
---|
8159 | 8183 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8175 | 8199 | } |
---|
8176 | 8200 | |
---|
8177 | 8201 | cachename = texname.substring(0, texname.length()-4)+ext+".png"; |
---|
8178 | | - if (!new File(cachename).exists()) |
---|
| 8202 | + if (!FileExists(cachename)) |
---|
8179 | 8203 | cachename = texname; |
---|
8180 | 8204 | else |
---|
8181 | 8205 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8184 | 8208 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8185 | 8209 | |
---|
8186 | 8210 | |
---|
8187 | | - if (texturedata != null) |
---|
| 8211 | + if (texturedata == null) |
---|
| 8212 | + throw new Exception(); |
---|
| 8213 | + |
---|
8188 | 8214 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8189 | 8215 | //texture = GetTexture(tex, bump); |
---|
8190 | 8216 | } |
---|
.. | .. |
---|
8306 | 8332 | return texture; |
---|
8307 | 8333 | } |
---|
8308 | 8334 | |
---|
8309 | | - 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 |
---|
8310 | 8336 | { |
---|
8311 | 8337 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8312 | 8338 | |
---|
.. | .. |
---|
8324 | 8350 | return texture!=null?texture.texture:null; |
---|
8325 | 8351 | } |
---|
8326 | 8352 | |
---|
8327 | | - 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 |
---|
8328 | 8354 | { |
---|
8329 | 8355 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8330 | 8356 | |
---|
8331 | 8357 | return texture!=null?texture.texturedata:null; |
---|
8332 | 8358 | } |
---|
8333 | 8359 | |
---|
8334 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8360 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8335 | 8361 | { |
---|
8336 | 8362 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8337 | 8363 | { |
---|
.. | .. |
---|
9308 | 9334 | assert (parentcam != renderCamera); |
---|
9309 | 9335 | |
---|
9310 | 9336 | if (renderCamera != lightCamera) |
---|
9311 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9312 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 9337 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9338 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
9313 | 9339 | |
---|
9314 | 9340 | // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix); |
---|
9315 | 9341 | |
---|
.. | .. |
---|
9324 | 9350 | LA.matCopy(renderCamera.fromScreen, matrix); |
---|
9325 | 9351 | |
---|
9326 | 9352 | if (renderCamera != lightCamera) |
---|
9327 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9328 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 9353 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9354 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
9329 | 9355 | |
---|
9330 | 9356 | // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix); |
---|
9331 | 9357 | |
---|
.. | .. |
---|
10390 | 10416 | ambientOcclusion = false; |
---|
10391 | 10417 | } |
---|
10392 | 10418 | |
---|
10393 | | - if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN) |
---|
| 10419 | + if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10394 | 10420 | { |
---|
10395 | 10421 | //if (RENDERSHADOW) // ? |
---|
10396 | 10422 | if (!IsFrozen()) |
---|
10397 | 10423 | { |
---|
10398 | 10424 | // dec 2012 |
---|
10399 | | - if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
| 10425 | + if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
10400 | 10426 | { |
---|
10401 | 10427 | Globals.framecount++; |
---|
10402 | 10428 | shadowbuffer.display(); |
---|
.. | .. |
---|
10523 | 10549 | |
---|
10524 | 10550 | // if (parentcam != renderCamera) // not a light |
---|
10525 | 10551 | if (cam != lightCamera) |
---|
10526 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10527 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 10552 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10553 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
10528 | 10554 | |
---|
10529 | 10555 | for (int j = 0; j < 4; j++) |
---|
10530 | 10556 | { |
---|
.. | .. |
---|
10538 | 10564 | |
---|
10539 | 10565 | // if (parentcam != renderCamera) // not a light |
---|
10540 | 10566 | if (cam != lightCamera) |
---|
10541 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10542 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 10567 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10568 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
10543 | 10569 | |
---|
10544 | 10570 | //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix); |
---|
10545 | 10571 | |
---|
.. | .. |
---|
10798 | 10824 | // Bump noise |
---|
10799 | 10825 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10800 | 10826 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10801 | | - 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 | + |
---|
10802 | 10837 | |
---|
10803 | 10838 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10804 | 10839 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
10923 | 10958 | System.err.println("parentcam != renderCamera"); |
---|
10924 | 10959 | |
---|
10925 | 10960 | // if (cam != lightCamera) |
---|
10926 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10927 | | - 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 |
---|
10928 | 10963 | } |
---|
10929 | 10964 | |
---|
10930 | 10965 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
10945 | 10980 | if (true) // TODO |
---|
10946 | 10981 | { |
---|
10947 | 10982 | if (cam != lightCamera) |
---|
10948 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10949 | | - 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 |
---|
10950 | 10985 | } |
---|
10951 | 10986 | |
---|
10952 | 10987 | LA.xformPos(light0, cam.toScreen, light0); |
---|
.. | .. |
---|
11354 | 11389 | |
---|
11355 | 11390 | usedtextures.clear(); |
---|
11356 | 11391 | |
---|
11357 | | - 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 | + } |
---|
11358 | 11400 | } |
---|
11359 | 11401 | //System.out.println("--> " + stackdepth); |
---|
11360 | 11402 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11445 | 11487 | if (checker != null && DrawMode() == DEFAULT) |
---|
11446 | 11488 | { |
---|
11447 | 11489 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11448 | | - 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 | + } |
---|
11449 | 11498 | // NEAREST |
---|
11450 | 11499 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11451 | 11500 | DrawChecker(gl); |
---|
.. | .. |
---|
11527 | 11576 | return; |
---|
11528 | 11577 | } |
---|
11529 | 11578 | |
---|
11530 | | - String string = obj.GetToolTip(); |
---|
| 11579 | + String string = obj.toString(); //.GetToolTip(); |
---|
11531 | 11580 | |
---|
11532 | 11581 | GL gl = GetGL(); |
---|
11533 | 11582 | |
---|
.. | .. |
---|
11844 | 11893 | //obj.TransformToWorld(light, light); |
---|
11845 | 11894 | for (int i = tp.size(); --i >= 0;) |
---|
11846 | 11895 | { |
---|
11847 | | - for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
11848 | | - 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); |
---|
11849 | 11898 | } |
---|
11850 | 11899 | |
---|
11851 | 11900 | |
---|
.. | .. |
---|
11862 | 11911 | parentcam = cameras[0]; |
---|
11863 | 11912 | } |
---|
11864 | 11913 | |
---|
11865 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
11866 | | - 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 |
---|
11867 | 11916 | |
---|
11868 | 11917 | LA.xformPos(light, renderCamera.toScreen, light); |
---|
11869 | 11918 | |
---|
.. | .. |
---|
12477 | 12526 | |
---|
12478 | 12527 | // display shadow only (bump == 0) |
---|
12479 | 12528 | "SUB temp.x, half.x, shadow.x;" + |
---|
12480 | | - "MOV temp.y, -params6.x;" + |
---|
12481 | | - "SLT temp.z, temp.y, zero.x;" + |
---|
| 12529 | + "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
| 12530 | + "SLT temp.z, temp.y, -one2048th.x;" + |
---|
12482 | 12531 | "SUB temp.y, one.x, temp.z;" + |
---|
12483 | 12532 | "MUL temp.x, temp.x, temp.y;" + |
---|
12484 | 12533 | "KIL temp.x;" + |
---|
.. | .. |
---|
12809 | 12858 | //once = true; |
---|
12810 | 12859 | } |
---|
12811 | 12860 | |
---|
12812 | | - System.out.print("Program #" + mode + "; length = " + program.length()); |
---|
| 12861 | + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
12813 | 12862 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
12814 | 12863 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
12815 | 12864 | |
---|
.. | .. |
---|
12942 | 12991 | |
---|
12943 | 12992 | "ADD " + depth + ".z, " + depth + ".z, temp.x;" + |
---|
12944 | 12993 | //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing! |
---|
| 12994 | + |
---|
| 12995 | + // Compare fragment depth in light space with shadowmap. |
---|
12945 | 12996 | "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
12946 | 12997 | "SGE temp.y, temp.x, zero.x;" + |
---|
12947 | | - "SUB " + shadow + ".y, one.x, temp.y;" + |
---|
| 12998 | + "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded |
---|
| 12999 | + |
---|
| 13000 | + // Reverse comparison |
---|
12948 | 13001 | "SUB temp.x, one.x, temp.x;" + |
---|
12949 | 13002 | "MUL " + shadow + ".x, temp.x, temp.y;" + |
---|
12950 | | - "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded |
---|
| 13003 | + "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse |
---|
12951 | 13004 | "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth |
---|
12952 | 13005 | |
---|
12953 | 13006 | "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
.. | .. |
---|
12961 | 13014 | // No shadow for backface |
---|
12962 | 13015 | "DP3 temp.x, normal, lightd;" + |
---|
12963 | 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;" + |
---|
12964 | 13021 | "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
12965 | 13022 | ""; |
---|
12966 | 13023 | } |
---|
.. | .. |
---|
13776 | 13833 | |
---|
13777 | 13834 | public void mouseDragged(MouseEvent e) |
---|
13778 | 13835 | { |
---|
| 13836 | + Globals.MOUSEDRAGGED = true; |
---|
| 13837 | + |
---|
13779 | 13838 | //System.out.println("mouseDragged: " + e); |
---|
13780 | 13839 | if (isRenderer) |
---|
13781 | 13840 | movingcamera = true; |
---|
| 13841 | + |
---|
13782 | 13842 | //if (drawing) |
---|
13783 | 13843 | //return; |
---|
13784 | 13844 | if ((e.getModifiersEx() & CTRL) != 0 |
---|
.. | .. |
---|
14340 | 14400 | |
---|
14341 | 14401 | public void mouseReleased(MouseEvent e) |
---|
14342 | 14402 | { |
---|
| 14403 | + Globals.MOUSEDRAGGED = false; |
---|
| 14404 | + |
---|
14343 | 14405 | movingcamera = false; |
---|
| 14406 | + X = Y = 0; |
---|
14344 | 14407 | //System.out.println("mouseReleased: " + e); |
---|
14345 | 14408 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14346 | 14409 | } |
---|
.. | .. |
---|
15349 | 15412 | info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom)); |
---|
15350 | 15413 | //Image img = CreateImage(width, height); |
---|
15351 | 15414 | //System.out.println("width = " + width + "; height = " + height + "\n"); |
---|
| 15415 | + |
---|
15352 | 15416 | Graphics gr = g; // img.getGraphics(); |
---|
| 15417 | + |
---|
15353 | 15418 | if (!hasMarquee) |
---|
15354 | 15419 | { |
---|
15355 | 15420 | if (Xmin < Xmax) // !locked) |
---|
.. | .. |
---|
15447 | 15512 | if (!isRenderer) |
---|
15448 | 15513 | { |
---|
15449 | 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 | + } |
---|
15450 | 15532 | } |
---|
15451 | 15533 | } |
---|
| 15534 | + |
---|
15452 | 15535 | if (isRenderer) |
---|
15453 | 15536 | { |
---|
15454 | 15537 | //gr.setColor(Color.black); |
---|
15455 | 15538 | //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1); |
---|
15456 | 15539 | //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3); |
---|
15457 | 15540 | } |
---|
| 15541 | + |
---|
15458 | 15542 | if (hasMarquee) |
---|
15459 | 15543 | { |
---|
15460 | 15544 | gr.setXORMode(Color.white); |
---|
.. | .. |
---|
15861 | 15945 | Object3D object; |
---|
15862 | 15946 | static Object3D trackedobject; |
---|
15863 | 15947 | Camera renderCamera; // Light or Eye (or Occlusion) |
---|
15864 | | - /*static*/ Camera manipCamera; // Light or Eye |
---|
| 15948 | + /*static*/ Camera manipCamera; // Light or Eye. Can be Light when Eye, not Eye when Light |
---|
15865 | 15949 | /*static*/ Camera eyeCamera; |
---|
15866 | 15950 | /*static*/ Camera lightCamera; |
---|
15867 | 15951 | int cameracount; |
---|
.. | .. |
---|
16602 | 16686 | //gl.glColorMask(false, false, false, false); |
---|
16603 | 16687 | |
---|
16604 | 16688 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16605 | | - if (Globals.RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16689 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16606 | 16690 | { |
---|
16607 | 16691 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16608 | 16692 | |
---|