.. | .. |
---|
335 | 335 | display.options1[2] = material.shadowbias; |
---|
336 | 336 | display.options1[3] = material.aniso; |
---|
337 | 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]); |
---|
338 | 343 | display.options2[0] = material.opacity; |
---|
339 | 344 | display.options2[1] = material.diffuse; |
---|
340 | 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]); |
---|
341 | 349 | |
---|
342 | 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]); |
---|
343 | 354 | display.options4[0] = material.cameralight/0.2f; |
---|
344 | 355 | display.options4[1] = material.subsurface; |
---|
345 | 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]); |
---|
346 | 360 | |
---|
347 | 361 | // if (display.CURRENTANTIALIAS > 0) |
---|
348 | 362 | // display.options3[3] /= 4; |
---|
.. | .. |
---|
2051 | 2065 | //System.err.println("Oeil on"); |
---|
2052 | 2066 | OEIL = true; |
---|
2053 | 2067 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2054 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2068 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2055 | 2069 | //pingthread.StepToTarget(true); |
---|
2056 | 2070 | } |
---|
2057 | 2071 | |
---|
.. | .. |
---|
2284 | 2298 | HANDLES ^= true; |
---|
2285 | 2299 | } |
---|
2286 | 2300 | |
---|
| 2301 | + Object3D paintFolder; |
---|
| 2302 | + |
---|
2287 | 2303 | void TogglePaint() |
---|
2288 | 2304 | { |
---|
2289 | 2305 | PAINTMODE ^= true; |
---|
2290 | 2306 | paintcount = 0; |
---|
| 2307 | + |
---|
| 2308 | + if (PAINTMODE) |
---|
| 2309 | + { |
---|
| 2310 | + paintFolder = GetFolder(); |
---|
| 2311 | + } |
---|
2291 | 2312 | } |
---|
2292 | 2313 | |
---|
2293 | 2314 | void SwapCamera(int a, int b) |
---|
.. | .. |
---|
7909 | 7930 | String pigment = Object3D.GetPigment(tex); |
---|
7910 | 7931 | String bump = Object3D.GetBump(tex); |
---|
7911 | 7932 | |
---|
7912 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7933 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7913 | 7934 | { |
---|
7914 | 7935 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7915 | 7936 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7943 | 7964 | |
---|
7944 | 7965 | String pigment = Object3D.GetPigment(tex); |
---|
7945 | 7966 | |
---|
7946 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7967 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7947 | 7968 | { |
---|
7948 | 7969 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7949 | 7970 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7972 | 7993 | |
---|
7973 | 7994 | String bump = Object3D.GetBump(tex); |
---|
7974 | 7995 | |
---|
7975 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7996 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7976 | 7997 | { |
---|
7977 | 7998 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7978 | 7999 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8110 | 8131 | usedtextures.put(pigment, pigment); |
---|
8111 | 8132 | usedtextures.put(bump, bump); |
---|
8112 | 8133 | |
---|
8113 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8134 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8114 | 8135 | { |
---|
8115 | 8136 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8116 | 8137 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8152 | 8173 | |
---|
8153 | 8174 | usedtextures.put(pigment, pigment); |
---|
8154 | 8175 | |
---|
8155 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8176 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8156 | 8177 | { |
---|
8157 | 8178 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8158 | 8179 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8185 | 8206 | |
---|
8186 | 8207 | usedtextures.put(bump, bump); |
---|
8187 | 8208 | |
---|
8188 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8209 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8189 | 8210 | { |
---|
8190 | 8211 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8191 | 8212 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8496 | 8517 | return false; |
---|
8497 | 8518 | } |
---|
8498 | 8519 | |
---|
8499 | | - boolean newtex = false; |
---|
| 8520 | + //boolean newtex = false; |
---|
8500 | 8521 | |
---|
8501 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8502 | 8523 | |
---|
.. | .. |
---|
8528 | 8549 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT); |
---|
8529 | 8550 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT); |
---|
8530 | 8551 | |
---|
8531 | | - return newtex; |
---|
| 8552 | + return true; // Warning: not used. |
---|
8532 | 8553 | } |
---|
8533 | 8554 | |
---|
8534 | 8555 | ShadowBuffer shadowPBuf; |
---|
.. | .. |
---|
9366 | 9387 | jy8[3] = 0.5f; |
---|
9367 | 9388 | } |
---|
9368 | 9389 | |
---|
9369 | | - 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 |
---|
9370 | 9391 | float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation |
---|
9371 | 9392 | float[] options3 = new float[]{1, 1, 1, 0}; // fog color |
---|
9372 | 9393 | float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen |
---|
9373 | 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 | + |
---|
9374 | 9419 | static int imagecount = 0; // movie generation |
---|
9375 | 9420 | |
---|
9376 | 9421 | static int jitter = 0; |
---|
.. | .. |
---|
10481 | 10526 | ANTIALIAS = 0; |
---|
10482 | 10527 | //System.out.println("RESTART"); |
---|
10483 | 10528 | AAtimer.restart(); |
---|
| 10529 | + Globals.TIMERRUNNING = true; |
---|
10484 | 10530 | } |
---|
10485 | 10531 | } |
---|
10486 | 10532 | } |
---|
.. | .. |
---|
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 | |
---|
11462 | | - void CreateSelectedPoint() |
---|
| 11508 | + static void CreateSelectedPoint() |
---|
11463 | 11509 | { |
---|
11464 | 11510 | if (selectedpoint == null) |
---|
11465 | 11511 | { |
---|
.. | .. |
---|
11479 | 11525 | |
---|
11480 | 11526 | void DrawObject(GL gl, boolean draw) |
---|
11481 | 11527 | { |
---|
| 11528 | + // To clear camera values |
---|
| 11529 | + ResetOptions(); |
---|
| 11530 | + |
---|
11482 | 11531 | //System.out.println("DRAW OBJECT " + mouseDown); |
---|
11483 | 11532 | // DrawMode() = SELECTION; |
---|
11484 | 11533 | //GL gl = getGL(); |
---|
11485 | 11534 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11486 | 11535 | { |
---|
11487 | 11536 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11488 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11537 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11489 | 11538 | pingthread.StepToTarget(true); // true); |
---|
11490 | 11539 | // zoomonce = false; |
---|
11491 | 11540 | } |
---|
.. | .. |
---|
12046 | 12095 | for (int i = tp.size(); --i >= 0;) |
---|
12047 | 12096 | { |
---|
12048 | 12097 | //for (int count = tp.get(i).GetTransformCount(); --count>=0;) |
---|
12049 | | - LA.xformPos(light, tp.get(i).GlobalTransform(), light); |
---|
| 12098 | + LA.xformPos(light, tp.get(i).GlobalTransformInv(), light); |
---|
12050 | 12099 | } |
---|
12051 | 12100 | |
---|
12052 | 12101 | |
---|
.. | .. |
---|
13333 | 13382 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13334 | 13383 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13335 | 13384 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13336 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13337 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13338 | | - //"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 |
---|
13339 | 13389 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13340 | 13390 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13341 | 13391 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13840 | 13890 | else |
---|
13841 | 13891 | if (evt.getSource() == AAtimer) |
---|
13842 | 13892 | { |
---|
| 13893 | + Globals.TIMERRUNNING = false; |
---|
13843 | 13894 | if (mouseDown) |
---|
13844 | 13895 | { |
---|
13845 | 13896 | //new Exception().printStackTrace(); |
---|
.. | .. |
---|
13899 | 13950 | |
---|
13900 | 13951 | // fev 2014??? |
---|
13901 | 13952 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13902 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13953 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13903 | 13954 | pingthread.StepToTarget(true); // true); |
---|
13904 | 13955 | } |
---|
13905 | 13956 | // if (!LIVE) |
---|
.. | .. |
---|
13914 | 13965 | return; |
---|
13915 | 13966 | |
---|
13916 | 13967 | AAtimer.restart(); // |
---|
| 13968 | + Globals.TIMERRUNNING = true; |
---|
13917 | 13969 | |
---|
13918 | 13970 | // waslive = LIVE; |
---|
13919 | 13971 | // LIVE = false; |
---|
.. | .. |
---|
14252 | 14304 | void GoDown(int mod) |
---|
14253 | 14305 | { |
---|
14254 | 14306 | MODIFIERS |= COMMAND; |
---|
14255 | | - /* |
---|
| 14307 | + /**/ |
---|
14256 | 14308 | if((mod&SHIFT) == SHIFT) |
---|
14257 | 14309 | manipCamera.RotatePosition(0, -speed); |
---|
14258 | 14310 | else |
---|
14259 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14260 | | - */ |
---|
| 14311 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14312 | + /**/ |
---|
14261 | 14313 | if ((mod & SHIFT) == SHIFT) |
---|
14262 | 14314 | { |
---|
14263 | 14315 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14273 | 14325 | void GoUp(int mod) |
---|
14274 | 14326 | { |
---|
14275 | 14327 | MODIFIERS |= COMMAND; |
---|
14276 | | - /* |
---|
| 14328 | + /**/ |
---|
14277 | 14329 | if((mod&SHIFT) == SHIFT) |
---|
14278 | 14330 | manipCamera.RotatePosition(0, speed); |
---|
14279 | 14331 | else |
---|
14280 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14281 | | - */ |
---|
| 14332 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14333 | + /**/ |
---|
14282 | 14334 | if ((mod & SHIFT) == SHIFT) |
---|
14283 | 14335 | { |
---|
14284 | 14336 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14294 | 14346 | void GoLeft(int mod) |
---|
14295 | 14347 | { |
---|
14296 | 14348 | MODIFIERS |= COMMAND; |
---|
14297 | | - /* |
---|
| 14349 | + /**/ |
---|
14298 | 14350 | if((mod&SHIFT) == SHIFT) |
---|
14299 | | - manipCamera.RotatePosition(speed, 0); |
---|
14300 | | - else |
---|
14301 | 14351 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14302 | | - */ |
---|
| 14352 | + else |
---|
| 14353 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14354 | + /**/ |
---|
14303 | 14355 | if ((mod & SHIFT) == SHIFT) |
---|
14304 | 14356 | { |
---|
14305 | 14357 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14315 | 14367 | void GoRight(int mod) |
---|
14316 | 14368 | { |
---|
14317 | 14369 | MODIFIERS |= COMMAND; |
---|
14318 | | - /* |
---|
| 14370 | + /**/ |
---|
14319 | 14371 | if((mod&SHIFT) == SHIFT) |
---|
14320 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14321 | | - else |
---|
14322 | 14372 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14323 | | - */ |
---|
| 14373 | + else |
---|
| 14374 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14375 | + /**/ |
---|
14324 | 14376 | if ((mod & SHIFT) == SHIFT) |
---|
14325 | 14377 | { |
---|
14326 | 14378 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14377 | 14429 | info.camera = renderCamera; |
---|
14378 | 14430 | info.x = x; |
---|
14379 | 14431 | info.y = y; |
---|
14380 | | - object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
| 14432 | + object.GetWindow().copy |
---|
| 14433 | + .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0); |
---|
14381 | 14434 | } else |
---|
14382 | 14435 | { |
---|
14383 | 14436 | if (x < startX) |
---|
.. | .. |
---|
14541 | 14594 | ci.camera = renderCamera; |
---|
14542 | 14595 | if (!isRenderer) |
---|
14543 | 14596 | { |
---|
14544 | | - ObjEditor editWindow = object.editWindow; |
---|
14545 | | - Object3D copy = editWindow.copy; |
---|
14546 | | - if (copy.doEditClick(ci, 0)) |
---|
| 14597 | + //ObjEditor editWindow = object.editWindow; |
---|
| 14598 | + //Object3D copy = editWindow.copy; |
---|
| 14599 | + if (object.doEditClick(ci, 0)) |
---|
14547 | 14600 | { |
---|
14548 | 14601 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14549 | 14602 | } else |
---|
.. | .. |
---|
14558 | 14611 | Globals.MOUSEDRAGGED = false; |
---|
14559 | 14612 | |
---|
14560 | 14613 | movingcamera = false; |
---|
14561 | | - X = Y = 0; |
---|
| 14614 | + X = 0; // getBounds().width/2; |
---|
| 14615 | + Y = 0; // getBounds().height/2; |
---|
14562 | 14616 | //System.out.println("mouseReleased: " + e); |
---|
14563 | 14617 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14564 | 14618 | } |
---|
.. | .. |
---|
14899 | 14953 | case 'E' : COMPACT ^= true; |
---|
14900 | 14954 | repaint(); |
---|
14901 | 14955 | break; |
---|
14902 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14956 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14957 | + //DEBUGHSB ^= true; |
---|
| 14958 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14903 | 14959 | repaint(); |
---|
14904 | 14960 | break; |
---|
14905 | 14961 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14925 | 14981 | repaint(); |
---|
14926 | 14982 | break; |
---|
14927 | 14983 | case 'l': |
---|
14928 | | - lightMode ^= true; |
---|
14929 | | - Globals.lighttouched = true; |
---|
14930 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
14931 | | - targetLookAt.set(manipCamera.lookAt); |
---|
14932 | | - repaint(); |
---|
14933 | | - break; |
---|
14934 | | - case 'L': |
---|
| 14984 | + //case 'L': |
---|
14935 | 14985 | if (lightMode) |
---|
14936 | 14986 | { |
---|
14937 | 14987 | lightMode = false; |
---|
.. | .. |
---|
15074 | 15124 | case '_': |
---|
15075 | 15125 | kompactbit = 5; |
---|
15076 | 15126 | break; |
---|
15077 | | - case '+': |
---|
15078 | | - kompactbit = 6; |
---|
15079 | | - break; |
---|
| 15127 | +// case '+': |
---|
| 15128 | +// kompactbit = 6; |
---|
| 15129 | +// break; |
---|
15080 | 15130 | case ' ': |
---|
15081 | | - ObjEditor.theFrame.ToggleFullScreen(); |
---|
| 15131 | + lightMode ^= true; |
---|
| 15132 | + Globals.lighttouched = true; |
---|
| 15133 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 15134 | + targetLookAt.set(manipCamera.lookAt); |
---|
15082 | 15135 | repaint(); |
---|
15083 | 15136 | break; |
---|
15084 | 15137 | //case '`' : |
---|
.. | .. |
---|
15125 | 15178 | case DELETE: |
---|
15126 | 15179 | ClearSelection(); |
---|
15127 | 15180 | break; |
---|
15128 | | - /* |
---|
15129 | 15181 | case '+': |
---|
| 15182 | + |
---|
| 15183 | + /* |
---|
15130 | 15184 | //fontsize += 1; |
---|
15131 | 15185 | bbzoom *= 2; |
---|
15132 | 15186 | repaint(); |
---|
.. | .. |
---|
15143 | 15197 | case '=': |
---|
15144 | 15198 | IncDepth(); |
---|
15145 | 15199 | //fontsize += 1; |
---|
15146 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | + object.GetWindow().refreshContents(true); |
---|
15147 | 15201 | maskbit = 6; |
---|
15148 | 15202 | break; |
---|
15149 | 15203 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15150 | 15204 | DecDepth(); |
---|
15151 | 15205 | maskbit = 5; |
---|
15152 | 15206 | //if(fontsize > 1) fontsize -= 1; |
---|
15153 | | - if (object.editWindow == null) |
---|
15154 | | - new Exception().printStackTrace(); |
---|
15155 | | - else |
---|
15156 | | - object.editWindow.refreshContents(true); |
---|
| 15207 | +// if (object.editWindow == null) |
---|
| 15208 | +// new Exception().printStackTrace(); |
---|
| 15209 | +// else |
---|
| 15210 | + object.GetWindow().refreshContents(true); |
---|
15157 | 15211 | break; |
---|
15158 | 15212 | case '{': |
---|
15159 | 15213 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15377 | 15431 | } |
---|
15378 | 15432 | */ |
---|
15379 | 15433 | |
---|
15380 | | - object.editWindow.EditSelection(); |
---|
| 15434 | + object.GetWindow().EditSelection(false); |
---|
15381 | 15435 | } |
---|
15382 | 15436 | |
---|
15383 | 15437 | void SelectParent() |
---|
.. | .. |
---|
15394 | 15448 | { |
---|
15395 | 15449 | //selectees.remove(i); |
---|
15396 | 15450 | System.out.println("select parent of " + elem); |
---|
15397 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15451 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15398 | 15452 | } else |
---|
15399 | 15453 | { |
---|
15400 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15454 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15401 | 15455 | } |
---|
15402 | 15456 | |
---|
15403 | 15457 | first = false; |
---|
.. | .. |
---|
15439 | 15493 | for (int j = 0; j < group.children.size(); j++) |
---|
15440 | 15494 | { |
---|
15441 | 15495 | elem = (Object3D) group.children.elementAt(j); |
---|
15442 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15496 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15443 | 15497 | first = false; |
---|
15444 | 15498 | } |
---|
15445 | 15499 | } else |
---|
15446 | 15500 | { |
---|
15447 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15501 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15448 | 15502 | } |
---|
15449 | 15503 | |
---|
15450 | 15504 | first = false; |
---|
.. | .. |
---|
15455 | 15509 | { |
---|
15456 | 15510 | //Composite group = (Composite) object; |
---|
15457 | 15511 | Object3D group = object; |
---|
15458 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15512 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15459 | 15513 | } |
---|
15460 | 15514 | |
---|
15461 | 15515 | void ResetTransform(int mask) |
---|
15462 | 15516 | { |
---|
15463 | 15517 | //Composite group = (Composite) object; |
---|
15464 | 15518 | Object3D group = object; |
---|
15465 | | - group.editWindow.ResetTransform(mask); |
---|
| 15519 | + group.GetWindow().ResetTransform(mask); |
---|
15466 | 15520 | } |
---|
15467 | 15521 | |
---|
15468 | 15522 | void FlipTransform() |
---|
15469 | 15523 | { |
---|
15470 | 15524 | //Composite group = (Composite) object; |
---|
15471 | 15525 | Object3D group = object; |
---|
15472 | | - group.editWindow.FlipTransform(); |
---|
| 15526 | + group.GetWindow().FlipTransform(); |
---|
15473 | 15527 | // group.editWindow.ReduceMesh(true); |
---|
15474 | 15528 | } |
---|
15475 | 15529 | |
---|
.. | .. |
---|
15477 | 15531 | { |
---|
15478 | 15532 | //Composite group = (Composite) object; |
---|
15479 | 15533 | Object3D group = object; |
---|
15480 | | - group.editWindow.PrintMemory(); |
---|
| 15534 | + group.GetWindow().PrintMemory(); |
---|
15481 | 15535 | // group.editWindow.ReduceMesh(true); |
---|
15482 | 15536 | } |
---|
15483 | 15537 | |
---|
.. | .. |
---|
15485 | 15539 | { |
---|
15486 | 15540 | //Composite group = (Composite) object; |
---|
15487 | 15541 | Object3D group = object; |
---|
15488 | | - group.editWindow.ResetCentroid(); |
---|
| 15542 | + group.GetWindow().ResetCentroid(); |
---|
15489 | 15543 | } |
---|
15490 | 15544 | |
---|
15491 | 15545 | void IncDepth() |
---|
.. | .. |
---|
15661 | 15715 | info.bounds.y += (height - desired) / 2; |
---|
15662 | 15716 | } |
---|
15663 | 15717 | } |
---|
| 15718 | + |
---|
15664 | 15719 | info.g = gr; |
---|
15665 | 15720 | info.camera = renderCamera; |
---|
15666 | 15721 | /* |
---|
.. | .. |
---|
15670 | 15725 | */ |
---|
15671 | 15726 | if (!isRenderer) |
---|
15672 | 15727 | { |
---|
15673 | | - object.drawEditHandles(info, 0); |
---|
15674 | | - |
---|
15675 | | - 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) |
---|
15676 | 15731 | { |
---|
15677 | | - 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) |
---|
15678 | 15738 | { |
---|
15679 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15680 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15681 | | - break; |
---|
15682 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15683 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15684 | | - break; |
---|
15685 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15686 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15687 | | - 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; |
---|
15688 | 15746 | } |
---|
15689 | | - |
---|
| 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 | + } |
---|
15690 | 15766 | } |
---|
15691 | 15767 | } |
---|
15692 | 15768 | } |
---|
.. | .. |
---|
16484 | 16560 | } |
---|
16485 | 16561 | } |
---|
16486 | 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 | + |
---|
16487 | 16571 | class SelectBuffer implements GLEventListener |
---|
16488 | 16572 | { |
---|
16489 | 16573 | |
---|
.. | .. |
---|
16563 | 16647 | |
---|
16564 | 16648 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16565 | 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 | + |
---|
16566 | 16661 | //int tmp = selection_view; |
---|
16567 | 16662 | //selection_view = -1; |
---|
16568 | 16663 | int temp = DrawMode(); |
---|
.. | .. |
---|
16574 | 16669 | // temp = DEFAULT; // patch for selection debug |
---|
16575 | 16670 | Globals.drawMode = temp; // WARNING |
---|
16576 | 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 | + |
---|
16577 | 16683 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16578 | 16684 | |
---|
16579 | 16685 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16621 | 16727 | // System.err.println("view = " + view[4] + " " + view[5] + " " + view[6] + " " + view[7]); |
---|
16622 | 16728 | // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]); |
---|
16623 | 16729 | // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]); |
---|
| 16730 | + |
---|
| 16731 | + CreateSelectedPoint(); |
---|
16624 | 16732 | |
---|
16625 | 16733 | // Will fit the mesh !!! |
---|
16626 | 16734 | selectedpoint.toParent[0][0] = 0.0001; |
---|
.. | .. |
---|
16675 | 16783 | } |
---|
16676 | 16784 | |
---|
16677 | 16785 | if (!movingcamera && !PAINTMODE) |
---|
16678 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16786 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16679 | 16787 | |
---|
16680 | | - 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) |
---|
16681 | 16789 | { |
---|
16682 | | - 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); |
---|
16683 | 16791 | |
---|
16684 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
| 16792 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16793 | + { |
---|
| 16794 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16685 | 16795 | |
---|
16686 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16687 | | - |
---|
16688 | | - group.add(paintobj); // link |
---|
16689 | | - |
---|
16690 | | - object.editWindow.SnapObject(group); |
---|
16691 | | - |
---|
16692 | | - Object3D folder = object.editWindow.copy; |
---|
16693 | | - |
---|
16694 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16695 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
16696 | | - |
---|
16697 | | - folder.add(group); |
---|
16698 | | - |
---|
16699 | | - object.editWindow.ResetModel(); |
---|
16700 | | - 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 | + } |
---|
16701 | 16811 | } |
---|
16702 | 16812 | else |
---|
16703 | 16813 | paintcount = 0; |
---|
.. | .. |
---|
16736 | 16846 | //System.out.println("objects[color] = " + objects[color]); |
---|
16737 | 16847 | //objects[color].Select(); |
---|
16738 | 16848 | indexcount = 0; |
---|
| 16849 | + ObjEditor window = object.GetWindow(); |
---|
| 16850 | + if (window != null && deselect) |
---|
| 16851 | + { |
---|
| 16852 | + window.Select(null, deselect, true); |
---|
| 16853 | + } |
---|
16739 | 16854 | object.Select(color, deselect); |
---|
16740 | 16855 | } |
---|
16741 | 16856 | |
---|