.. | .. |
---|
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 |
---|
.. | .. |
---|
1611 | 1624 | // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
1612 | 1625 | } |
---|
1613 | 1626 | |
---|
1614 | | - void DrawMaterial(cMaterial material, boolean selected) |
---|
| 1627 | + void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others) |
---|
1615 | 1628 | { |
---|
1616 | 1629 | CameraPane display = this; |
---|
1617 | 1630 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
1646 | 1659 | colorV[0] = display.modelParams0[0] * material.diffuse; |
---|
1647 | 1660 | colorV[1] = display.modelParams0[1] * material.diffuse; |
---|
1648 | 1661 | colorV[2] = display.modelParams0[2] * material.diffuse; |
---|
1649 | | - colorV[3] = material.opacity; |
---|
| 1662 | + colorV[3] = 1; // material.opacity; |
---|
1650 | 1663 | |
---|
1651 | 1664 | gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity); |
---|
1652 | 1665 | //System.out.println("Opacity = " + opacity); |
---|
.. | .. |
---|
1754 | 1767 | display.modelParams7[2] = 0; |
---|
1755 | 1768 | display.modelParams7[3] = 0; |
---|
1756 | 1769 | |
---|
1757 | | - display.modelParams6[0] = 100; // criss de bug de bump |
---|
| 1770 | + //display.modelParams6[0] = 100; // criss de bug de bump |
---|
1758 | 1771 | |
---|
1759 | | - Object3D.cVector2[] extparams = display.vector2buffer; |
---|
| 1772 | + Object3D.cVector2[] extparams = others; // display.vector2buffer; |
---|
1760 | 1773 | if (extparams != null && extparams.length > 0 && extparams[0] != null) |
---|
1761 | 1774 | { |
---|
1762 | 1775 | display.modelParams6[0] = extparams[0].x / 1000.0f; // bump |
---|
.. | .. |
---|
2052 | 2065 | //System.err.println("Oeil on"); |
---|
2053 | 2066 | OEIL = true; |
---|
2054 | 2067 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2055 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2068 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2056 | 2069 | //pingthread.StepToTarget(true); |
---|
2057 | 2070 | } |
---|
2058 | 2071 | |
---|
.. | .. |
---|
2267 | 2280 | |
---|
2268 | 2281 | void ToggleDebug() |
---|
2269 | 2282 | { |
---|
2270 | | - DEBUG ^= true; |
---|
| 2283 | + Globals.DEBUG ^= true; |
---|
2271 | 2284 | } |
---|
2272 | 2285 | |
---|
2273 | 2286 | void ToggleLookAt() |
---|
.. | .. |
---|
2285 | 2298 | HANDLES ^= true; |
---|
2286 | 2299 | } |
---|
2287 | 2300 | |
---|
| 2301 | + Object3D paintFolder; |
---|
| 2302 | + |
---|
2288 | 2303 | void TogglePaint() |
---|
2289 | 2304 | { |
---|
2290 | 2305 | PAINTMODE ^= true; |
---|
2291 | 2306 | paintcount = 0; |
---|
| 2307 | + |
---|
| 2308 | + if (PAINTMODE) |
---|
| 2309 | + { |
---|
| 2310 | + paintFolder = GetFolder(); |
---|
| 2311 | + } |
---|
2292 | 2312 | } |
---|
2293 | 2313 | |
---|
2294 | 2314 | void SwapCamera(int a, int b) |
---|
.. | .. |
---|
7910 | 7930 | String pigment = Object3D.GetPigment(tex); |
---|
7911 | 7931 | String bump = Object3D.GetBump(tex); |
---|
7912 | 7932 | |
---|
7913 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7933 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7914 | 7934 | { |
---|
7915 | 7935 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7916 | 7936 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7944 | 7964 | |
---|
7945 | 7965 | String pigment = Object3D.GetPigment(tex); |
---|
7946 | 7966 | |
---|
7947 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7967 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7948 | 7968 | { |
---|
7949 | 7969 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7950 | 7970 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7973 | 7993 | |
---|
7974 | 7994 | String bump = Object3D.GetBump(tex); |
---|
7975 | 7995 | |
---|
7976 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7996 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7977 | 7997 | { |
---|
7978 | 7998 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7979 | 7999 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8111 | 8131 | usedtextures.put(pigment, pigment); |
---|
8112 | 8132 | usedtextures.put(bump, bump); |
---|
8113 | 8133 | |
---|
8114 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8134 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8115 | 8135 | { |
---|
8116 | 8136 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8117 | 8137 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8153 | 8173 | |
---|
8154 | 8174 | usedtextures.put(pigment, pigment); |
---|
8155 | 8175 | |
---|
8156 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8176 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8157 | 8177 | { |
---|
8158 | 8178 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8159 | 8179 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8186 | 8206 | |
---|
8187 | 8207 | usedtextures.put(bump, bump); |
---|
8188 | 8208 | |
---|
8189 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8209 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8190 | 8210 | { |
---|
8191 | 8211 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8192 | 8212 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8497 | 8517 | return false; |
---|
8498 | 8518 | } |
---|
8499 | 8519 | |
---|
8500 | | - boolean newtex = false; |
---|
| 8520 | + //boolean newtex = false; |
---|
8501 | 8521 | |
---|
8502 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8503 | 8523 | |
---|
.. | .. |
---|
8529 | 8549 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT); |
---|
8530 | 8550 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT); |
---|
8531 | 8551 | |
---|
8532 | | - return newtex; |
---|
| 8552 | + return true; // Warning: not used. |
---|
8533 | 8553 | } |
---|
8534 | 8554 | |
---|
8535 | 8555 | ShadowBuffer shadowPBuf; |
---|
.. | .. |
---|
9367 | 9387 | jy8[3] = 0.5f; |
---|
9368 | 9388 | } |
---|
9369 | 9389 | |
---|
9370 | | - float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
| 9390 | + float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV |
---|
9371 | 9391 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9372 | 9392 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9373 | 9393 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9374 | 9394 | |
---|
| 9395 | + void ResetOptions() |
---|
| 9396 | + { |
---|
| 9397 | + options1[0] = 100; |
---|
| 9398 | + options1[1] = 0.025f; |
---|
| 9399 | + options1[2] = 0.01f; |
---|
| 9400 | + options1[3] = 0; |
---|
| 9401 | + options1[4] = 0; |
---|
| 9402 | + |
---|
| 9403 | + options2[0] = 0; |
---|
| 9404 | + options2[1] = 0.75f; |
---|
| 9405 | + options2[2] = 0; |
---|
| 9406 | + options2[3] = 0; |
---|
| 9407 | + |
---|
| 9408 | + options3[0] = 1; |
---|
| 9409 | + options3[1] = 1; |
---|
| 9410 | + options3[2] = 1; |
---|
| 9411 | + options3[3] = 0; |
---|
| 9412 | + |
---|
| 9413 | + options4[0] = 1; |
---|
| 9414 | + options4[1] = 0; |
---|
| 9415 | + options4[2] = 1; |
---|
| 9416 | + options4[3] = 0; |
---|
| 9417 | + } |
---|
| 9418 | + |
---|
9375 | 9419 | static int imagecount = 0; // movie generation |
---|
9376 | 9420 | |
---|
9377 | 9421 | static int jitter = 0; |
---|
.. | .. |
---|
10482 | 10526 | ANTIALIAS = 0; |
---|
10483 | 10527 | //System.out.println("RESTART"); |
---|
10484 | 10528 | AAtimer.restart(); |
---|
| 10529 | + Globals.TIMERRUNNING = true; |
---|
10485 | 10530 | } |
---|
10486 | 10531 | } |
---|
10487 | 10532 | } |
---|
.. | .. |
---|
10549 | 10594 | ambientOcclusion = false; |
---|
10550 | 10595 | } |
---|
10551 | 10596 | |
---|
10552 | | - if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
| 10597 | + if (//Globals.lighttouched && |
---|
| 10598 | + DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN) |
---|
10553 | 10599 | { |
---|
10554 | 10600 | //if (RENDERSHADOW) // ? |
---|
10555 | 10601 | if (!IsFrozen()) |
---|
.. | .. |
---|
10989 | 11035 | |
---|
10990 | 11036 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
10991 | 11037 | |
---|
10992 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
10993 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
10994 | | -//gl.glEnable(gl.GL_MULTISAMPLE); |
---|
| 11038 | +gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
| 11039 | +gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
| 11040 | +gl.glEnable(gl.GL_MULTISAMPLE); |
---|
10995 | 11041 | } else |
---|
10996 | 11042 | { |
---|
10997 | 11043 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11002 | 11048 | //System.out.println("BLENDING ON"); |
---|
11003 | 11049 | gl.glEnable(GL.GL_BLEND); |
---|
11004 | 11050 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
11005 | | - |
---|
| 11051 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
11006 | 11052 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
11007 | 11053 | gl.glLoadIdentity(); |
---|
11008 | 11054 | |
---|
.. | .. |
---|
11459 | 11505 | |
---|
11460 | 11506 | static boolean zoomonce = false; |
---|
11461 | 11507 | |
---|
| 11508 | + static void CreateSelectedPoint() |
---|
| 11509 | + { |
---|
| 11510 | + if (selectedpoint == null) |
---|
| 11511 | + { |
---|
| 11512 | + debugpointG = new Sphere(); |
---|
| 11513 | + debugpointP = new Sphere(); |
---|
| 11514 | + debugpointC = new Sphere(); |
---|
| 11515 | + debugpointR = new Sphere(); |
---|
| 11516 | + |
---|
| 11517 | + selectedpoint = new Superellipsoid(); |
---|
| 11518 | + |
---|
| 11519 | + for (int i=0; i<8; i++) |
---|
| 11520 | + { |
---|
| 11521 | + debugpoints[i] = new Sphere(); |
---|
| 11522 | + } |
---|
| 11523 | + } |
---|
| 11524 | + } |
---|
| 11525 | + |
---|
11462 | 11526 | void DrawObject(GL gl, boolean draw) |
---|
11463 | 11527 | { |
---|
| 11528 | + // To clear camera values |
---|
| 11529 | + ResetOptions(); |
---|
| 11530 | + |
---|
11464 | 11531 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11465 | 11532 | // DrawMode() = SELECTION; |
---|
11466 | 11533 | //GL gl = getGL(); |
---|
11467 | 11534 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11468 | 11535 | { |
---|
11469 | 11536 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11470 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11537 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11471 | 11538 | pingthread.StepToTarget(true); // true); |
---|
11472 | 11539 | // zoomonce = false; |
---|
11473 | 11540 | } |
---|
.. | .. |
---|
11539 | 11606 | |
---|
11540 | 11607 | if (DrawMode() == DEFAULT) |
---|
11541 | 11608 | { |
---|
11542 | | - if (DEBUG) |
---|
| 11609 | + if (Globals.DEBUG) |
---|
11543 | 11610 | { |
---|
| 11611 | + CreateSelectedPoint(); |
---|
11544 | 11612 | float radius = 0.05f; |
---|
11545 | 11613 | if (selectedpoint.radius != radius) |
---|
11546 | 11614 | { |
---|
.. | .. |
---|
12027 | 12095 | for (int i = tp.size(); --i >= 0;) |
---|
12028 | 12096 | { |
---|
12029 | 12097 | //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
12030 | | - LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
| 12098 | + LA.xformPos(light, tp.get(i).GlobalTransformInv(), light); |
---|
12031 | 12099 | } |
---|
12032 | 12100 | |
---|
12033 | 12101 | |
---|
.. | .. |
---|
13297 | 13365 | /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias |
---|
13298 | 13366 | /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough |
---|
13299 | 13367 | /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power |
---|
13300 | | - Object3D.cVector2[] vector2buffer; |
---|
| 13368 | + |
---|
| 13369 | + //Object3D.cVector2[] vector2buffer; |
---|
13301 | 13370 | |
---|
13302 | 13371 | // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea |
---|
13303 | 13372 | // OUT : diff, spec |
---|
.. | .. |
---|
13313 | 13382 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13314 | 13383 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13315 | 13384 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13316 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13317 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13318 | | - //"MOV " + dest + ".z," + "params2.w;" + |
---|
| 13385 | +// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET |
---|
| 13386 | +// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
| 13387 | + |
---|
| 13388 | + "MOV " + dest + ".z," + "params2.w;" + // EXACT |
---|
13319 | 13389 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13320 | 13390 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13321 | 13391 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13820 | 13890 | else |
---|
13821 | 13891 | if (evt.getSource() == AAtimer) |
---|
13822 | 13892 | { |
---|
| 13893 | + Globals.TIMERRUNNING = false; |
---|
13823 | 13894 | if (mouseDown) |
---|
13824 | 13895 | { |
---|
13825 | 13896 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13879 | 13950 | |
---|
13880 | 13951 | // fev 2014??? |
---|
13881 | 13952 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13882 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13953 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13883 | 13954 | pingthread.StepToTarget(true); // true); |
---|
13884 | 13955 | } |
---|
13885 | 13956 | // if (!LIVE) |
---|
.. | .. |
---|
13894 | 13965 | return; |
---|
13895 | 13966 | |
---|
13896 | 13967 | AAtimer.restart(); // |
---|
| 13968 | + Globals.TIMERRUNNING = true; |
---|
13897 | 13969 | |
---|
13898 | 13970 | // waslive = LIVE; |
---|
13899 | 13971 | // LIVE = false; |
---|
.. | .. |
---|
14232 | 14304 | void GoDown(int mod) |
---|
14233 | 14305 | { |
---|
14234 | 14306 | MODIFIERS |= COMMAND; |
---|
14235 | | - /* |
---|
| 14307 | + /**/ |
---|
14236 | 14308 | if((mod&SHIFT) == SHIFT) |
---|
14237 | 14309 | manipCamera.RotatePosition(0, -speed); |
---|
14238 | 14310 | else |
---|
14239 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14240 | | - */ |
---|
| 14311 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14312 | + /**/ |
---|
14241 | 14313 | if ((mod & SHIFT) == SHIFT) |
---|
14242 | 14314 | { |
---|
14243 | 14315 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14253 | 14325 | void GoUp(int mod) |
---|
14254 | 14326 | { |
---|
14255 | 14327 | MODIFIERS |= COMMAND; |
---|
14256 | | - /* |
---|
| 14328 | + /**/ |
---|
14257 | 14329 | if((mod&SHIFT) == SHIFT) |
---|
14258 | 14330 | manipCamera.RotatePosition(0, speed); |
---|
14259 | 14331 | else |
---|
14260 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14261 | | - */ |
---|
| 14332 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14333 | + /**/ |
---|
14262 | 14334 | if ((mod & SHIFT) == SHIFT) |
---|
14263 | 14335 | { |
---|
14264 | 14336 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14274 | 14346 | void GoLeft(int mod) |
---|
14275 | 14347 | { |
---|
14276 | 14348 | MODIFIERS |= COMMAND; |
---|
14277 | | - /* |
---|
| 14349 | + /**/ |
---|
14278 | 14350 | if((mod&SHIFT) == SHIFT) |
---|
14279 | | - manipCamera.RotatePosition(speed, 0); |
---|
14280 | | - else |
---|
14281 | 14351 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14282 | | - */ |
---|
| 14352 | + else |
---|
| 14353 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14354 | + /**/ |
---|
14283 | 14355 | if ((mod & SHIFT) == SHIFT) |
---|
14284 | 14356 | { |
---|
14285 | 14357 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14295 | 14367 | void GoRight(int mod) |
---|
14296 | 14368 | { |
---|
14297 | 14369 | MODIFIERS |= COMMAND; |
---|
14298 | | - /* |
---|
| 14370 | + /**/ |
---|
14299 | 14371 | if((mod&SHIFT) == SHIFT) |
---|
14300 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14301 | | - else |
---|
14302 | 14372 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14303 | | - */ |
---|
| 14373 | + else |
---|
| 14374 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14375 | + /**/ |
---|
14304 | 14376 | if ((mod & SHIFT) == SHIFT) |
---|
14305 | 14377 | { |
---|
14306 | 14378 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14357 | 14429 | info.camera = renderCamera; |
---|
14358 | 14430 | info.x = x; |
---|
14359 | 14431 | info.y = y; |
---|
14360 | | - object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
| 14432 | + object.GetWindow().copy |
---|
| 14433 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14361 | 14434 | } else |
---|
14362 | 14435 | { |
---|
14363 | 14436 | if (x < startX) |
---|
.. | .. |
---|
14521 | 14594 | ci.camera = renderCamera; |
---|
14522 | 14595 | if (!isRenderer) |
---|
14523 | 14596 | { |
---|
14524 | | - if (object.editWindow.copy.doEditClick(ci, 0)) |
---|
| 14597 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14598 | + //Object3D copy = editWindow.copy; |
---|
| 14599 | + if (object.doEditClick(ci, 0)) |
---|
14525 | 14600 | { |
---|
14526 | 14601 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14527 | 14602 | } else |
---|
.. | .. |
---|
14536 | 14611 | Globals.MOUSEDRAGGED = false; |
---|
14537 | 14612 | |
---|
14538 | 14613 | movingcamera = false; |
---|
14539 | | - X = Y = 0; |
---|
| 14614 | + X = 0; // getBounds().width/2; |
---|
| 14615 | + Y = 0; // getBounds().height/2; |
---|
14540 | 14616 | //System.out.println("mouseReleased: " + e); |
---|
14541 | 14617 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14542 | 14618 | } |
---|
.. | .. |
---|
14877 | 14953 | case 'E' : COMPACT ^= true; |
---|
14878 | 14954 | repaint(); |
---|
14879 | 14955 | break; |
---|
14880 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14956 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14957 | + //DEBUGHSB ^= true; |
---|
| 14958 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14881 | 14959 | repaint(); |
---|
14882 | 14960 | break; |
---|
14883 | 14961 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14902 | 14980 | RevertCamera(); |
---|
14903 | 14981 | repaint(); |
---|
14904 | 14982 | break; |
---|
14905 | | - case 'L': |
---|
14906 | 14983 | case 'l': |
---|
| 14984 | + //case 'L': |
---|
14907 | 14985 | if (lightMode) |
---|
14908 | 14986 | { |
---|
14909 | 14987 | lightMode = false; |
---|
.. | .. |
---|
15046 | 15124 | case '_': |
---|
15047 | 15125 | kompactbit = 5; |
---|
15048 | 15126 | break; |
---|
15049 | | - case '+': |
---|
15050 | | - kompactbit = 6; |
---|
15051 | | - break; |
---|
| 15127 | +// case '+': |
---|
| 15128 | +// kompactbit = 6; |
---|
| 15129 | +// break; |
---|
15052 | 15130 | case ' ': |
---|
15053 | 15131 | lightMode ^= true; |
---|
15054 | 15132 | Globals.lighttouched = true; |
---|
.. | .. |
---|
15060 | 15138 | case ESC: |
---|
15061 | 15139 | RENDERPROGRAM += 1; |
---|
15062 | 15140 | RENDERPROGRAM %= 3; |
---|
| 15141 | + |
---|
15063 | 15142 | repaint(); |
---|
15064 | 15143 | break; |
---|
15065 | 15144 | case 'Z': |
---|
.. | .. |
---|
15099 | 15178 | case DELETE: |
---|
15100 | 15179 | ClearSelection(); |
---|
15101 | 15180 | break; |
---|
15102 | | - /* |
---|
15103 | 15181 | case '+': |
---|
| 15182 | + |
---|
| 15183 | + /* |
---|
15104 | 15184 | //fontsize += 1; |
---|
15105 | 15185 | bbzoom *= 2; |
---|
15106 | 15186 | repaint(); |
---|
.. | .. |
---|
15117 | 15197 | case '=': |
---|
15118 | 15198 | IncDepth(); |
---|
15119 | 15199 | //fontsize += 1; |
---|
15120 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | + object.GetWindow().refreshContents(true); |
---|
15121 | 15201 | maskbit = 6; |
---|
15122 | 15202 | break; |
---|
15123 | 15203 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15124 | 15204 | DecDepth(); |
---|
15125 | 15205 | maskbit = 5; |
---|
15126 | 15206 | //if(fontsize > 1) fontsize -= 1; |
---|
15127 | | - if (object.editWindow == null) |
---|
15128 | | - new Exception().printStackTrace(); |
---|
15129 | | - else |
---|
15130 | | - object.editWindow.refreshContents(true); |
---|
| 15207 | +// if (object.editWindow == null) |
---|
| 15208 | +// new Exception().printStackTrace(); |
---|
| 15209 | +// else |
---|
| 15210 | + object.GetWindow().refreshContents(true); |
---|
15131 | 15211 | break; |
---|
15132 | 15212 | case '{': |
---|
15133 | 15213 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15351 | 15431 | } |
---|
15352 | 15432 | */ |
---|
15353 | 15433 | |
---|
15354 | | - object.editWindow.EditSelection(); |
---|
| 15434 | + object.GetWindow().EditSelection(false); |
---|
15355 | 15435 | } |
---|
15356 | 15436 | |
---|
15357 | 15437 | void SelectParent() |
---|
.. | .. |
---|
15368 | 15448 | { |
---|
15369 | 15449 | //selectees.remove(i); |
---|
15370 | 15450 | System.out.println("select parent of " + elem); |
---|
15371 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15451 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15372 | 15452 | } else |
---|
15373 | 15453 | { |
---|
15374 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15454 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15375 | 15455 | } |
---|
15376 | 15456 | |
---|
15377 | 15457 | first = false; |
---|
.. | .. |
---|
15413 | 15493 | for (int j = 0; j < group.children.size(); j++) |
---|
15414 | 15494 | { |
---|
15415 | 15495 | elem = (Object3D) group.children.elementAt(j); |
---|
15416 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15496 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15417 | 15497 | first = false; |
---|
15418 | 15498 | } |
---|
15419 | 15499 | } else |
---|
15420 | 15500 | { |
---|
15421 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15501 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15422 | 15502 | } |
---|
15423 | 15503 | |
---|
15424 | 15504 | first = false; |
---|
.. | .. |
---|
15429 | 15509 | { |
---|
15430 | 15510 | //Composite group = (Composite) object; |
---|
15431 | 15511 | Object3D group = object; |
---|
15432 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15512 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15433 | 15513 | } |
---|
15434 | 15514 | |
---|
15435 | 15515 | void ResetTransform(int mask) |
---|
15436 | 15516 | { |
---|
15437 | 15517 | //Composite group = (Composite) object; |
---|
15438 | 15518 | Object3D group = object; |
---|
15439 | | - group.editWindow.ResetTransform(mask); |
---|
| 15519 | + group.GetWindow().ResetTransform(mask); |
---|
15440 | 15520 | } |
---|
15441 | 15521 | |
---|
15442 | 15522 | void FlipTransform() |
---|
15443 | 15523 | { |
---|
15444 | 15524 | //Composite group = (Composite) object; |
---|
15445 | 15525 | Object3D group = object; |
---|
15446 | | - group.editWindow.FlipTransform(); |
---|
| 15526 | + group.GetWindow().FlipTransform(); |
---|
15447 | 15527 | // group.editWindow.ReduceMesh(true); |
---|
15448 | 15528 | } |
---|
15449 | 15529 | |
---|
.. | .. |
---|
15451 | 15531 | { |
---|
15452 | 15532 | //Composite group = (Composite) object; |
---|
15453 | 15533 | Object3D group = object; |
---|
15454 | | - group.editWindow.PrintMemory(); |
---|
| 15534 | + group.GetWindow().PrintMemory(); |
---|
15455 | 15535 | // group.editWindow.ReduceMesh(true); |
---|
15456 | 15536 | } |
---|
15457 | 15537 | |
---|
.. | .. |
---|
15459 | 15539 | { |
---|
15460 | 15540 | //Composite group = (Composite) object; |
---|
15461 | 15541 | Object3D group = object; |
---|
15462 | | - group.editWindow.ResetCentroid(); |
---|
| 15542 | + group.GetWindow().ResetCentroid(); |
---|
15463 | 15543 | } |
---|
15464 | 15544 | |
---|
15465 | 15545 | void IncDepth() |
---|
.. | .. |
---|
15635 | 15715 | info.bounds.y += (height - desired) / 2; |
---|
15636 | 15716 | } |
---|
15637 | 15717 | } |
---|
| 15718 | + |
---|
15638 | 15719 | info.g = gr; |
---|
15639 | 15720 | info.camera = renderCamera; |
---|
15640 | 15721 | /* |
---|
.. | .. |
---|
15644 | 15725 | */ |
---|
15645 | 15726 | if (!isRenderer) |
---|
15646 | 15727 | { |
---|
15647 | | - object.drawEditHandles(info, 0); |
---|
15648 | | - |
---|
15649 | | - if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15728 | + Grafreed.Assert(object != null); |
---|
| 15729 | + Grafreed.Assert(object.selection != null); |
---|
| 15730 | + if (object.selection.Size() > 0) |
---|
15650 | 15731 | { |
---|
15651 | | - switch (object.selection.get(0).hitSomething) |
---|
| 15732 | + int hitSomething = object.selection.get(0).hitSomething; |
---|
| 15733 | + |
---|
| 15734 | + info.DX = 0; |
---|
| 15735 | + info.DY = 0; |
---|
| 15736 | + info.W = 1; |
---|
| 15737 | + if (hitSomething == Object3D.hitCenter) |
---|
15652 | 15738 | { |
---|
15653 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15654 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15655 | | - break; |
---|
15656 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15657 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15658 | | - break; |
---|
15659 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15660 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15661 | | - break; |
---|
| 15739 | + info.DX = X; |
---|
| 15740 | + if (X != 0) |
---|
| 15741 | + info.DX -= info.bounds.width/2; |
---|
| 15742 | + |
---|
| 15743 | + info.DY = Y; |
---|
| 15744 | + if (Y != 0) |
---|
| 15745 | + info.DY -= info.bounds.height/2; |
---|
15662 | 15746 | } |
---|
15663 | | - |
---|
| 15747 | + |
---|
| 15748 | + object.drawEditHandles(info, 0); |
---|
| 15749 | + |
---|
| 15750 | + if (drag && (X != 0 || Y != 0)) |
---|
| 15751 | + { |
---|
| 15752 | + switch (hitSomething) |
---|
| 15753 | + { |
---|
| 15754 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15755 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15756 | + break; |
---|
| 15757 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15758 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15759 | + break; |
---|
| 15760 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15761 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15762 | + break; |
---|
| 15763 | + } |
---|
| 15764 | + |
---|
| 15765 | + } |
---|
15664 | 15766 | } |
---|
15665 | 15767 | } |
---|
15666 | 15768 | } |
---|
.. | .. |
---|
16363 | 16465 | cStatic.objectstack[materialdepth++] = checker; |
---|
16364 | 16466 | //System.out.println("material " + material); |
---|
16365 | 16467 | //Applet3D.tracein(this, selected); |
---|
16366 | | - vector2buffer = checker.projectedVertices; |
---|
| 16468 | + //vector2buffer = checker.projectedVertices; |
---|
16367 | 16469 | |
---|
16368 | 16470 | //checker.GetMaterial().Draw(this, false); // true); |
---|
16369 | | - DrawMaterial(checker.GetMaterial(), false); // true); |
---|
| 16471 | + DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true); |
---|
16370 | 16472 | |
---|
16371 | 16473 | materialdepth -= 1; |
---|
16372 | 16474 | if (materialdepth > 0) |
---|
16373 | 16475 | { |
---|
16374 | | - vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
16375 | | - DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]); |
---|
| 16476 | + //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
| 16477 | + DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices); |
---|
16376 | 16478 | } |
---|
16377 | 16479 | //checker.GetMaterial().opacity = 1f; |
---|
16378 | 16480 | ////checker.GetMaterial().ambient = 1f; |
---|
.. | .. |
---|
16458 | 16560 | } |
---|
16459 | 16561 | } |
---|
16460 | 16562 | |
---|
| 16563 | + private Object3D GetFolder() |
---|
| 16564 | + { |
---|
| 16565 | + Object3D folder = object.GetWindow().copy; |
---|
| 16566 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16567 | + folder = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16568 | + return folder; |
---|
| 16569 | + } |
---|
| 16570 | + |
---|
16461 | 16571 | class SelectBuffer implements GLEventListener |
---|
16462 | 16572 | { |
---|
16463 | 16573 | |
---|
.. | .. |
---|
16537 | 16647 | |
---|
16538 | 16648 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16539 | 16649 | |
---|
| 16650 | + if (PAINTMODE) |
---|
| 16651 | + { |
---|
| 16652 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16653 | + { |
---|
| 16654 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16655 | + |
---|
| 16656 | + // Make what you paint not selectable. |
---|
| 16657 | + paintobj.ResetSelectable(); |
---|
| 16658 | + } |
---|
| 16659 | + } |
---|
| 16660 | + |
---|
16540 | 16661 | //int tmp = selection_view; |
---|
16541 | 16662 | //selection_view = -1; |
---|
16542 | 16663 | int temp = DrawMode(); |
---|
.. | .. |
---|
16548 | 16669 | // temp = DEFAULT; // patch for selection debug |
---|
16549 | 16670 | Globals.drawMode = temp; // WARNING |
---|
16550 | 16671 | |
---|
| 16672 | + if (PAINTMODE) |
---|
| 16673 | + { |
---|
| 16674 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16675 | + { |
---|
| 16676 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16677 | + |
---|
| 16678 | + // Revert. |
---|
| 16679 | + paintobj.RestoreSelectable(); |
---|
| 16680 | + } |
---|
| 16681 | + } |
---|
| 16682 | + |
---|
16551 | 16683 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16552 | 16684 | |
---|
16553 | 16685 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16595 | 16727 | // System.err.println("view = " + view[4] + " " + view[5] + " " + view[6] + " " + view[7]); |
---|
16596 | 16728 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16597 | 16729 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
| 16730 | + |
---|
| 16731 | + CreateSelectedPoint(); |
---|
16598 | 16732 | |
---|
16599 | 16733 | // Will fit the mesh !!! |
---|
16600 | 16734 | selectedpoint.toParent[0][0] = 0.0001; |
---|
.. | .. |
---|
16649 | 16783 | } |
---|
16650 | 16784 | |
---|
16651 | 16785 | if (!movingcamera && !PAINTMODE) |
---|
16652 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16786 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16653 | 16787 | |
---|
16654 | | - if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16788 | + if (PAINTMODE) // && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16655 | 16789 | { |
---|
16656 | | - Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
| 16790 | + //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16657 | 16791 | |
---|
16658 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
| 16792 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16793 | + { |
---|
| 16794 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16659 | 16795 | |
---|
16660 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16661 | | - |
---|
16662 | | - group.add(paintobj); // link |
---|
16663 | | - |
---|
16664 | | - object.editWindow.SnapObject(group); |
---|
16665 | | - |
---|
16666 | | - Object3D folder = object.editWindow.copy; |
---|
16667 | | - |
---|
16668 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16669 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
16670 | | - |
---|
16671 | | - folder.add(group); |
---|
16672 | | - |
---|
16673 | | - object.editWindow.ResetModel(); |
---|
16674 | | - object.editWindow.refreshContents(); |
---|
| 16796 | + Object3D inst = new Object3D("inst" + paintcount++); |
---|
| 16797 | + |
---|
| 16798 | + inst.CreateMaterial(); // use a void leaf to select instances |
---|
| 16799 | + |
---|
| 16800 | + inst.add(paintobj); // link |
---|
| 16801 | + |
---|
| 16802 | + object.GetWindow().SnapObject(inst); |
---|
| 16803 | + |
---|
| 16804 | + Object3D folder = paintFolder; // GetFolder(); |
---|
| 16805 | + |
---|
| 16806 | + folder.add(inst); |
---|
| 16807 | + |
---|
| 16808 | + object.GetWindow().ResetModel(); |
---|
| 16809 | + object.GetWindow().refreshContents(); |
---|
| 16810 | + } |
---|
16675 | 16811 | } |
---|
16676 | 16812 | else |
---|
16677 | 16813 | paintcount = 0; |
---|
.. | .. |
---|
16710 | 16846 | //System.out.println("objects[color] = " + objects[color]); |
---|
16711 | 16847 | //objects[color].Select(); |
---|
16712 | 16848 | indexcount = 0; |
---|
| 16849 | + ObjEditor window = object.GetWindow(); |
---|
| 16850 | + if (window != null && deselect) |
---|
| 16851 | + { |
---|
| 16852 | + window.Select(null, deselect, true); |
---|
| 16853 | + } |
---|
16713 | 16854 | object.Select(color, deselect); |
---|
16714 | 16855 | } |
---|
16715 | 16856 | |
---|
.. | .. |
---|
17235 | 17376 | int AAbuffersize = 0; |
---|
17236 | 17377 | |
---|
17237 | 17378 | //double[] selectedpoint = new double[3]; |
---|
17238 | | - static Superellipsoid selectedpoint = new Superellipsoid(); |
---|
| 17379 | + static Superellipsoid selectedpoint; |
---|
17239 | 17380 | static Sphere previousselectedpoint = null; |
---|
17240 | | - static Sphere debugpointG = new Sphere(); |
---|
17241 | | - static Sphere debugpointP = new Sphere(); |
---|
17242 | | - static Sphere debugpointC = new Sphere(); |
---|
17243 | | - static Sphere debugpointR = new Sphere(); |
---|
| 17381 | + static Sphere debugpointG; |
---|
| 17382 | + static Sphere debugpointP; |
---|
| 17383 | + static Sphere debugpointC; |
---|
| 17384 | + static Sphere debugpointR; |
---|
17244 | 17385 | |
---|
17245 | 17386 | static Sphere debugpoints[] = new Sphere[8]; |
---|
17246 | 17387 | |
---|
17247 | | - static |
---|
17248 | | - { |
---|
17249 | | - for (int i=0; i<8; i++) |
---|
17250 | | - { |
---|
17251 | | - debugpoints[i] = new Sphere(); |
---|
17252 | | - } |
---|
17253 | | - } |
---|
17254 | | - |
---|
17255 | 17388 | static void InitPoints(float radius) |
---|
17256 | 17389 | { |
---|
17257 | 17390 | for (int i=0; i<8; i++) |
---|