.. | .. |
---|
37 | 37 | static boolean[] selectedstack = new boolean[65536]; |
---|
38 | 38 | static int materialdepth = 0; |
---|
39 | 39 | |
---|
40 | | - static boolean DEBUG = false; |
---|
41 | 40 | static boolean FRUSTUM = false; // still bogus true; // frustum culling |
---|
42 | 41 | |
---|
43 | 42 | // camera change fix |
---|
.. | .. |
---|
106 | 105 | static boolean OEIL = true; |
---|
107 | 106 | static boolean OEILONCE = false; // do oeilon then oeiloff |
---|
108 | 107 | static boolean LOOKAT = true; |
---|
109 | | -static boolean RANDOM = true; // false; |
---|
| 108 | +static boolean SWITCH = true; // false; |
---|
110 | 109 | static boolean HANDLES = false; // selection doesn't work!! |
---|
111 | 110 | static boolean PAINTMODE = false; |
---|
112 | 111 | |
---|
.. | .. |
---|
149 | 148 | defaultcaps.setAccumBlueBits(16); |
---|
150 | 149 | defaultcaps.setAccumAlphaBits(16); |
---|
151 | 150 | } |
---|
| 151 | + |
---|
| 152 | + private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory(); |
---|
152 | 153 | |
---|
153 | 154 | void SetAsGLRenderer(boolean b) |
---|
154 | 155 | { |
---|
.. | .. |
---|
325 | 326 | cStatic.objectstack[materialdepth++] = obj; |
---|
326 | 327 | //System.out.println("material " + material); |
---|
327 | 328 | //Applet3D.tracein(this, selected); |
---|
328 | | - display.vector2buffer = obj.projectedVertices; |
---|
| 329 | + //display.vector2buffer = obj.projectedVertices; |
---|
329 | 330 | if (obj instanceof Camera) |
---|
330 | 331 | { |
---|
331 | 332 | display.options1[0] = material.shift; |
---|
.. | .. |
---|
357 | 358 | /**/ |
---|
358 | 359 | } else |
---|
359 | 360 | { |
---|
360 | | - DrawMaterial(material, selected); |
---|
| 361 | + DrawMaterial(material, selected, obj.projectedVertices); |
---|
361 | 362 | } |
---|
362 | 363 | } else |
---|
363 | 364 | { |
---|
.. | .. |
---|
381 | 382 | cStatic.objectstack[materialdepth++] = obj; |
---|
382 | 383 | //System.out.println("material " + material); |
---|
383 | 384 | //Applet3D.tracein("selected ", selected); |
---|
384 | | - display.vector2buffer = obj.projectedVertices; |
---|
385 | | - display.DrawMaterial(material, selected); |
---|
| 385 | + //display.vector2buffer = obj.projectedVertices; |
---|
| 386 | + display.DrawMaterial(material, selected, obj.projectedVertices); |
---|
386 | 387 | } |
---|
387 | 388 | } |
---|
388 | 389 | |
---|
.. | .. |
---|
399 | 400 | materialdepth -= 1; |
---|
400 | 401 | if (materialdepth > 0) |
---|
401 | 402 | { |
---|
402 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
403 | | - display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 403 | + //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 404 | + display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
404 | 405 | } |
---|
405 | 406 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
406 | 407 | } else if (selected && CameraPane.flash && obj.GetMaterial() != null) |
---|
.. | .. |
---|
420 | 421 | materialdepth -= 1; |
---|
421 | 422 | if (materialdepth > 0) |
---|
422 | 423 | { |
---|
423 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
424 | | - display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 424 | + //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 425 | + display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
425 | 426 | } |
---|
426 | 427 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
427 | 428 | //else |
---|
.. | .. |
---|
462 | 463 | if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
463 | 464 | { |
---|
464 | 465 | //gl.glBegin(gl.GL_TRIANGLES); |
---|
465 | | - boolean hasnorm = pv.norm != null; // && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0); |
---|
| 466 | + boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0) |
---|
| 467 | + // TEST LIVE NORMALS && !obj.dontselect |
---|
| 468 | + ; |
---|
466 | 469 | if (!hasnorm) |
---|
467 | 470 | { |
---|
468 | | - // System.out.println("FUCK!!"); |
---|
| 471 | + // System.out.println("Mesh normal"); |
---|
469 | 472 | LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0); |
---|
470 | 473 | LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1); |
---|
471 | 474 | LA.vecCross(obj.v0, obj.v1, obj.v2); |
---|
.. | .. |
---|
1190 | 1193 | gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
1191 | 1194 | } |
---|
1192 | 1195 | } |
---|
| 1196 | + |
---|
1193 | 1197 | if (flipV) |
---|
1194 | 1198 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1195 | 1199 | else |
---|
1196 | 1200 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1201 | + |
---|
1197 | 1202 | //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
1198 | 1203 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
1199 | 1204 | |
---|
.. | .. |
---|
1213 | 1218 | gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
1214 | 1219 | } |
---|
1215 | 1220 | } |
---|
| 1221 | + |
---|
1216 | 1222 | if (flipV) |
---|
1217 | 1223 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1218 | 1224 | else |
---|
1219 | 1225 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1226 | + |
---|
1220 | 1227 | //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
1221 | 1228 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
1222 | 1229 | |
---|
.. | .. |
---|
1244 | 1251 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1245 | 1252 | else |
---|
1246 | 1253 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1254 | + |
---|
1247 | 1255 | //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]); |
---|
1248 | 1256 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 1257 | + |
---|
1249 | 1258 | count2 += 2; |
---|
1250 | 1259 | count3 += 3; |
---|
1251 | 1260 | } |
---|
.. | .. |
---|
1601 | 1610 | // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
1602 | 1611 | } |
---|
1603 | 1612 | |
---|
1604 | | - void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1613 | + void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others) |
---|
1605 | 1614 | { |
---|
1606 | 1615 | CameraPane display = this; |
---|
1607 | 1616 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
1628 | 1637 | |
---|
1629 | 1638 | cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); |
---|
1630 | 1639 | |
---|
1631 | | - float[] colorV = GrafreeD.colorV; |
---|
| 1640 | + float[] colorV = Grafreed.colorV; |
---|
1632 | 1641 | |
---|
1633 | 1642 | /**/ |
---|
1634 | 1643 | if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0) |
---|
.. | .. |
---|
1636 | 1645 | colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
1637 | 1646 | colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
1638 | 1647 | colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
1639 | | - colorV[3] = material.opacity; |
---|
| 1648 | + colorV[3] = 1; // material.opacity; |
---|
1640 | 1649 | |
---|
1641 | 1650 | gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
1642 | 1651 | //System.out.println("Opacity = " + opacity); |
---|
.. | .. |
---|
1744 | 1753 | display.modelParams7[2] = 0; |
---|
1745 | 1754 | display.modelParams7[3] = 0; |
---|
1746 | 1755 | |
---|
1747 | | - display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1756 | + //display.modelParams6[0] = 100; // criss de bug de bump |
---|
1748 | 1757 | |
---|
1749 | | - Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1758 | + Object3D.cVector2[] extparams = others; // display.vector2buffer; |
---|
1750 | 1759 | if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
1751 | 1760 | { |
---|
1752 | 1761 | display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
.. | .. |
---|
1888 | 1897 | void PushMatrix(double[][] matrix) |
---|
1889 | 1898 | { |
---|
1890 | 1899 | // GrafreeD.tracein(matrix); |
---|
1891 | | - PushMatrix(matrix,1); |
---|
| 1900 | + PushMatrix(matrix, 1); |
---|
1892 | 1901 | } |
---|
1893 | 1902 | |
---|
1894 | 1903 | void PushMatrix() |
---|
.. | .. |
---|
2140 | 2149 | System.err.println("LIVE = " + Globals.isLIVE()); |
---|
2141 | 2150 | |
---|
2142 | 2151 | if (!Globals.isLIVE()) // save sound |
---|
2143 | | - GrafreeD.savesound = true; // wav.save(); |
---|
| 2152 | + Grafreed.savesound = true; // wav.save(); |
---|
2144 | 2153 | // else |
---|
2145 | 2154 | repaint(); // start loop // may 2013 |
---|
2146 | 2155 | } |
---|
.. | .. |
---|
2257 | 2266 | |
---|
2258 | 2267 | void ToggleDebug() |
---|
2259 | 2268 | { |
---|
2260 | | - DEBUG ^= true; |
---|
| 2269 | + Globals.DEBUG ^= true; |
---|
2261 | 2270 | } |
---|
2262 | 2271 | |
---|
2263 | 2272 | void ToggleLookAt() |
---|
.. | .. |
---|
2265 | 2274 | LOOKAT ^= true; |
---|
2266 | 2275 | } |
---|
2267 | 2276 | |
---|
2268 | | - void ToggleRandom() |
---|
| 2277 | + void ToggleSwitch() |
---|
2269 | 2278 | { |
---|
2270 | | - RANDOM ^= true; |
---|
| 2279 | + SWITCH ^= true; |
---|
2271 | 2280 | } |
---|
2272 | 2281 | |
---|
2273 | 2282 | void ToggleHandles() |
---|
.. | .. |
---|
2374 | 2383 | { |
---|
2375 | 2384 | return currentGL; |
---|
2376 | 2385 | } |
---|
2377 | | - |
---|
| 2386 | + |
---|
2378 | 2387 | /**/ |
---|
2379 | 2388 | class CacheTexture |
---|
2380 | 2389 | { |
---|
.. | .. |
---|
7919 | 7928 | ReleaseTexture(pigment, false); |
---|
7920 | 7929 | } |
---|
7921 | 7930 | |
---|
| 7931 | + public void ReleasePigmentTexture(cTexture tex) // INTERFACE |
---|
| 7932 | + { |
---|
| 7933 | + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
| 7934 | + { |
---|
| 7935 | + return; |
---|
| 7936 | + } |
---|
| 7937 | + |
---|
| 7938 | + if (tex == null) |
---|
| 7939 | + { |
---|
| 7940 | + ReleaseTexture(null, false); |
---|
| 7941 | + return; |
---|
| 7942 | + } |
---|
| 7943 | + |
---|
| 7944 | + String pigment = Object3D.GetPigment(tex); |
---|
| 7945 | + |
---|
| 7946 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7947 | + { |
---|
| 7948 | + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
| 7949 | + // System.out.println("; bump = " + bump); |
---|
| 7950 | + } |
---|
| 7951 | + |
---|
| 7952 | + if (pigment.equals("")) |
---|
| 7953 | + { |
---|
| 7954 | + pigment = null; |
---|
| 7955 | + } |
---|
| 7956 | + |
---|
| 7957 | + ReleaseTexture(pigment, false); |
---|
| 7958 | + } |
---|
| 7959 | + |
---|
| 7960 | + public void ReleaseBumpTexture(cTexture tex) // INTERFACE |
---|
| 7961 | + { |
---|
| 7962 | + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
| 7963 | + { |
---|
| 7964 | + return; |
---|
| 7965 | + } |
---|
| 7966 | + |
---|
| 7967 | + if (tex == null) |
---|
| 7968 | + { |
---|
| 7969 | + ReleaseTexture(null, true); |
---|
| 7970 | + return; |
---|
| 7971 | + } |
---|
| 7972 | + |
---|
| 7973 | + String bump = Object3D.GetBump(tex); |
---|
| 7974 | + |
---|
| 7975 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7976 | + { |
---|
| 7977 | + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
| 7978 | + // System.out.println("; bump = " + bump); |
---|
| 7979 | + } |
---|
| 7980 | + |
---|
| 7981 | + if (bump.equals("")) |
---|
| 7982 | + { |
---|
| 7983 | + bump = null; |
---|
| 7984 | + } |
---|
| 7985 | + |
---|
| 7986 | + ReleaseTexture(bump, true); |
---|
| 7987 | + } |
---|
| 7988 | + |
---|
7922 | 7989 | void ReleaseTexture(String tex, boolean bump) |
---|
7923 | 7990 | { |
---|
7924 | 7991 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
.. | .. |
---|
8022 | 8089 | } |
---|
8023 | 8090 | } |
---|
8024 | 8091 | |
---|
8025 | | - /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE |
---|
| 8092 | + /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
8026 | 8093 | { |
---|
8027 | 8094 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
8028 | 8095 | ambientOcclusion ) // || !textureon) |
---|
.. | .. |
---|
8067 | 8134 | return; // true; |
---|
8068 | 8135 | } |
---|
8069 | 8136 | |
---|
8070 | | - CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) |
---|
| 8137 | + /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
| 8138 | + { |
---|
| 8139 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8140 | + ambientOcclusion ) // || !textureon) |
---|
| 8141 | + { |
---|
| 8142 | + return; // false; |
---|
| 8143 | + } |
---|
| 8144 | + |
---|
| 8145 | + if (tex == null) |
---|
| 8146 | + { |
---|
| 8147 | + BindTexture(null,false,resolution); |
---|
| 8148 | + return; |
---|
| 8149 | + } |
---|
| 8150 | + |
---|
| 8151 | + String pigment = Object3D.GetPigment(tex); |
---|
| 8152 | + |
---|
| 8153 | + usedtextures.put(pigment, pigment); |
---|
| 8154 | + |
---|
| 8155 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8156 | + { |
---|
| 8157 | + // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8158 | + // System.out.println("; bump = " + bump); |
---|
| 8159 | + } |
---|
| 8160 | + |
---|
| 8161 | + if (pigment.equals("")) |
---|
| 8162 | + { |
---|
| 8163 | + pigment = null; |
---|
| 8164 | + } |
---|
| 8165 | + |
---|
| 8166 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8167 | + BindTexture(pigment, false, resolution); |
---|
| 8168 | + } |
---|
| 8169 | + |
---|
| 8170 | + /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
| 8171 | + { |
---|
| 8172 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8173 | + ambientOcclusion ) // || !textureon) |
---|
| 8174 | + { |
---|
| 8175 | + return; // false; |
---|
| 8176 | + } |
---|
| 8177 | + |
---|
| 8178 | + if (tex == null) |
---|
| 8179 | + { |
---|
| 8180 | + BindTexture(null,true,resolution); |
---|
| 8181 | + return; |
---|
| 8182 | + } |
---|
| 8183 | + |
---|
| 8184 | + String bump = Object3D.GetBump(tex); |
---|
| 8185 | + |
---|
| 8186 | + usedtextures.put(bump, bump); |
---|
| 8187 | + |
---|
| 8188 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8189 | + { |
---|
| 8190 | + // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8191 | + // System.out.println("; bump = " + bump); |
---|
| 8192 | + } |
---|
| 8193 | + |
---|
| 8194 | + if (bump.equals("")) |
---|
| 8195 | + { |
---|
| 8196 | + bump = null; |
---|
| 8197 | + } |
---|
| 8198 | + |
---|
| 8199 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE2); |
---|
| 8200 | + BindTexture(bump, true, resolution); |
---|
| 8201 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8202 | + } |
---|
| 8203 | + |
---|
| 8204 | + java.util.HashSet<String> missingTextures = new java.util.HashSet<String>(); |
---|
| 8205 | + |
---|
| 8206 | + private boolean FileExists(String tex) |
---|
| 8207 | + { |
---|
| 8208 | + if (missingTextures.contains(tex)) |
---|
| 8209 | + { |
---|
| 8210 | + return false; |
---|
| 8211 | + } |
---|
| 8212 | + |
---|
| 8213 | + boolean fileExists = new File(tex).exists(); |
---|
| 8214 | + |
---|
| 8215 | + if (!fileExists) |
---|
| 8216 | + { |
---|
| 8217 | + // If file exists, the "new File()" is not executed sgain |
---|
| 8218 | + missingTextures.add(tex); |
---|
| 8219 | + } |
---|
| 8220 | + |
---|
| 8221 | + return fileExists; |
---|
| 8222 | + } |
---|
| 8223 | + |
---|
| 8224 | + CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8071 | 8225 | { |
---|
8072 | 8226 | CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null; |
---|
8073 | 8227 | |
---|
.. | .. |
---|
8075 | 8229 | { |
---|
8076 | 8230 | String texname = tex; |
---|
8077 | 8231 | |
---|
8078 | | - String[] split = tex.split("Textures"); |
---|
8079 | | - if (split.length > 1) |
---|
8080 | | - texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
8081 | | - else |
---|
8082 | | - if (!texname.startsWith("/")) |
---|
8083 | | - texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8232 | + String fallbackTextureName = defaultDirectory + "/Textures/" + texname; |
---|
| 8233 | + |
---|
| 8234 | +// String[] split = tex.split("Textures"); |
---|
| 8235 | +// if (split.length > 1) |
---|
| 8236 | +// texname = "/Users/nbriere/Textures" + split[split.length-1]; |
---|
| 8237 | +// else |
---|
| 8238 | +// if (!texname.startsWith("/")) |
---|
| 8239 | +// texname = "/Users/nbriere/Textures/" + texname; |
---|
| 8240 | + if (!FileExists(tex)) |
---|
| 8241 | + { |
---|
| 8242 | + texname = fallbackTextureName; |
---|
| 8243 | + } |
---|
8084 | 8244 | |
---|
8085 | 8245 | if (CACHETEXTURE) |
---|
8086 | 8246 | texture = textures.get(texname); // TEXTURE CACHE |
---|
.. | .. |
---|
8149 | 8309 | } |
---|
8150 | 8310 | |
---|
8151 | 8311 | cachename = texname.substring(0, texname.length()-4)+ext+".jpg"; |
---|
8152 | | - if (!new File(cachename).exists()) |
---|
| 8312 | + if (!FileExists(cachename)) |
---|
8153 | 8313 | cachename = texname; |
---|
8154 | 8314 | else |
---|
8155 | 8315 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8171 | 8331 | } |
---|
8172 | 8332 | |
---|
8173 | 8333 | cachename = texname.substring(0, texname.length()-4)+ext+".png"; |
---|
8174 | | - if (!new File(cachename).exists()) |
---|
| 8334 | + if (!FileExists(cachename)) |
---|
8175 | 8335 | cachename = texname; |
---|
8176 | 8336 | else |
---|
8177 | 8337 | processbump = false; // don't process bump map again |
---|
.. | .. |
---|
8180 | 8340 | texturedata = GetFileTexture(cachename, processbump, resolution); |
---|
8181 | 8341 | |
---|
8182 | 8342 | |
---|
8183 | | - if (texturedata != null) |
---|
| 8343 | + if (texturedata == null) |
---|
| 8344 | + throw new Exception(); |
---|
| 8345 | + |
---|
8184 | 8346 | texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution); |
---|
8185 | 8347 | //texture = GetTexture(tex, bump); |
---|
8186 | 8348 | } |
---|
.. | .. |
---|
8302 | 8464 | return texture; |
---|
8303 | 8465 | } |
---|
8304 | 8466 | |
---|
8305 | | - com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) |
---|
| 8467 | + com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8306 | 8468 | { |
---|
8307 | 8469 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8308 | 8470 | |
---|
.. | .. |
---|
8320 | 8482 | return texture!=null?texture.texture:null; |
---|
8321 | 8483 | } |
---|
8322 | 8484 | |
---|
8323 | | - public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
| 8485 | + public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception |
---|
8324 | 8486 | { |
---|
8325 | 8487 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
8326 | 8488 | |
---|
8327 | 8489 | return texture!=null?texture.texturedata:null; |
---|
8328 | 8490 | } |
---|
8329 | 8491 | |
---|
8330 | | - boolean BindTexture(String tex, boolean bump, int resolution) |
---|
| 8492 | + boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8331 | 8493 | { |
---|
8332 | 8494 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8333 | 8495 | { |
---|
.. | .. |
---|
9304 | 9466 | assert (parentcam != renderCamera); |
---|
9305 | 9467 | |
---|
9306 | 9468 | if (renderCamera != lightCamera) |
---|
9307 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9308 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 9469 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9470 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
9309 | 9471 | |
---|
9310 | 9472 | // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix); |
---|
9311 | 9473 | |
---|
.. | .. |
---|
9320 | 9482 | LA.matCopy(renderCamera.fromScreen, matrix); |
---|
9321 | 9483 | |
---|
9322 | 9484 | if (renderCamera != lightCamera) |
---|
9323 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9324 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 9485 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 9486 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
9325 | 9487 | |
---|
9326 | 9488 | // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix); |
---|
9327 | 9489 | |
---|
.. | .. |
---|
9538 | 9700 | |
---|
9539 | 9701 | if (!BOXMODE) |
---|
9540 | 9702 | { |
---|
9541 | | - System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")"); |
---|
| 9703 | + System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")"); |
---|
9542 | 9704 | } |
---|
9543 | 9705 | |
---|
9544 | 9706 | if (!BOXMODE) |
---|
.. | .. |
---|
9576 | 9738 | ABORTED = false; |
---|
9577 | 9739 | } |
---|
9578 | 9740 | else |
---|
9579 | | - GrafreeD.wav.cursor += 735 * ACSIZE; |
---|
| 9741 | + Grafreed.wav.cursor += 735 * ACSIZE; |
---|
9580 | 9742 | |
---|
9581 | 9743 | if (false) |
---|
9582 | 9744 | { |
---|
.. | .. |
---|
10239 | 10401 | |
---|
10240 | 10402 | public void display(GLAutoDrawable drawable) |
---|
10241 | 10403 | { |
---|
10242 | | - if (GrafreeD.savesound && GrafreeD.hassound) |
---|
| 10404 | + if (Grafreed.savesound && Grafreed.hassound) |
---|
10243 | 10405 | { |
---|
10244 | | - GrafreeD.wav.save(); |
---|
10245 | | - GrafreeD.savesound = false; |
---|
10246 | | - GrafreeD.hassound = false; |
---|
| 10406 | + Grafreed.wav.save(); |
---|
| 10407 | + Grafreed.savesound = false; |
---|
| 10408 | + Grafreed.hassound = false; |
---|
10247 | 10409 | } |
---|
10248 | 10410 | // if (DEBUG_SELECTION) |
---|
10249 | 10411 | // { |
---|
.. | .. |
---|
10319 | 10481 | ANTIALIAS = 0; |
---|
10320 | 10482 | //System.out.println("RESTART"); |
---|
10321 | 10483 | AAtimer.restart(); |
---|
| 10484 | + Globals.TIMERRUNNING = true; |
---|
10322 | 10485 | } |
---|
10323 | 10486 | } |
---|
10324 | 10487 | } |
---|
.. | .. |
---|
10373 | 10536 | Object3D theobject = object; |
---|
10374 | 10537 | Object3D theparent = object.parent; |
---|
10375 | 10538 | object.parent = null; |
---|
10376 | | - object = (Object3D)GrafreeD.clone(object); |
---|
| 10539 | + object = (Object3D)Grafreed.clone(object); |
---|
10377 | 10540 | object.Stripify(); |
---|
10378 | 10541 | if (theobject.selection == null || theobject.selection.Size() == 0) |
---|
10379 | 10542 | theobject.PreprocessOcclusion(this); |
---|
.. | .. |
---|
10386 | 10549 | ambientOcclusion = false; |
---|
10387 | 10550 | } |
---|
10388 | 10551 | |
---|
10389 | | - if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN) |
---|
| 10552 | + if (//Globals.lighttouched && |
---|
| 10553 | + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10390 | 10554 | { |
---|
10391 | 10555 | //if (RENDERSHADOW) // ? |
---|
10392 | 10556 | if (!IsFrozen()) |
---|
10393 | 10557 | { |
---|
10394 | 10558 | // dec 2012 |
---|
10395 | | - if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
| 10559 | + if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0)) |
---|
10396 | 10560 | { |
---|
10397 | 10561 | Globals.framecount++; |
---|
10398 | 10562 | shadowbuffer.display(); |
---|
.. | .. |
---|
10519 | 10683 | |
---|
10520 | 10684 | // if (parentcam != renderCamera) // not a light |
---|
10521 | 10685 | if (cam != lightCamera) |
---|
10522 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10523 | | - LA.matConcat(matrix, parentcam.toParent, matrix); |
---|
| 10686 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10687 | + LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
10524 | 10688 | |
---|
10525 | 10689 | for (int j = 0; j < 4; j++) |
---|
10526 | 10690 | { |
---|
.. | .. |
---|
10534 | 10698 | |
---|
10535 | 10699 | // if (parentcam != renderCamera) // not a light |
---|
10536 | 10700 | if (cam != lightCamera) |
---|
10537 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10538 | | - LA.matConcat(parentcam.fromParent, matrix, matrix); |
---|
| 10701 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 10702 | + LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
10539 | 10703 | |
---|
10540 | 10704 | //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix); |
---|
10541 | 10705 | |
---|
.. | .. |
---|
10794 | 10958 | // Bump noise |
---|
10795 | 10959 | gl.glActiveTexture(GL.GL_TEXTURE6); |
---|
10796 | 10960 | //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise); |
---|
10797 | | - BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10961 | + |
---|
| 10962 | + try |
---|
| 10963 | + { |
---|
| 10964 | + BindTexture(NOISE_TEXTURE, false, 2); |
---|
| 10965 | + } |
---|
| 10966 | + catch (Exception e) |
---|
| 10967 | + { |
---|
| 10968 | + System.err.println("FAILED: " + NOISE_TEXTURE); |
---|
| 10969 | + } |
---|
| 10970 | + |
---|
10798 | 10971 | |
---|
10799 | 10972 | gl.glActiveTexture(GL.GL_TEXTURE0); |
---|
10800 | 10973 | gl.glEnable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
10919 | 11092 | System.err.println("parentcam != renderCamera"); |
---|
10920 | 11093 | |
---|
10921 | 11094 | // if (cam != lightCamera) |
---|
10922 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10923 | | - LA.xformDir(lightposition, parentcam.toParent, lightposition); // may 2013 |
---|
| 11095 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 11096 | + LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013 |
---|
10924 | 11097 | } |
---|
10925 | 11098 | |
---|
10926 | 11099 | LA.xformDir(lightposition, cam.toScreen, lightposition); |
---|
.. | .. |
---|
10941 | 11114 | if (true) // TODO |
---|
10942 | 11115 | { |
---|
10943 | 11116 | if (cam != lightCamera) |
---|
10944 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10945 | | - LA.xformDir(light0, parentcam.toParent, light0); // may 2013 |
---|
| 11117 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 11118 | + LA.xformDir(light0, parentcam.GlobalTransform(), light0); // may 2013 |
---|
10946 | 11119 | } |
---|
10947 | 11120 | |
---|
10948 | 11121 | LA.xformPos(light0, cam.toScreen, light0); |
---|
.. | .. |
---|
11279 | 11452 | e.printStackTrace(); |
---|
11280 | 11453 | } |
---|
11281 | 11454 | |
---|
11282 | | - if (GrafreeD.RENDERME > 0) |
---|
11283 | | - GrafreeD.RENDERME--; // mechante magouille |
---|
| 11455 | + if (Grafreed.RENDERME > 0) |
---|
| 11456 | + Grafreed.RENDERME--; // mechante magouille |
---|
11284 | 11457 | |
---|
11285 | 11458 | Globals.ONESTEP = false; |
---|
11286 | 11459 | } |
---|
11287 | 11460 | |
---|
11288 | 11461 | static boolean zoomonce = false; |
---|
| 11462 | + |
---|
| 11463 | + static void CreateSelectedPoint() |
---|
| 11464 | + { |
---|
| 11465 | + if (selectedpoint == null) |
---|
| 11466 | + { |
---|
| 11467 | + debugpointG = new Sphere(); |
---|
| 11468 | + debugpointP = new Sphere(); |
---|
| 11469 | + debugpointC = new Sphere(); |
---|
| 11470 | + debugpointR = new Sphere(); |
---|
| 11471 | + |
---|
| 11472 | + selectedpoint = new Superellipsoid(); |
---|
| 11473 | + |
---|
| 11474 | + for (int i=0; i<8; i++) |
---|
| 11475 | + { |
---|
| 11476 | + debugpoints[i] = new Sphere(); |
---|
| 11477 | + } |
---|
| 11478 | + } |
---|
| 11479 | + } |
---|
11289 | 11480 | |
---|
11290 | 11481 | void DrawObject(GL gl, boolean draw) |
---|
11291 | 11482 | { |
---|
.. | .. |
---|
11350 | 11541 | |
---|
11351 | 11542 | usedtextures.clear(); |
---|
11352 | 11543 | |
---|
11353 | | - BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11544 | + try |
---|
| 11545 | + { |
---|
| 11546 | + BindTextures(DEFAULT_TEXTURES, 2); |
---|
| 11547 | + } |
---|
| 11548 | + catch (Exception e) |
---|
| 11549 | + { |
---|
| 11550 | + System.err.println("FAILED: " + DEFAULT_TEXTURES); |
---|
| 11551 | + } |
---|
11354 | 11552 | } |
---|
11355 | 11553 | //System.out.println("--> " + stackdepth); |
---|
11356 | 11554 | // GrafreeD.traceon(); |
---|
.. | .. |
---|
11360 | 11558 | |
---|
11361 | 11559 | if (DrawMode() == DEFAULT) |
---|
11362 | 11560 | { |
---|
11363 | | - if (DEBUG) |
---|
| 11561 | + if (Globals.DEBUG) |
---|
11364 | 11562 | { |
---|
| 11563 | + CreateSelectedPoint(); |
---|
11365 | 11564 | float radius = 0.05f; |
---|
11366 | 11565 | if (selectedpoint.radius != radius) |
---|
11367 | 11566 | { |
---|
.. | .. |
---|
11441 | 11640 | if (checker != null && DrawMode() == DEFAULT) |
---|
11442 | 11641 | { |
---|
11443 | 11642 | //BindTexture(IMMORTAL_TEXTURE); |
---|
11444 | | - BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11643 | + try |
---|
| 11644 | + { |
---|
| 11645 | + BindTextures(checker.GetTextures(), checker.texres); |
---|
| 11646 | + } |
---|
| 11647 | + catch (Exception e) |
---|
| 11648 | + { |
---|
| 11649 | + System.err.println("FAILED: " + checker.GetTextures()); |
---|
| 11650 | + } |
---|
11445 | 11651 | // NEAREST |
---|
11446 | 11652 | GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR); |
---|
11447 | 11653 | DrawChecker(gl); |
---|
.. | .. |
---|
11523 | 11729 | return; |
---|
11524 | 11730 | } |
---|
11525 | 11731 | |
---|
11526 | | - String string = obj.GetToolTip(); |
---|
| 11732 | + String string = obj.toString(); //.GetToolTip(); |
---|
11527 | 11733 | |
---|
11528 | 11734 | GL gl = GetGL(); |
---|
11529 | 11735 | |
---|
.. | .. |
---|
11840 | 12046 | //obj.TransformToWorld(light, light); |
---|
11841 | 12047 | for (int i = tp.size(); --i >= 0;) |
---|
11842 | 12048 | { |
---|
11843 | | - for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
11844 | | - LA.xformPos(light, tp.get(i).toParent, light); |
---|
| 12049 | + //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
| 12050 | + LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
11845 | 12051 | } |
---|
11846 | 12052 | |
---|
11847 | 12053 | |
---|
.. | .. |
---|
11858 | 12064 | parentcam = cameras[0]; |
---|
11859 | 12065 | } |
---|
11860 | 12066 | |
---|
11861 | | - for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
11862 | | - LA.xformPos(light, parentcam.toParent, light); // may 2013 |
---|
| 12067 | + //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
| 12068 | + LA.xformPos(light, parentcam.GlobalTransform(), light); // may 2013 |
---|
11863 | 12069 | |
---|
11864 | 12070 | LA.xformPos(light, renderCamera.toScreen, light); |
---|
11865 | 12071 | |
---|
.. | .. |
---|
12473 | 12679 | |
---|
12474 | 12680 | // display shadow only (bump == 0) |
---|
12475 | 12681 | "SUB temp.x, half.x, shadow.x;" + |
---|
12476 | | - "MOV temp.y, -params6.x;" + |
---|
12477 | | - "SLT temp.z, temp.y, zero.x;" + |
---|
| 12682 | + "MOV temp.y, -params5.z;" + // params6.x;" + |
---|
| 12683 | + "SLT temp.z, temp.y, -one2048th.x;" + |
---|
12478 | 12684 | "SUB temp.y, one.x, temp.z;" + |
---|
12479 | 12685 | "MUL temp.x, temp.x, temp.y;" + |
---|
12480 | 12686 | "KIL temp.x;" + |
---|
.. | .. |
---|
12603 | 12809 | "MAX ndotl.x, ndotl.x, -ndotl.x;" + |
---|
12604 | 12810 | |
---|
12605 | 12811 | "SUB temp.x, one.x, ndotl.x;" + |
---|
12606 | | - "ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
12607 | | - "ADD temp.y, one.y, options2.y;" + // sursurface |
---|
| 12812 | + // Tuning for default skin |
---|
| 12813 | + //"ADD temp.x, temp.x, options2.z;" + // lightsheen |
---|
| 12814 | + "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen |
---|
| 12815 | + "ADD temp.y, one.y, options2.y;" + // subsurface |
---|
12608 | 12816 | "MUL temp.x, temp.x, temp.y;" + |
---|
12609 | 12817 | |
---|
12610 | 12818 | "MUL saturation, saturation, temp.xxxx;" + |
---|
.. | .. |
---|
12752 | 12960 | "MUL final.y, fragment.texcoord[0].x, c256;" + |
---|
12753 | 12961 | "FLR final.x, final.y;" + |
---|
12754 | 12962 | "SUB final.y, final.y, final.x;" + |
---|
12755 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12963 | + "MUL final.x, final.x, c256i;" + |
---|
12756 | 12964 | "MOV final.z, zero.x;" + |
---|
12757 | 12965 | "MOV final.a, one.w;":"" |
---|
12758 | 12966 | ) + |
---|
.. | .. |
---|
12760 | 12968 | "MUL final.y, fragment.texcoord[0].y, c256;" + |
---|
12761 | 12969 | "FLR final.x, final.y;" + |
---|
12762 | 12970 | "SUB final.y, final.y, final.x;" + |
---|
12763 | | - //"MUL final.x, final.x, c256i;" + |
---|
| 12971 | + "MUL final.x, final.x, c256i;" + |
---|
12764 | 12972 | "MOV final.z, zero.x;" + |
---|
12765 | 12973 | "MOV final.a, one.w;":"" |
---|
12766 | 12974 | ) + |
---|
.. | .. |
---|
12803 | 13011 | //once = true; |
---|
12804 | 13012 | } |
---|
12805 | 13013 | |
---|
12806 | | - System.out.print("Program #" + mode + "; length = " + program.length()); |
---|
| 13014 | + System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length()); |
---|
12807 | 13015 | System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : "")); |
---|
12808 | 13016 | loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program); |
---|
12809 | 13017 | |
---|
.. | .. |
---|
12936 | 13144 | |
---|
12937 | 13145 | "ADD " + depth + ".z, " + depth + ".z, temp.x;" + |
---|
12938 | 13146 | //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing! |
---|
| 13147 | + |
---|
| 13148 | + // Compare fragment depth in light space with shadowmap. |
---|
12939 | 13149 | "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
12940 | 13150 | "SGE temp.y, temp.x, zero.x;" + |
---|
12941 | | - "SUB " + shadow + ".y, one.x, temp.y;" + |
---|
| 13151 | + "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded |
---|
| 13152 | + |
---|
| 13153 | + // Reverse comparison |
---|
12942 | 13154 | "SUB temp.x, one.x, temp.x;" + |
---|
12943 | 13155 | "MUL " + shadow + ".x, temp.x, temp.y;" + |
---|
12944 | | - "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded |
---|
| 13156 | + "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse |
---|
12945 | 13157 | "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth |
---|
12946 | 13158 | |
---|
12947 | 13159 | "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" + |
---|
.. | .. |
---|
12955 | 13167 | // No shadow for backface |
---|
12956 | 13168 | "DP3 temp.x, normal, lightd;" + |
---|
12957 | 13169 | "SLT temp.x, temp.x, zero.x;" + // shadoweps |
---|
| 13170 | + "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
| 13171 | + |
---|
| 13172 | + // No shadow when out of frustrum |
---|
| 13173 | + "SGE temp.x, " + depth + ".z, one.z;" + |
---|
12958 | 13174 | "LRP " + shadow + ", temp.x, one, " + shadow + ";" + |
---|
12959 | 13175 | ""; |
---|
12960 | 13176 | } |
---|
.. | .. |
---|
13101 | 13317 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13102 | 13318 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13103 | 13319 | /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
13104 | | - Object3D.cVector2[] vector2buffer; |
---|
| 13320 | + |
---|
| 13321 | + //Object3D.cVector2[] vector2buffer; |
---|
13105 | 13322 | |
---|
13106 | 13323 | // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea |
---|
13107 | 13324 | // OUT : diff, spec |
---|
.. | .. |
---|
13513 | 13730 | public void mousePressed(MouseEvent e) |
---|
13514 | 13731 | { |
---|
13515 | 13732 | //System.out.println("mousePressed: " + e); |
---|
13516 | | - clickStart(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 13733 | + clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13517 | 13734 | } |
---|
13518 | 13735 | |
---|
13519 | 13736 | static long prevtime = 0; |
---|
.. | .. |
---|
13589 | 13806 | // mode |= META; |
---|
13590 | 13807 | //} |
---|
13591 | 13808 | |
---|
13592 | | - SetMouseMode(WHEEL | e.getModifiersEx()); |
---|
13593 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0); |
---|
| 13809 | + SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
| 13810 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
13594 | 13811 | anchorX = ax; |
---|
13595 | 13812 | anchorY = ay; |
---|
13596 | 13813 | prevX = px; |
---|
.. | .. |
---|
13624 | 13841 | else |
---|
13625 | 13842 | if (evt.getSource() == AAtimer) |
---|
13626 | 13843 | { |
---|
| 13844 | + Globals.TIMERRUNNING = false; |
---|
13627 | 13845 | if (mouseDown) |
---|
13628 | 13846 | { |
---|
13629 | 13847 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13649 | 13867 | // LIVE = waslive; |
---|
13650 | 13868 | // wasliveok = true; |
---|
13651 | 13869 | // waslive = false; |
---|
| 13870 | + |
---|
| 13871 | + // May 2019 Forget it: |
---|
| 13872 | + if (true) |
---|
| 13873 | + return; |
---|
13652 | 13874 | |
---|
13653 | 13875 | // source == timer |
---|
13654 | 13876 | if (mouseDown) |
---|
.. | .. |
---|
13688 | 13910 | |
---|
13689 | 13911 | javax.swing.Timer timer = new javax.swing.Timer(350, this); |
---|
13690 | 13912 | |
---|
13691 | | - void clickStart(int x, int y, int modifiers) |
---|
| 13913 | + void clickStart(int x, int y, int modifiers, int modifiersex) |
---|
13692 | 13914 | { |
---|
13693 | 13915 | if (!wasliveok) |
---|
13694 | 13916 | return; |
---|
13695 | 13917 | |
---|
13696 | 13918 | AAtimer.restart(); // |
---|
| 13919 | + Globals.TIMERRUNNING = true; |
---|
13697 | 13920 | |
---|
13698 | 13921 | // waslive = LIVE; |
---|
13699 | 13922 | // LIVE = false; |
---|
.. | .. |
---|
13705 | 13928 | // touched = true; // main DL |
---|
13706 | 13929 | if (isRenderer) |
---|
13707 | 13930 | { |
---|
13708 | | - SetMouseMode(modifiers); |
---|
| 13931 | + SetMouseMode(modifiers, modifiersex); |
---|
13709 | 13932 | } |
---|
13710 | 13933 | |
---|
13711 | 13934 | selectX = anchorX = x; |
---|
.. | .. |
---|
13718 | 13941 | clicked = true; |
---|
13719 | 13942 | hold = false; |
---|
13720 | 13943 | |
---|
13721 | | - if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection |
---|
| 13944 | + if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection |
---|
13722 | 13945 | // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection |
---|
13723 | 13946 | { |
---|
13724 | 13947 | // System.out.println("RESTART II " + modifiers); |
---|
.. | .. |
---|
13749 | 13972 | info.camera = renderCamera; |
---|
13750 | 13973 | info.x = x; |
---|
13751 | 13974 | info.y = y; |
---|
13752 | | - info.modifiers = modifiers; |
---|
| 13975 | + info.modifiers = modifiersex; |
---|
13753 | 13976 | editObj = object.doEditClick(info, 0); |
---|
13754 | 13977 | if (!editObj) |
---|
13755 | 13978 | { |
---|
.. | .. |
---|
13766 | 13989 | |
---|
13767 | 13990 | public void mouseDragged(MouseEvent e) |
---|
13768 | 13991 | { |
---|
| 13992 | + Globals.MOUSEDRAGGED = true; |
---|
| 13993 | + |
---|
13769 | 13994 | //System.out.println("mouseDragged: " + e); |
---|
13770 | 13995 | if (isRenderer) |
---|
13771 | 13996 | movingcamera = true; |
---|
| 13997 | + |
---|
13772 | 13998 | //if (drawing) |
---|
13773 | 13999 | //return; |
---|
13774 | 14000 | if ((e.getModifiersEx() & CTRL) != 0 |
---|
.. | .. |
---|
13778 | 14004 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
13779 | 14005 | } |
---|
13780 | 14006 | else |
---|
13781 | | - drag(e.getX(), e.getY(), e.getModifiersEx()); |
---|
| 14007 | + drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
13782 | 14008 | |
---|
13783 | 14009 | //try { Thread.sleep(1); } catch (Exception ex) {} |
---|
13784 | 14010 | } |
---|
.. | .. |
---|
14015 | 14241 | { |
---|
14016 | 14242 | Globals.lighttouched = true; |
---|
14017 | 14243 | } |
---|
14018 | | - drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS); |
---|
| 14244 | + drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS); |
---|
14019 | 14245 | } |
---|
14020 | 14246 | //else |
---|
14021 | 14247 | } |
---|
.. | .. |
---|
14115 | 14341 | int X, Y; |
---|
14116 | 14342 | boolean SX, SY; |
---|
14117 | 14343 | |
---|
14118 | | - void drag(int x, int y, int modifiers) |
---|
| 14344 | + void drag(int x, int y, int modifiers, int modifiersex) |
---|
14119 | 14345 | { |
---|
14120 | 14346 | if (IsFrozen()) |
---|
14121 | 14347 | { |
---|
.. | .. |
---|
14124 | 14350 | |
---|
14125 | 14351 | drag = true; // NEW |
---|
14126 | 14352 | |
---|
14127 | | - boolean continuous = (modifiers & COMMAND) == COMMAND; |
---|
| 14353 | + boolean continuous = (modifiersex & COMMAND) == COMMAND; |
---|
14128 | 14354 | |
---|
14129 | 14355 | X = x; |
---|
14130 | 14356 | Y = y; |
---|
14131 | 14357 | // floating state for animation |
---|
14132 | | - MODIFIERS = modifiers; |
---|
14133 | | - modifiers &= ~1024; |
---|
| 14358 | + MODIFIERS = modifiersex; |
---|
| 14359 | + modifiersex &= ~1024; |
---|
14134 | 14360 | if (false) // modifiers != 0) |
---|
14135 | 14361 | { |
---|
14136 | 14362 | //new Exception().printStackTrace(); |
---|
14137 | | - System.out.println("mouseDragged: " + modifiers); |
---|
| 14363 | + System.out.println("mouseDragged: " + modifiersex); |
---|
14138 | 14364 | System.out.println("SHIFT = " + SHIFT); |
---|
14139 | 14365 | System.out.println("CONTROL = " + COMMAND); |
---|
14140 | 14366 | System.out.println("META = " + META); |
---|
.. | .. |
---|
14154 | 14380 | info.camera = renderCamera; |
---|
14155 | 14381 | info.x = x; |
---|
14156 | 14382 | info.y = y; |
---|
14157 | | - object.editWindow.copy.doEditDrag(info); |
---|
| 14383 | + object.GetWindow().copy |
---|
| 14384 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14158 | 14385 | } else |
---|
14159 | 14386 | { |
---|
14160 | 14387 | if (x < startX) |
---|
.. | .. |
---|
14318 | 14545 | ci.camera = renderCamera; |
---|
14319 | 14546 | if (!isRenderer) |
---|
14320 | 14547 | { |
---|
14321 | | - if (object.editWindow.copy.doEditClick(ci, 0)) |
---|
| 14548 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14549 | + //Object3D copy = editWindow.copy; |
---|
| 14550 | + if (object.doEditClick(ci, 0)) |
---|
14322 | 14551 | { |
---|
14323 | 14552 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14324 | 14553 | } else |
---|
.. | .. |
---|
14330 | 14559 | |
---|
14331 | 14560 | public void mouseReleased(MouseEvent e) |
---|
14332 | 14561 | { |
---|
| 14562 | + Globals.MOUSEDRAGGED = false; |
---|
| 14563 | + |
---|
14333 | 14564 | movingcamera = false; |
---|
| 14565 | + X = Y = 0; |
---|
14334 | 14566 | //System.out.println("mouseReleased: " + e); |
---|
14335 | 14567 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14336 | 14568 | } |
---|
.. | .. |
---|
14353 | 14585 | boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection |
---|
14354 | 14586 | boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection |
---|
14355 | 14587 | |
---|
14356 | | - if (control || command || IsFrozen()) |
---|
| 14588 | +// No delay if (control || command || IsFrozen()) |
---|
14357 | 14589 | timeout = true; |
---|
14358 | | - else |
---|
| 14590 | +// ?? May 2019 else |
---|
14359 | 14591 | // timer.setDelay((modifiers & 128) != 0?0:350); |
---|
14360 | 14592 | mouseDown = false; |
---|
14361 | 14593 | if (!control && !command) // june 2013 |
---|
.. | .. |
---|
14465 | 14697 | System.out.println("keyReleased: " + e); |
---|
14466 | 14698 | } |
---|
14467 | 14699 | |
---|
14468 | | - void SetMouseMode(int modifiers) |
---|
| 14700 | + void SetMouseMode(int modifiers, int modifiersex) |
---|
14469 | 14701 | { |
---|
14470 | 14702 | //System.out.println("SetMouseMode = " + modifiers); |
---|
14471 | 14703 | //modifiers &= ~1024; |
---|
.. | .. |
---|
14477 | 14709 | //if (modifiers == 0) // || (modifiers == (1024 | CONTROL))) |
---|
14478 | 14710 | // return; |
---|
14479 | 14711 | //System.out.println("SetMode = " + modifiers); |
---|
14480 | | - if ((modifiers & WHEEL) == WHEEL) |
---|
| 14712 | + if ((modifiersex & WHEEL) == WHEEL) |
---|
14481 | 14713 | { |
---|
14482 | 14714 | mouseMode |= ZOOM; |
---|
14483 | 14715 | } |
---|
14484 | 14716 | |
---|
14485 | 14717 | boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK); |
---|
14486 | | - if (capsLocked || (modifiers & META) == META) |
---|
| 14718 | + if (capsLocked) // || (modifiers & META) == META) |
---|
14487 | 14719 | { |
---|
14488 | 14720 | mouseMode |= VR; // BACKFORTH; |
---|
14489 | 14721 | } |
---|
14490 | | - if ((modifiers & CTRLCLICK) == CTRLCLICK) |
---|
| 14722 | + if ((modifiersex & CTRLCLICK) == CTRLCLICK) |
---|
14491 | 14723 | { |
---|
14492 | 14724 | mouseMode |= SELECT; |
---|
14493 | 14725 | } |
---|
14494 | | - if ((modifiers & COMMAND) == COMMAND) |
---|
| 14726 | + if ((modifiersex & COMMAND) == COMMAND) |
---|
14495 | 14727 | { |
---|
14496 | 14728 | mouseMode |= SELECT; |
---|
14497 | 14729 | } |
---|
14498 | | - if ((modifiers & SHIFT) == SHIFT || forcetranslate) |
---|
| 14730 | + if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0) |
---|
14499 | 14731 | { |
---|
14500 | 14732 | mouseMode &= ~VR; |
---|
14501 | 14733 | mouseMode |= TRANSLATE; |
---|
.. | .. |
---|
14524 | 14756 | |
---|
14525 | 14757 | if (isRenderer) // |
---|
14526 | 14758 | { |
---|
14527 | | - SetMouseMode(modifiers); |
---|
| 14759 | + SetMouseMode(0, modifiers); |
---|
14528 | 14760 | } |
---|
14529 | 14761 | |
---|
14530 | 14762 | Globals.theRenderer.keyPressed(key); |
---|
.. | .. |
---|
14696 | 14928 | RevertCamera(); |
---|
14697 | 14929 | repaint(); |
---|
14698 | 14930 | break; |
---|
14699 | | - case 'L': |
---|
14700 | 14931 | case 'l': |
---|
| 14932 | + lightMode ^= true; |
---|
| 14933 | + Globals.lighttouched = true; |
---|
| 14934 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 14935 | + targetLookAt.set(manipCamera.lookAt); |
---|
| 14936 | + repaint(); |
---|
| 14937 | + break; |
---|
| 14938 | + case 'L': |
---|
14701 | 14939 | if (lightMode) |
---|
14702 | 14940 | { |
---|
14703 | 14941 | lightMode = false; |
---|
.. | .. |
---|
14844 | 15082 | kompactbit = 6; |
---|
14845 | 15083 | break; |
---|
14846 | 15084 | case ' ': |
---|
14847 | | - lightMode ^= true; |
---|
14848 | | - Globals.lighttouched = true; |
---|
14849 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
14850 | | - targetLookAt.set(manipCamera.lookAt); |
---|
| 15085 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14851 | 15086 | repaint(); |
---|
14852 | 15087 | break; |
---|
14853 | 15088 | //case '`' : |
---|
14854 | 15089 | case ESC: |
---|
14855 | 15090 | RENDERPROGRAM += 1; |
---|
14856 | 15091 | RENDERPROGRAM %= 3; |
---|
| 15092 | + |
---|
14857 | 15093 | repaint(); |
---|
14858 | 15094 | break; |
---|
14859 | 15095 | case 'Z': |
---|
14860 | 15096 | //RESIZETEXTURE ^= true; |
---|
14861 | 15097 | //break; |
---|
14862 | 15098 | case 'z': |
---|
14863 | | - RENDERSHADOW ^= true; |
---|
| 15099 | + Globals.RENDERSHADOW ^= true; |
---|
14864 | 15100 | Globals.lighttouched = true; |
---|
14865 | 15101 | repaint(); |
---|
14866 | 15102 | break; |
---|
.. | .. |
---|
14984 | 15220 | //mode = ROTATE; |
---|
14985 | 15221 | if ((MODIFIERS & COMMAND) == 0) // VR?? |
---|
14986 | 15222 | { |
---|
14987 | | - SetMouseMode(modifiers); |
---|
| 15223 | + SetMouseMode(0, modifiers); |
---|
14988 | 15224 | } |
---|
14989 | 15225 | } |
---|
14990 | 15226 | |
---|
.. | .. |
---|
15120 | 15356 | { |
---|
15121 | 15357 | //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton()); |
---|
15122 | 15358 | //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0) |
---|
15123 | | - if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
| 15359 | + if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0) |
---|
15124 | 15360 | { |
---|
15125 | 15361 | mouseMoved(e); |
---|
15126 | 15362 | } else |
---|
.. | .. |
---|
15145 | 15381 | } |
---|
15146 | 15382 | */ |
---|
15147 | 15383 | |
---|
15148 | | - object.editWindow.EditSelection(); |
---|
| 15384 | + object.editWindow.EditSelection(false); |
---|
15149 | 15385 | } |
---|
15150 | 15386 | |
---|
15151 | 15387 | void SelectParent() |
---|
.. | .. |
---|
15339 | 15575 | info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom)); |
---|
15340 | 15576 | //Image img = CreateImage(width, height); |
---|
15341 | 15577 | //System.out.println("width = " + width + "; height = " + height + "\n"); |
---|
| 15578 | + |
---|
15342 | 15579 | Graphics gr = g; // img.getGraphics(); |
---|
| 15580 | + |
---|
15343 | 15581 | if (!hasMarquee) |
---|
15344 | 15582 | { |
---|
15345 | 15583 | if (Xmin < Xmax) // !locked) |
---|
.. | .. |
---|
15437 | 15675 | if (!isRenderer) |
---|
15438 | 15676 | { |
---|
15439 | 15677 | object.drawEditHandles(info, 0); |
---|
| 15678 | + |
---|
| 15679 | + if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15680 | + { |
---|
| 15681 | + switch (object.selection.get(0).hitSomething) |
---|
| 15682 | + { |
---|
| 15683 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15684 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15685 | + break; |
---|
| 15686 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15687 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15688 | + break; |
---|
| 15689 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15690 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15691 | + break; |
---|
| 15692 | + } |
---|
| 15693 | + |
---|
| 15694 | + } |
---|
15440 | 15695 | } |
---|
15441 | 15696 | } |
---|
| 15697 | + |
---|
15442 | 15698 | if (isRenderer) |
---|
15443 | 15699 | { |
---|
15444 | 15700 | //gr.setColor(Color.black); |
---|
15445 | 15701 | //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1); |
---|
15446 | 15702 | //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3); |
---|
15447 | 15703 | } |
---|
| 15704 | + |
---|
15448 | 15705 | if (hasMarquee) |
---|
15449 | 15706 | { |
---|
15450 | 15707 | gr.setXORMode(Color.white); |
---|
.. | .. |
---|
15557 | 15814 | public boolean mouseDown(Event evt, int x, int y) |
---|
15558 | 15815 | { |
---|
15559 | 15816 | System.out.println("mouseDown: " + evt); |
---|
| 15817 | + System.exit(0); |
---|
15560 | 15818 | /* |
---|
15561 | 15819 | locked = true; |
---|
15562 | 15820 | drag = false; |
---|
.. | .. |
---|
15600 | 15858 | { |
---|
15601 | 15859 | keyPressed(0, modifiers); |
---|
15602 | 15860 | } |
---|
15603 | | - clickStart(x, y, modifiers); |
---|
| 15861 | + // clickStart(x, y, modifiers); |
---|
15604 | 15862 | return true; |
---|
15605 | 15863 | } |
---|
15606 | 15864 | |
---|
.. | .. |
---|
15718 | 15976 | { |
---|
15719 | 15977 | keyReleased(0, 0); |
---|
15720 | 15978 | } |
---|
15721 | | - drag(x, y, modifiers); |
---|
| 15979 | + drag(x, y, 0, modifiers); |
---|
15722 | 15980 | return true; |
---|
15723 | 15981 | } |
---|
15724 | 15982 | |
---|
.. | .. |
---|
15850 | 16108 | Object3D object; |
---|
15851 | 16109 | static Object3D trackedobject; |
---|
15852 | 16110 | Camera renderCamera; // Light or Eye (or Occlusion) |
---|
15853 | | - /*static*/ Camera manipCamera; // Light or Eye |
---|
| 16111 | + /*static*/ Camera manipCamera; // Light or Eye. Can be Light when Eye, not Eye when Light |
---|
15854 | 16112 | /*static*/ Camera eyeCamera; |
---|
15855 | 16113 | /*static*/ Camera lightCamera; |
---|
15856 | 16114 | int cameracount; |
---|
.. | .. |
---|
16135 | 16393 | cStatic.objectstack[materialdepth++] = checker; |
---|
16136 | 16394 | //System.out.println("material " + material); |
---|
16137 | 16395 | //Applet3D.tracein(this, selected); |
---|
16138 | | - vector2buffer = checker.projectedVertices; |
---|
| 16396 | + //vector2buffer = checker.projectedVertices; |
---|
16139 | 16397 | |
---|
16140 | 16398 | //checker.GetMaterial().Draw(this, false); // true); |
---|
16141 | | - DrawMaterial(checker.GetMaterial(), false); // true); |
---|
| 16399 | + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true); |
---|
16142 | 16400 | |
---|
16143 | 16401 | materialdepth -= 1; |
---|
16144 | 16402 | if (materialdepth > 0) |
---|
16145 | 16403 | { |
---|
16146 | | - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
16147 | | - DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 16404 | + //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 16405 | + DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
16148 | 16406 | } |
---|
16149 | 16407 | //checker.GetMaterial().opacity = 1f; |
---|
16150 | 16408 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
16368 | 16626 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16369 | 16627 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
16370 | 16628 | |
---|
| 16629 | + CreateSelectedPoint(); |
---|
| 16630 | + |
---|
16371 | 16631 | // Will fit the mesh !!! |
---|
16372 | 16632 | selectedpoint.toParent[0][0] = 0.0001; |
---|
16373 | 16633 | selectedpoint.toParent[1][1] = 0.0001; |
---|
.. | .. |
---|
16416 | 16676 | System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2])); |
---|
16417 | 16677 | } |
---|
16418 | 16678 | |
---|
16419 | | - previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint); |
---|
| 16679 | + previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint); |
---|
16420 | 16680 | } |
---|
16421 | 16681 | } |
---|
16422 | 16682 | |
---|
16423 | 16683 | if (!movingcamera && !PAINTMODE) |
---|
16424 | 16684 | object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
16425 | 16685 | |
---|
16426 | | - if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16686 | + if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16427 | 16687 | { |
---|
16428 | | - Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16688 | + Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16429 | 16689 | |
---|
16430 | 16690 | Object3D group = new Object3D("inst" + paintcount++); |
---|
16431 | 16691 | |
---|
.. | .. |
---|
16581 | 16841 | gl.glDisable(gl.GL_CULL_FACE); |
---|
16582 | 16842 | } |
---|
16583 | 16843 | |
---|
16584 | | - if (!RENDERSHADOW) |
---|
| 16844 | + if (!Globals.RENDERSHADOW) |
---|
16585 | 16845 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16586 | 16846 | |
---|
16587 | 16847 | // SB gl.glPolygonOffset(2.5f, 10); |
---|
.. | .. |
---|
16591 | 16851 | //gl.glColorMask(false, false, false, false); |
---|
16592 | 16852 | |
---|
16593 | 16853 | //render_scene_from_light_view(gl, drawable, 0, 0); |
---|
16594 | | - if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed()) |
---|
| 16854 | + if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed()) |
---|
16595 | 16855 | { |
---|
16596 | 16856 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); |
---|
16597 | 16857 | |
---|
.. | .. |
---|
17007 | 17267 | int AAbuffersize = 0; |
---|
17008 | 17268 | |
---|
17009 | 17269 | //double[] selectedpoint = new double[3]; |
---|
17010 | | - static Superellipsoid selectedpoint = new Superellipsoid(); |
---|
| 17270 | + static Superellipsoid selectedpoint; |
---|
17011 | 17271 | static Sphere previousselectedpoint = null; |
---|
17012 | | - static Sphere debugpointG = new Sphere(); |
---|
17013 | | - static Sphere debugpointP = new Sphere(); |
---|
17014 | | - static Sphere debugpointC = new Sphere(); |
---|
17015 | | - static Sphere debugpointR = new Sphere(); |
---|
| 17272 | + static Sphere debugpointG; |
---|
| 17273 | + static Sphere debugpointP; |
---|
| 17274 | + static Sphere debugpointC; |
---|
| 17275 | + static Sphere debugpointR; |
---|
17016 | 17276 | |
---|
17017 | 17277 | static Sphere debugpoints[] = new Sphere[8]; |
---|
17018 | 17278 | |
---|
17019 | | - static |
---|
17020 | | - { |
---|
17021 | | - for (int i=0; i<8; i++) |
---|
17022 | | - { |
---|
17023 | | - debugpoints[i] = new Sphere(); |
---|
17024 | | - } |
---|
17025 | | - } |
---|
17026 | | - |
---|
17027 | 17279 | static void InitPoints(float radius) |
---|
17028 | 17280 | { |
---|
17029 | 17281 | for (int i=0; i<8; i++) |
---|