.. | .. |
---|
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 |
---|
.. | .. |
---|
327 | 326 | cStatic.objectstack[materialdepth++] = obj; |
---|
328 | 327 | //System.out.println("material " + material); |
---|
329 | 328 | //Applet3D.tracein(this, selected); |
---|
330 | | - display.vector2buffer = obj.projectedVertices; |
---|
| 329 | + //display.vector2buffer = obj.projectedVertices; |
---|
331 | 330 | if (obj instanceof Camera) |
---|
332 | 331 | { |
---|
333 | 332 | display.options1[0] = material.shift; |
---|
.. | .. |
---|
336 | 335 | display.options1[2] = material.shadowbias; |
---|
337 | 336 | display.options1[3] = material.aniso; |
---|
338 | 337 | display.options1[4] = material.anisoV; |
---|
| 338 | +// System.out.println("display.options1[0] " + display.options1[0]); |
---|
| 339 | +// System.out.println("display.options1[1] " + display.options1[1]); |
---|
| 340 | +// System.out.println("display.options1[2] " + display.options1[2]); |
---|
| 341 | +// System.out.println("display.options1[3] " + display.options1[3]); |
---|
| 342 | +// System.out.println("display.options1[4] " + display.options1[4]); |
---|
339 | 343 | display.options2[0] = material.opacity; |
---|
340 | 344 | display.options2[1] = material.diffuse; |
---|
341 | 345 | display.options2[2] = material.factor; |
---|
| 346 | +// System.out.println("display.options2[0] " + display.options2[0]); |
---|
| 347 | +// System.out.println("display.options2[1] " + display.options2[1]); |
---|
| 348 | +// System.out.println("display.options2[2] " + display.options2[2]); |
---|
342 | 349 | |
---|
343 | 350 | cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3); |
---|
| 351 | +// System.out.println("display.options3[0] " + display.options3[0]); |
---|
| 352 | +// System.out.println("display.options3[1] " + display.options3[1]); |
---|
| 353 | +// System.out.println("display.options3[2] " + display.options3[2]); |
---|
344 | 354 | display.options4[0] = material.cameralight/0.2f; |
---|
345 | 355 | display.options4[1] = material.subsurface; |
---|
346 | 356 | display.options4[2] = material.sheen; |
---|
| 357 | +// System.out.println("display.options4[0] " + display.options4[0]); |
---|
| 358 | +// System.out.println("display.options4[1] " + display.options4[1]); |
---|
| 359 | +// System.out.println("display.options4[2] " + display.options4[2]); |
---|
347 | 360 | |
---|
348 | 361 | // if (display.CURRENTANTIALIAS > 0) |
---|
349 | 362 | // display.options3[3] /= 4; |
---|
.. | .. |
---|
359 | 372 | /**/ |
---|
360 | 373 | } else |
---|
361 | 374 | { |
---|
362 | | - DrawMaterial(material, selected); |
---|
| 375 | + DrawMaterial(material, selected, obj.projectedVertices); |
---|
363 | 376 | } |
---|
364 | 377 | } else |
---|
365 | 378 | { |
---|
.. | .. |
---|
383 | 396 | cStatic.objectstack[materialdepth++] = obj; |
---|
384 | 397 | //System.out.println("material " + material); |
---|
385 | 398 | //Applet3D.tracein("selected ", selected); |
---|
386 | | - display.vector2buffer = obj.projectedVertices; |
---|
387 | | - display.DrawMaterial(material, selected); |
---|
| 399 | + //display.vector2buffer = obj.projectedVertices; |
---|
| 400 | + display.DrawMaterial(material, selected, obj.projectedVertices); |
---|
388 | 401 | } |
---|
389 | 402 | } |
---|
390 | 403 | |
---|
.. | .. |
---|
401 | 414 | materialdepth -= 1; |
---|
402 | 415 | if (materialdepth > 0) |
---|
403 | 416 | { |
---|
404 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
405 | | - display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 417 | + //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 418 | + display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
406 | 419 | } |
---|
407 | 420 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
408 | 421 | } else if (selected && CameraPane.flash && obj.GetMaterial() != null) |
---|
.. | .. |
---|
422 | 435 | materialdepth -= 1; |
---|
423 | 436 | if (materialdepth > 0) |
---|
424 | 437 | { |
---|
425 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
426 | | - display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 438 | + //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 439 | + display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
427 | 440 | } |
---|
428 | 441 | //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
429 | 442 | //else |
---|
.. | .. |
---|
464 | 477 | if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
465 | 478 | { |
---|
466 | 479 | //gl.glBegin(gl.GL_TRIANGLES); |
---|
467 | | - boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0); |
---|
| 480 | + boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0) |
---|
| 481 | + // TEST LIVE NORMALS && !obj.dontselect |
---|
| 482 | + ; |
---|
468 | 483 | if (!hasnorm) |
---|
469 | 484 | { |
---|
470 | | - // System.out.println("FUCK!!"); |
---|
| 485 | + // System.out.println("Mesh normal"); |
---|
471 | 486 | LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0); |
---|
472 | 487 | LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1); |
---|
473 | 488 | LA.vecCross(obj.v0, obj.v1, obj.v2); |
---|
.. | .. |
---|
1192 | 1207 | gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
1193 | 1208 | } |
---|
1194 | 1209 | } |
---|
| 1210 | + |
---|
1195 | 1211 | if (flipV) |
---|
1196 | 1212 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1197 | 1213 | else |
---|
1198 | 1214 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1215 | + |
---|
1199 | 1216 | //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
1200 | 1217 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
1201 | 1218 | |
---|
.. | .. |
---|
1215 | 1232 | gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
1216 | 1233 | } |
---|
1217 | 1234 | } |
---|
| 1235 | + |
---|
1218 | 1236 | if (flipV) |
---|
1219 | 1237 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1220 | 1238 | else |
---|
1221 | 1239 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1240 | + |
---|
1222 | 1241 | //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
1223 | 1242 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
1224 | 1243 | |
---|
.. | .. |
---|
1246 | 1265 | gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
1247 | 1266 | else |
---|
1248 | 1267 | gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1268 | + |
---|
1249 | 1269 | //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]); |
---|
1250 | 1270 | gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 1271 | + |
---|
1251 | 1272 | count2 += 2; |
---|
1252 | 1273 | count3 += 3; |
---|
1253 | 1274 | } |
---|
.. | .. |
---|
1603 | 1624 | // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
1604 | 1625 | } |
---|
1605 | 1626 | |
---|
1606 | | - void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1627 | + void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others) |
---|
1607 | 1628 | { |
---|
1608 | 1629 | CameraPane display = this; |
---|
1609 | 1630 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
1638 | 1659 | colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
1639 | 1660 | colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
1640 | 1661 | colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
1641 | | - colorV[3] = material.opacity; |
---|
| 1662 | + colorV[3] = 1; // material.opacity; |
---|
1642 | 1663 | |
---|
1643 | 1664 | gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
1644 | 1665 | //System.out.println("Opacity = " + opacity); |
---|
.. | .. |
---|
1746 | 1767 | display.modelParams7[2] = 0; |
---|
1747 | 1768 | display.modelParams7[3] = 0; |
---|
1748 | 1769 | |
---|
1749 | | - display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1770 | + //display.modelParams6[0] = 100; // criss de bug de bump |
---|
1750 | 1771 | |
---|
1751 | | - Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1772 | + Object3D.cVector2[] extparams = others; // display.vector2buffer; |
---|
1752 | 1773 | if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
1753 | 1774 | { |
---|
1754 | 1775 | display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
.. | .. |
---|
2044 | 2065 | //System.err.println("Oeil on"); |
---|
2045 | 2066 | OEIL = true; |
---|
2046 | 2067 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2047 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2068 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2048 | 2069 | //pingthread.StepToTarget(true); |
---|
2049 | 2070 | } |
---|
2050 | 2071 | |
---|
.. | .. |
---|
2259 | 2280 | |
---|
2260 | 2281 | void ToggleDebug() |
---|
2261 | 2282 | { |
---|
2262 | | - DEBUG ^= true; |
---|
| 2283 | + Globals.DEBUG ^= true; |
---|
2263 | 2284 | } |
---|
2264 | 2285 | |
---|
2265 | 2286 | void ToggleLookAt() |
---|
.. | .. |
---|
7921 | 7942 | ReleaseTexture(pigment, false); |
---|
7922 | 7943 | } |
---|
7923 | 7944 | |
---|
| 7945 | + public void ReleasePigmentTexture(cTexture tex) // INTERFACE |
---|
| 7946 | + { |
---|
| 7947 | + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
| 7948 | + { |
---|
| 7949 | + return; |
---|
| 7950 | + } |
---|
| 7951 | + |
---|
| 7952 | + if (tex == null) |
---|
| 7953 | + { |
---|
| 7954 | + ReleaseTexture(null, false); |
---|
| 7955 | + return; |
---|
| 7956 | + } |
---|
| 7957 | + |
---|
| 7958 | + String pigment = Object3D.GetPigment(tex); |
---|
| 7959 | + |
---|
| 7960 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7961 | + { |
---|
| 7962 | + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
| 7963 | + // System.out.println("; bump = " + bump); |
---|
| 7964 | + } |
---|
| 7965 | + |
---|
| 7966 | + if (pigment.equals("")) |
---|
| 7967 | + { |
---|
| 7968 | + pigment = null; |
---|
| 7969 | + } |
---|
| 7970 | + |
---|
| 7971 | + ReleaseTexture(pigment, false); |
---|
| 7972 | + } |
---|
| 7973 | + |
---|
| 7974 | + public void ReleaseBumpTexture(cTexture tex) // INTERFACE |
---|
| 7975 | + { |
---|
| 7976 | + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
| 7977 | + { |
---|
| 7978 | + return; |
---|
| 7979 | + } |
---|
| 7980 | + |
---|
| 7981 | + if (tex == null) |
---|
| 7982 | + { |
---|
| 7983 | + ReleaseTexture(null, true); |
---|
| 7984 | + return; |
---|
| 7985 | + } |
---|
| 7986 | + |
---|
| 7987 | + String bump = Object3D.GetBump(tex); |
---|
| 7988 | + |
---|
| 7989 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7990 | + { |
---|
| 7991 | + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
| 7992 | + // System.out.println("; bump = " + bump); |
---|
| 7993 | + } |
---|
| 7994 | + |
---|
| 7995 | + if (bump.equals("")) |
---|
| 7996 | + { |
---|
| 7997 | + bump = null; |
---|
| 7998 | + } |
---|
| 7999 | + |
---|
| 8000 | + ReleaseTexture(bump, true); |
---|
| 8001 | + } |
---|
| 8002 | + |
---|
7924 | 8003 | void ReleaseTexture(String tex, boolean bump) |
---|
7925 | 8004 | { |
---|
7926 | 8005 | if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
.. | .. |
---|
8067 | 8146 | GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
8068 | 8147 | |
---|
8069 | 8148 | return; // true; |
---|
| 8149 | + } |
---|
| 8150 | + |
---|
| 8151 | + /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
| 8152 | + { |
---|
| 8153 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8154 | + ambientOcclusion ) // || !textureon) |
---|
| 8155 | + { |
---|
| 8156 | + return; // false; |
---|
| 8157 | + } |
---|
| 8158 | + |
---|
| 8159 | + if (tex == null) |
---|
| 8160 | + { |
---|
| 8161 | + BindTexture(null,false,resolution); |
---|
| 8162 | + return; |
---|
| 8163 | + } |
---|
| 8164 | + |
---|
| 8165 | + String pigment = Object3D.GetPigment(tex); |
---|
| 8166 | + |
---|
| 8167 | + usedtextures.put(pigment, pigment); |
---|
| 8168 | + |
---|
| 8169 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8170 | + { |
---|
| 8171 | + // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8172 | + // System.out.println("; bump = " + bump); |
---|
| 8173 | + } |
---|
| 8174 | + |
---|
| 8175 | + if (pigment.equals("")) |
---|
| 8176 | + { |
---|
| 8177 | + pigment = null; |
---|
| 8178 | + } |
---|
| 8179 | + |
---|
| 8180 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
| 8181 | + BindTexture(pigment, false, resolution); |
---|
| 8182 | + } |
---|
| 8183 | + |
---|
| 8184 | + /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE |
---|
| 8185 | + { |
---|
| 8186 | + if (// DrawMode() != 0 || /*tex == null ||*/ |
---|
| 8187 | + ambientOcclusion ) // || !textureon) |
---|
| 8188 | + { |
---|
| 8189 | + return; // false; |
---|
| 8190 | + } |
---|
| 8191 | + |
---|
| 8192 | + if (tex == null) |
---|
| 8193 | + { |
---|
| 8194 | + BindTexture(null,true,resolution); |
---|
| 8195 | + return; |
---|
| 8196 | + } |
---|
| 8197 | + |
---|
| 8198 | + String bump = Object3D.GetBump(tex); |
---|
| 8199 | + |
---|
| 8200 | + usedtextures.put(bump, bump); |
---|
| 8201 | + |
---|
| 8202 | + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8203 | + { |
---|
| 8204 | + // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
| 8205 | + // System.out.println("; bump = " + bump); |
---|
| 8206 | + } |
---|
| 8207 | + |
---|
| 8208 | + if (bump.equals("")) |
---|
| 8209 | + { |
---|
| 8210 | + bump = null; |
---|
| 8211 | + } |
---|
| 8212 | + |
---|
| 8213 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE2); |
---|
| 8214 | + BindTexture(bump, true, resolution); |
---|
| 8215 | + GetGL().glActiveTexture(GetGL().GL_TEXTURE0); |
---|
8070 | 8216 | } |
---|
8071 | 8217 | |
---|
8072 | 8218 | java.util.HashSet<String> missingTextures = new java.util.HashSet<String>(); |
---|
.. | .. |
---|
9234 | 9380 | jy8[3] = 0.5f; |
---|
9235 | 9381 | } |
---|
9236 | 9382 | |
---|
9237 | | - float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
| 9383 | + float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
9238 | 9384 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9239 | 9385 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9240 | 9386 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9241 | 9387 | |
---|
| 9388 | + void ResetOptions() |
---|
| 9389 | + { |
---|
| 9390 | + options1[0] = 100; |
---|
| 9391 | + options1[1] = 0.025f; |
---|
| 9392 | + options1[2] = 0.01f; |
---|
| 9393 | + options1[3] = 0; |
---|
| 9394 | + options1[4] = 0; |
---|
| 9395 | + |
---|
| 9396 | + options2[0] = 0; |
---|
| 9397 | + options2[1] = 0.75f; |
---|
| 9398 | + options2[2] = 0; |
---|
| 9399 | + options2[3] = 0; |
---|
| 9400 | + |
---|
| 9401 | + options3[0] = 1; |
---|
| 9402 | + options3[1] = 1; |
---|
| 9403 | + options3[2] = 1; |
---|
| 9404 | + options3[3] = 0; |
---|
| 9405 | + |
---|
| 9406 | + options4[0] = 1; |
---|
| 9407 | + options4[1] = 0; |
---|
| 9408 | + options4[2] = 1; |
---|
| 9409 | + options4[3] = 0; |
---|
| 9410 | + } |
---|
| 9411 | + |
---|
9242 | 9412 | static int imagecount = 0; // movie generation |
---|
9243 | 9413 | |
---|
9244 | 9414 | static int jitter = 0; |
---|
.. | .. |
---|
10349 | 10519 | ANTIALIAS = 0; |
---|
10350 | 10520 | //System.out.println("RESTART"); |
---|
10351 | 10521 | AAtimer.restart(); |
---|
| 10522 | + Globals.TIMERRUNNING = true; |
---|
10352 | 10523 | } |
---|
10353 | 10524 | } |
---|
10354 | 10525 | } |
---|
.. | .. |
---|
10416 | 10587 | ambientOcclusion = false; |
---|
10417 | 10588 | } |
---|
10418 | 10589 | |
---|
10419 | | - if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
| 10590 | + if (//Globals.lighttouched && |
---|
| 10591 | + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10420 | 10592 | { |
---|
10421 | 10593 | //if (RENDERSHADOW) // ? |
---|
10422 | 10594 | if (!IsFrozen()) |
---|
.. | .. |
---|
10856 | 11028 | |
---|
10857 | 11029 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
10858 | 11030 | |
---|
10859 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
10860 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
10861 | | -//gl.glEnable(gl.GL_MULTISAMPLE); |
---|
| 11031 | +gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
| 11032 | +gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
| 11033 | +gl.glEnable(gl.GL_MULTISAMPLE); |
---|
10862 | 11034 | } else |
---|
10863 | 11035 | { |
---|
10864 | 11036 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
10869 | 11041 | //System.out.println("BLENDING ON"); |
---|
10870 | 11042 | gl.glEnable(GL.GL_BLEND); |
---|
10871 | 11043 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
10872 | | - |
---|
| 11044 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
10873 | 11045 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
10874 | 11046 | gl.glLoadIdentity(); |
---|
10875 | 11047 | |
---|
.. | .. |
---|
11326 | 11498 | |
---|
11327 | 11499 | static boolean zoomonce = false; |
---|
11328 | 11500 | |
---|
| 11501 | + static void CreateSelectedPoint() |
---|
| 11502 | + { |
---|
| 11503 | + if (selectedpoint == null) |
---|
| 11504 | + { |
---|
| 11505 | + debugpointG = new Sphere(); |
---|
| 11506 | + debugpointP = new Sphere(); |
---|
| 11507 | + debugpointC = new Sphere(); |
---|
| 11508 | + debugpointR = new Sphere(); |
---|
| 11509 | + |
---|
| 11510 | + selectedpoint = new Superellipsoid(); |
---|
| 11511 | + |
---|
| 11512 | + for (int i=0; i<8; i++) |
---|
| 11513 | + { |
---|
| 11514 | + debugpoints[i] = new Sphere(); |
---|
| 11515 | + } |
---|
| 11516 | + } |
---|
| 11517 | + } |
---|
| 11518 | + |
---|
11329 | 11519 | void DrawObject(GL gl, boolean draw) |
---|
11330 | 11520 | { |
---|
| 11521 | + // To clear camera values |
---|
| 11522 | + ResetOptions(); |
---|
| 11523 | + |
---|
11331 | 11524 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11332 | 11525 | // DrawMode() = SELECTION; |
---|
11333 | 11526 | //GL gl = getGL(); |
---|
11334 | 11527 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11335 | 11528 | { |
---|
11336 | 11529 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11337 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11530 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11338 | 11531 | pingthread.StepToTarget(true); // true); |
---|
11339 | 11532 | // zoomonce = false; |
---|
11340 | 11533 | } |
---|
.. | .. |
---|
11406 | 11599 | |
---|
11407 | 11600 | if (DrawMode() == DEFAULT) |
---|
11408 | 11601 | { |
---|
11409 | | - if (DEBUG) |
---|
| 11602 | + if (Globals.DEBUG) |
---|
11410 | 11603 | { |
---|
| 11604 | + CreateSelectedPoint(); |
---|
11411 | 11605 | float radius = 0.05f; |
---|
11412 | 11606 | if (selectedpoint.radius != radius) |
---|
11413 | 11607 | { |
---|
.. | .. |
---|
11894 | 12088 | for (int i = tp.size(); --i >= 0;) |
---|
11895 | 12089 | { |
---|
11896 | 12090 | //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
11897 | | - LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
| 12091 | + LA.xformPos(light, tp.get(i).GlobalTransformInv(), light); |
---|
11898 | 12092 | } |
---|
11899 | 12093 | |
---|
11900 | 12094 | |
---|
.. | .. |
---|
13164 | 13358 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13165 | 13359 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13166 | 13360 | /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
13167 | | - Object3D.cVector2[] vector2buffer; |
---|
| 13361 | + |
---|
| 13362 | + //Object3D.cVector2[] vector2buffer; |
---|
13168 | 13363 | |
---|
13169 | 13364 | // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea |
---|
13170 | 13365 | // OUT : diff, spec |
---|
.. | .. |
---|
13180 | 13375 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13181 | 13376 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13182 | 13377 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13183 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13184 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13185 | | - //"MOV " + dest + ".z," + "params2.w;" + |
---|
| 13378 | +// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET |
---|
| 13379 | +// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
| 13380 | + |
---|
| 13381 | + "MOV " + dest + ".z," + "params2.w;" + // EXACT |
---|
13186 | 13382 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13187 | 13383 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13188 | 13384 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13687 | 13883 | else |
---|
13688 | 13884 | if (evt.getSource() == AAtimer) |
---|
13689 | 13885 | { |
---|
| 13886 | + Globals.TIMERRUNNING = false; |
---|
13690 | 13887 | if (mouseDown) |
---|
13691 | 13888 | { |
---|
13692 | 13889 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13746 | 13943 | |
---|
13747 | 13944 | // fev 2014??? |
---|
13748 | 13945 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13749 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13946 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13750 | 13947 | pingthread.StepToTarget(true); // true); |
---|
13751 | 13948 | } |
---|
13752 | 13949 | // if (!LIVE) |
---|
.. | .. |
---|
13761 | 13958 | return; |
---|
13762 | 13959 | |
---|
13763 | 13960 | AAtimer.restart(); // |
---|
| 13961 | + Globals.TIMERRUNNING = true; |
---|
13764 | 13962 | |
---|
13765 | 13963 | // waslive = LIVE; |
---|
13766 | 13964 | // LIVE = false; |
---|
.. | .. |
---|
14099 | 14297 | void GoDown(int mod) |
---|
14100 | 14298 | { |
---|
14101 | 14299 | MODIFIERS |= COMMAND; |
---|
14102 | | - /* |
---|
| 14300 | + /**/ |
---|
14103 | 14301 | if((mod&SHIFT) == SHIFT) |
---|
14104 | 14302 | manipCamera.RotatePosition(0, -speed); |
---|
14105 | 14303 | else |
---|
14106 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14107 | | - */ |
---|
| 14304 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14305 | + /**/ |
---|
14108 | 14306 | if ((mod & SHIFT) == SHIFT) |
---|
14109 | 14307 | { |
---|
14110 | 14308 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14120 | 14318 | void GoUp(int mod) |
---|
14121 | 14319 | { |
---|
14122 | 14320 | MODIFIERS |= COMMAND; |
---|
14123 | | - /* |
---|
| 14321 | + /**/ |
---|
14124 | 14322 | if((mod&SHIFT) == SHIFT) |
---|
14125 | 14323 | manipCamera.RotatePosition(0, speed); |
---|
14126 | 14324 | else |
---|
14127 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14128 | | - */ |
---|
| 14325 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14326 | + /**/ |
---|
14129 | 14327 | if ((mod & SHIFT) == SHIFT) |
---|
14130 | 14328 | { |
---|
14131 | 14329 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14141 | 14339 | void GoLeft(int mod) |
---|
14142 | 14340 | { |
---|
14143 | 14341 | MODIFIERS |= COMMAND; |
---|
14144 | | - /* |
---|
| 14342 | + /**/ |
---|
14145 | 14343 | if((mod&SHIFT) == SHIFT) |
---|
14146 | | - manipCamera.RotatePosition(speed, 0); |
---|
14147 | | - else |
---|
14148 | 14344 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14149 | | - */ |
---|
| 14345 | + else |
---|
| 14346 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14347 | + /**/ |
---|
14150 | 14348 | if ((mod & SHIFT) == SHIFT) |
---|
14151 | 14349 | { |
---|
14152 | 14350 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14162 | 14360 | void GoRight(int mod) |
---|
14163 | 14361 | { |
---|
14164 | 14362 | MODIFIERS |= COMMAND; |
---|
14165 | | - /* |
---|
| 14363 | + /**/ |
---|
14166 | 14364 | if((mod&SHIFT) == SHIFT) |
---|
14167 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14168 | | - else |
---|
14169 | 14365 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14170 | | - */ |
---|
| 14366 | + else |
---|
| 14367 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14368 | + /**/ |
---|
14171 | 14369 | if ((mod & SHIFT) == SHIFT) |
---|
14172 | 14370 | { |
---|
14173 | 14371 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14224 | 14422 | info.camera = renderCamera; |
---|
14225 | 14423 | info.x = x; |
---|
14226 | 14424 | info.y = y; |
---|
14227 | | - object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
| 14425 | + object.GetWindow().copy |
---|
| 14426 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14228 | 14427 | } else |
---|
14229 | 14428 | { |
---|
14230 | 14429 | if (x < startX) |
---|
.. | .. |
---|
14388 | 14587 | ci.camera = renderCamera; |
---|
14389 | 14588 | if (!isRenderer) |
---|
14390 | 14589 | { |
---|
14391 | | - if (object.editWindow.copy.doEditClick(ci, 0)) |
---|
| 14590 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14591 | + //Object3D copy = editWindow.copy; |
---|
| 14592 | + if (object.doEditClick(ci, 0)) |
---|
14392 | 14593 | { |
---|
14393 | 14594 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14394 | 14595 | } else |
---|
.. | .. |
---|
14403 | 14604 | Globals.MOUSEDRAGGED = false; |
---|
14404 | 14605 | |
---|
14405 | 14606 | movingcamera = false; |
---|
14406 | | - X = Y = 0; |
---|
| 14607 | + X = 0; // getBounds().width/2; |
---|
| 14608 | + Y = 0; // getBounds().height/2; |
---|
14407 | 14609 | //System.out.println("mouseReleased: " + e); |
---|
14408 | 14610 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14409 | 14611 | } |
---|
.. | .. |
---|
14744 | 14946 | case 'E' : COMPACT ^= true; |
---|
14745 | 14947 | repaint(); |
---|
14746 | 14948 | break; |
---|
14747 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14949 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14950 | + //DEBUGHSB ^= true; |
---|
| 14951 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14748 | 14952 | repaint(); |
---|
14749 | 14953 | break; |
---|
14750 | 14954 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14769 | 14973 | RevertCamera(); |
---|
14770 | 14974 | repaint(); |
---|
14771 | 14975 | break; |
---|
14772 | | - case 'L': |
---|
14773 | 14976 | case 'l': |
---|
| 14977 | + //case 'L': |
---|
14774 | 14978 | if (lightMode) |
---|
14775 | 14979 | { |
---|
14776 | 14980 | lightMode = false; |
---|
.. | .. |
---|
14913 | 15117 | case '_': |
---|
14914 | 15118 | kompactbit = 5; |
---|
14915 | 15119 | break; |
---|
14916 | | - case '+': |
---|
14917 | | - kompactbit = 6; |
---|
14918 | | - break; |
---|
| 15120 | +// case '+': |
---|
| 15121 | +// kompactbit = 6; |
---|
| 15122 | +// break; |
---|
14919 | 15123 | case ' ': |
---|
14920 | 15124 | lightMode ^= true; |
---|
14921 | 15125 | Globals.lighttouched = true; |
---|
.. | .. |
---|
14927 | 15131 | case ESC: |
---|
14928 | 15132 | RENDERPROGRAM += 1; |
---|
14929 | 15133 | RENDERPROGRAM %= 3; |
---|
| 15134 | + |
---|
14930 | 15135 | repaint(); |
---|
14931 | 15136 | break; |
---|
14932 | 15137 | case 'Z': |
---|
.. | .. |
---|
14966 | 15171 | case DELETE: |
---|
14967 | 15172 | ClearSelection(); |
---|
14968 | 15173 | break; |
---|
14969 | | - /* |
---|
14970 | 15174 | case '+': |
---|
| 15175 | + |
---|
| 15176 | + /* |
---|
14971 | 15177 | //fontsize += 1; |
---|
14972 | 15178 | bbzoom *= 2; |
---|
14973 | 15179 | repaint(); |
---|
.. | .. |
---|
14984 | 15190 | case '=': |
---|
14985 | 15191 | IncDepth(); |
---|
14986 | 15192 | //fontsize += 1; |
---|
14987 | | - object.editWindow.refreshContents(true); |
---|
| 15193 | + object.GetWindow().refreshContents(true); |
---|
14988 | 15194 | maskbit = 6; |
---|
14989 | 15195 | break; |
---|
14990 | 15196 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
14991 | 15197 | DecDepth(); |
---|
14992 | 15198 | maskbit = 5; |
---|
14993 | 15199 | //if(fontsize > 1) fontsize -= 1; |
---|
14994 | | - if (object.editWindow == null) |
---|
14995 | | - new Exception().printStackTrace(); |
---|
14996 | | - else |
---|
14997 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | +// if (object.editWindow == null) |
---|
| 15201 | +// new Exception().printStackTrace(); |
---|
| 15202 | +// else |
---|
| 15203 | + object.GetWindow().refreshContents(true); |
---|
14998 | 15204 | break; |
---|
14999 | 15205 | case '{': |
---|
15000 | 15206 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15218 | 15424 | } |
---|
15219 | 15425 | */ |
---|
15220 | 15426 | |
---|
15221 | | - object.editWindow.EditSelection(); |
---|
| 15427 | + object.GetWindow().EditSelection(false); |
---|
15222 | 15428 | } |
---|
15223 | 15429 | |
---|
15224 | 15430 | void SelectParent() |
---|
.. | .. |
---|
15235 | 15441 | { |
---|
15236 | 15442 | //selectees.remove(i); |
---|
15237 | 15443 | System.out.println("select parent of " + elem); |
---|
15238 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15444 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15239 | 15445 | } else |
---|
15240 | 15446 | { |
---|
15241 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15447 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15242 | 15448 | } |
---|
15243 | 15449 | |
---|
15244 | 15450 | first = false; |
---|
.. | .. |
---|
15280 | 15486 | for (int j = 0; j < group.children.size(); j++) |
---|
15281 | 15487 | { |
---|
15282 | 15488 | elem = (Object3D) group.children.elementAt(j); |
---|
15283 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15489 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15284 | 15490 | first = false; |
---|
15285 | 15491 | } |
---|
15286 | 15492 | } else |
---|
15287 | 15493 | { |
---|
15288 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15494 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15289 | 15495 | } |
---|
15290 | 15496 | |
---|
15291 | 15497 | first = false; |
---|
.. | .. |
---|
15296 | 15502 | { |
---|
15297 | 15503 | //Composite group = (Composite) object; |
---|
15298 | 15504 | Object3D group = object; |
---|
15299 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15505 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15300 | 15506 | } |
---|
15301 | 15507 | |
---|
15302 | 15508 | void ResetTransform(int mask) |
---|
15303 | 15509 | { |
---|
15304 | 15510 | //Composite group = (Composite) object; |
---|
15305 | 15511 | Object3D group = object; |
---|
15306 | | - group.editWindow.ResetTransform(mask); |
---|
| 15512 | + group.GetWindow().ResetTransform(mask); |
---|
15307 | 15513 | } |
---|
15308 | 15514 | |
---|
15309 | 15515 | void FlipTransform() |
---|
15310 | 15516 | { |
---|
15311 | 15517 | //Composite group = (Composite) object; |
---|
15312 | 15518 | Object3D group = object; |
---|
15313 | | - group.editWindow.FlipTransform(); |
---|
| 15519 | + group.GetWindow().FlipTransform(); |
---|
15314 | 15520 | // group.editWindow.ReduceMesh(true); |
---|
15315 | 15521 | } |
---|
15316 | 15522 | |
---|
.. | .. |
---|
15318 | 15524 | { |
---|
15319 | 15525 | //Composite group = (Composite) object; |
---|
15320 | 15526 | Object3D group = object; |
---|
15321 | | - group.editWindow.PrintMemory(); |
---|
| 15527 | + group.GetWindow().PrintMemory(); |
---|
15322 | 15528 | // group.editWindow.ReduceMesh(true); |
---|
15323 | 15529 | } |
---|
15324 | 15530 | |
---|
.. | .. |
---|
15326 | 15532 | { |
---|
15327 | 15533 | //Composite group = (Composite) object; |
---|
15328 | 15534 | Object3D group = object; |
---|
15329 | | - group.editWindow.ResetCentroid(); |
---|
| 15535 | + group.GetWindow().ResetCentroid(); |
---|
15330 | 15536 | } |
---|
15331 | 15537 | |
---|
15332 | 15538 | void IncDepth() |
---|
.. | .. |
---|
15511 | 15717 | */ |
---|
15512 | 15718 | if (!isRenderer) |
---|
15513 | 15719 | { |
---|
15514 | | - object.drawEditHandles(info, 0); |
---|
15515 | | - |
---|
15516 | | - if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15720 | + if (object.selection.Size() > 0) |
---|
15517 | 15721 | { |
---|
15518 | | - switch (object.selection.get(0).hitSomething) |
---|
| 15722 | + int hitSomething = object.selection.get(0).hitSomething; |
---|
| 15723 | + |
---|
| 15724 | + info.DX = 0; |
---|
| 15725 | + info.DY = 0; |
---|
| 15726 | + info.W = 1; |
---|
| 15727 | + if (hitSomething == Object3D.hitCenter) |
---|
15519 | 15728 | { |
---|
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; |
---|
| 15729 | + info.DX = X; |
---|
| 15730 | + if (X != 0) |
---|
| 15731 | + info.DX -= info.bounds.width/2; |
---|
| 15732 | + |
---|
| 15733 | + info.DY = Y; |
---|
| 15734 | + if (Y != 0) |
---|
| 15735 | + info.DY -= info.bounds.height/2; |
---|
15529 | 15736 | } |
---|
15530 | | - |
---|
| 15737 | + |
---|
| 15738 | + object.drawEditHandles(info, 0); |
---|
| 15739 | + |
---|
| 15740 | + if (drag && (X != 0 || Y != 0)) |
---|
| 15741 | + { |
---|
| 15742 | + switch (hitSomething) |
---|
| 15743 | + { |
---|
| 15744 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15745 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15746 | + break; |
---|
| 15747 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15748 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15749 | + break; |
---|
| 15750 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15751 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15752 | + break; |
---|
| 15753 | + } |
---|
| 15754 | + |
---|
| 15755 | + } |
---|
15531 | 15756 | } |
---|
15532 | 15757 | } |
---|
15533 | 15758 | } |
---|
.. | .. |
---|
16230 | 16455 | cStatic.objectstack[materialdepth++] = checker; |
---|
16231 | 16456 | //System.out.println("material " + material); |
---|
16232 | 16457 | //Applet3D.tracein(this, selected); |
---|
16233 | | - vector2buffer = checker.projectedVertices; |
---|
| 16458 | + //vector2buffer = checker.projectedVertices; |
---|
16234 | 16459 | |
---|
16235 | 16460 | //checker.GetMaterial().Draw(this, false); // true); |
---|
16236 | | - DrawMaterial(checker.GetMaterial(), false); // true); |
---|
| 16461 | + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true); |
---|
16237 | 16462 | |
---|
16238 | 16463 | materialdepth -= 1; |
---|
16239 | 16464 | if (materialdepth > 0) |
---|
16240 | 16465 | { |
---|
16241 | | - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
16242 | | - DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 16466 | + //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 16467 | + DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
16243 | 16468 | } |
---|
16244 | 16469 | //checker.GetMaterial().opacity = 1f; |
---|
16245 | 16470 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
16463 | 16688 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16464 | 16689 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
16465 | 16690 | |
---|
| 16691 | + CreateSelectedPoint(); |
---|
| 16692 | + |
---|
16466 | 16693 | // Will fit the mesh !!! |
---|
16467 | 16694 | selectedpoint.toParent[0][0] = 0.0001; |
---|
16468 | 16695 | selectedpoint.toParent[1][1] = 0.0001; |
---|
.. | .. |
---|
16516 | 16743 | } |
---|
16517 | 16744 | |
---|
16518 | 16745 | if (!movingcamera && !PAINTMODE) |
---|
16519 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16746 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16520 | 16747 | |
---|
16521 | 16748 | if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16522 | 16749 | { |
---|
.. | .. |
---|
16528 | 16755 | |
---|
16529 | 16756 | group.add(paintobj); // link |
---|
16530 | 16757 | |
---|
16531 | | - object.editWindow.SnapObject(group); |
---|
| 16758 | + object.GetWindow().SnapObject(group); |
---|
16532 | 16759 | |
---|
16533 | | - Object3D folder = object.editWindow.copy; |
---|
| 16760 | + Object3D folder = object.GetWindow().copy; |
---|
16534 | 16761 | |
---|
16535 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16536 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
| 16762 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16763 | + folder = object.GetWindow().copy.selection.elementAt(0); |
---|
16537 | 16764 | |
---|
16538 | 16765 | folder.add(group); |
---|
16539 | 16766 | |
---|
16540 | | - object.editWindow.ResetModel(); |
---|
16541 | | - object.editWindow.refreshContents(); |
---|
| 16767 | + object.GetWindow().ResetModel(); |
---|
| 16768 | + object.GetWindow().refreshContents(); |
---|
16542 | 16769 | } |
---|
16543 | 16770 | else |
---|
16544 | 16771 | paintcount = 0; |
---|
.. | .. |
---|
16577 | 16804 | //System.out.println("objects[color] = " + objects[color]); |
---|
16578 | 16805 | //objects[color].Select(); |
---|
16579 | 16806 | indexcount = 0; |
---|
| 16807 | + ObjEditor window = object.GetWindow(); |
---|
| 16808 | + if (window != null && deselect) |
---|
| 16809 | + { |
---|
| 16810 | + window.Select(null, deselect, true); |
---|
| 16811 | + } |
---|
16580 | 16812 | object.Select(color, deselect); |
---|
16581 | 16813 | } |
---|
16582 | 16814 | |
---|
.. | .. |
---|
17102 | 17334 | int AAbuffersize = 0; |
---|
17103 | 17335 | |
---|
17104 | 17336 | //double[] selectedpoint = new double[3]; |
---|
17105 | | - static Superellipsoid selectedpoint = new Superellipsoid(); |
---|
| 17337 | + static Superellipsoid selectedpoint; |
---|
17106 | 17338 | static Sphere previousselectedpoint = null; |
---|
17107 | | - static Sphere debugpointG = new Sphere(); |
---|
17108 | | - static Sphere debugpointP = new Sphere(); |
---|
17109 | | - static Sphere debugpointC = new Sphere(); |
---|
17110 | | - static Sphere debugpointR = new Sphere(); |
---|
| 17339 | + static Sphere debugpointG; |
---|
| 17340 | + static Sphere debugpointP; |
---|
| 17341 | + static Sphere debugpointC; |
---|
| 17342 | + static Sphere debugpointR; |
---|
17111 | 17343 | |
---|
17112 | 17344 | static Sphere debugpoints[] = new Sphere[8]; |
---|
17113 | 17345 | |
---|
17114 | | - static |
---|
17115 | | - { |
---|
17116 | | - for (int i=0; i<8; i++) |
---|
17117 | | - { |
---|
17118 | | - debugpoints[i] = new Sphere(); |
---|
17119 | | - } |
---|
17120 | | - } |
---|
17121 | | - |
---|
17122 | 17346 | static void InitPoints(float radius) |
---|
17123 | 17347 | { |
---|
17124 | 17348 | for (int i=0; i<8; i++) |
---|