.. | .. |
---|
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) |
---|
.. | .. |
---|
8489 | 8510 | return texture!=null?texture.texturedata:null; |
---|
8490 | 8511 | } |
---|
8491 | 8512 | |
---|
8492 | | - boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
| 8513 | + com.sun.opengl.util.texture.Texture BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8493 | 8514 | { |
---|
8494 | 8515 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8495 | 8516 | { |
---|
.. | .. |
---|
8501 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8502 | 8523 | |
---|
8503 | 8524 | if (texture == null) |
---|
8504 | | - return false; |
---|
| 8525 | + return texture; |
---|
8505 | 8526 | /**/ |
---|
8506 | 8527 | |
---|
8507 | 8528 | if (textureon || tex.equals("DEFAULT_TEXTURE") || tex.equals("DEFAULT_TEXTURE_BUMP") || tex.equals("WHITE_NOISE")) // || tex.equals("IMMORTAL")) |
---|
.. | .. |
---|
9374 | 9395 | void ResetOptions() |
---|
9375 | 9396 | { |
---|
9376 | 9397 | options1[0] = 100; |
---|
9377 | | - options1[1] = 0.00001f; |
---|
9378 | | - options1[2] = 20; |
---|
| 9398 | + options1[1] = 0.025f; |
---|
| 9399 | + options1[2] = 0.01f; |
---|
9379 | 9400 | options1[3] = 0; |
---|
9380 | 9401 | options1[4] = 0; |
---|
9381 | 9402 | |
---|
9382 | 9403 | options2[0] = 0; |
---|
9383 | | - options2[1] = 1; |
---|
| 9404 | + options2[1] = 0.75f; |
---|
9384 | 9405 | options2[2] = 0; |
---|
9385 | 9406 | options2[3] = 0; |
---|
9386 | 9407 | |
---|
.. | .. |
---|
11014 | 11035 | |
---|
11015 | 11036 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
11016 | 11037 | |
---|
11017 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
11018 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
11019 | | -//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); |
---|
11020 | 11041 | } else |
---|
11021 | 11042 | { |
---|
11022 | 11043 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11027 | 11048 | //System.out.println("BLENDING ON"); |
---|
11028 | 11049 | gl.glEnable(GL.GL_BLEND); |
---|
11029 | 11050 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
11030 | | - |
---|
| 11051 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
11031 | 11052 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
11032 | 11053 | gl.glLoadIdentity(); |
---|
11033 | 11054 | |
---|
.. | .. |
---|
11513 | 11534 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11514 | 11535 | { |
---|
11515 | 11536 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11516 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11537 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11517 | 11538 | pingthread.StepToTarget(true); // true); |
---|
11518 | 11539 | // zoomonce = false; |
---|
11519 | 11540 | } |
---|
.. | .. |
---|
13361 | 13382 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13362 | 13383 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13363 | 13384 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13364 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13365 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13366 | | - //"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 |
---|
13367 | 13389 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13368 | 13390 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13369 | 13391 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13928 | 13950 | |
---|
13929 | 13951 | // fev 2014??? |
---|
13930 | 13952 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13931 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13953 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13932 | 13954 | pingthread.StepToTarget(true); // true); |
---|
13933 | 13955 | } |
---|
13934 | 13956 | // if (!LIVE) |
---|
.. | .. |
---|
14282 | 14304 | void GoDown(int mod) |
---|
14283 | 14305 | { |
---|
14284 | 14306 | MODIFIERS |= COMMAND; |
---|
14285 | | - /* |
---|
| 14307 | + /**/ |
---|
14286 | 14308 | if((mod&SHIFT) == SHIFT) |
---|
14287 | 14309 | manipCamera.RotatePosition(0, -speed); |
---|
14288 | 14310 | else |
---|
14289 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14290 | | - */ |
---|
| 14311 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14312 | + /**/ |
---|
14291 | 14313 | if ((mod & SHIFT) == SHIFT) |
---|
14292 | 14314 | { |
---|
14293 | 14315 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14303 | 14325 | void GoUp(int mod) |
---|
14304 | 14326 | { |
---|
14305 | 14327 | MODIFIERS |= COMMAND; |
---|
14306 | | - /* |
---|
| 14328 | + /**/ |
---|
14307 | 14329 | if((mod&SHIFT) == SHIFT) |
---|
14308 | 14330 | manipCamera.RotatePosition(0, speed); |
---|
14309 | 14331 | else |
---|
14310 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14311 | | - */ |
---|
| 14332 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14333 | + /**/ |
---|
14312 | 14334 | if ((mod & SHIFT) == SHIFT) |
---|
14313 | 14335 | { |
---|
14314 | 14336 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14324 | 14346 | void GoLeft(int mod) |
---|
14325 | 14347 | { |
---|
14326 | 14348 | MODIFIERS |= COMMAND; |
---|
14327 | | - /* |
---|
| 14349 | + /**/ |
---|
14328 | 14350 | if((mod&SHIFT) == SHIFT) |
---|
14329 | | - manipCamera.RotatePosition(speed, 0); |
---|
14330 | | - else |
---|
14331 | 14351 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14332 | | - */ |
---|
| 14352 | + else |
---|
| 14353 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14354 | + /**/ |
---|
14333 | 14355 | if ((mod & SHIFT) == SHIFT) |
---|
14334 | 14356 | { |
---|
14335 | 14357 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14345 | 14367 | void GoRight(int mod) |
---|
14346 | 14368 | { |
---|
14347 | 14369 | MODIFIERS |= COMMAND; |
---|
14348 | | - /* |
---|
| 14370 | + /**/ |
---|
14349 | 14371 | if((mod&SHIFT) == SHIFT) |
---|
14350 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14351 | | - else |
---|
14352 | 14372 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14353 | | - */ |
---|
| 14373 | + else |
---|
| 14374 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14375 | + /**/ |
---|
14354 | 14376 | if ((mod & SHIFT) == SHIFT) |
---|
14355 | 14377 | { |
---|
14356 | 14378 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14589 | 14611 | Globals.MOUSEDRAGGED = false; |
---|
14590 | 14612 | |
---|
14591 | 14613 | movingcamera = false; |
---|
14592 | | - X = Y = 0; |
---|
| 14614 | + X = 0; // getBounds().width/2; |
---|
| 14615 | + Y = 0; // getBounds().height/2; |
---|
14593 | 14616 | //System.out.println("mouseReleased: " + e); |
---|
14594 | 14617 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14595 | 14618 | } |
---|
.. | .. |
---|
14930 | 14953 | case 'E' : COMPACT ^= true; |
---|
14931 | 14954 | repaint(); |
---|
14932 | 14955 | break; |
---|
14933 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14956 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14957 | + //DEBUGHSB ^= true; |
---|
| 14958 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14934 | 14959 | repaint(); |
---|
14935 | 14960 | break; |
---|
14936 | 14961 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14956 | 14981 | repaint(); |
---|
14957 | 14982 | break; |
---|
14958 | 14983 | case 'l': |
---|
14959 | | - lightMode ^= true; |
---|
14960 | | - Globals.lighttouched = true; |
---|
14961 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
14962 | | - targetLookAt.set(manipCamera.lookAt); |
---|
14963 | | - repaint(); |
---|
14964 | | - break; |
---|
14965 | | - case 'L': |
---|
| 14984 | + //case 'L': |
---|
14966 | 14985 | if (lightMode) |
---|
14967 | 14986 | { |
---|
14968 | 14987 | lightMode = false; |
---|
.. | .. |
---|
15105 | 15124 | case '_': |
---|
15106 | 15125 | kompactbit = 5; |
---|
15107 | 15126 | break; |
---|
15108 | | - case '+': |
---|
15109 | | - kompactbit = 6; |
---|
15110 | | - break; |
---|
| 15127 | +// case '+': |
---|
| 15128 | +// kompactbit = 6; |
---|
| 15129 | +// break; |
---|
15111 | 15130 | case ' ': |
---|
15112 | | - ObjEditor.theFrame.ToggleFullScreen(); |
---|
| 15131 | + lightMode ^= true; |
---|
| 15132 | + Globals.lighttouched = true; |
---|
| 15133 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 15134 | + targetLookAt.set(manipCamera.lookAt); |
---|
15113 | 15135 | repaint(); |
---|
15114 | 15136 | break; |
---|
15115 | 15137 | //case '`' : |
---|
.. | .. |
---|
15156 | 15178 | case DELETE: |
---|
15157 | 15179 | ClearSelection(); |
---|
15158 | 15180 | break; |
---|
15159 | | - /* |
---|
15160 | 15181 | case '+': |
---|
| 15182 | + |
---|
| 15183 | + /* |
---|
15161 | 15184 | //fontsize += 1; |
---|
15162 | 15185 | bbzoom *= 2; |
---|
15163 | 15186 | repaint(); |
---|
.. | .. |
---|
15174 | 15197 | case '=': |
---|
15175 | 15198 | IncDepth(); |
---|
15176 | 15199 | //fontsize += 1; |
---|
15177 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | + object.GetWindow().refreshContents(true); |
---|
15178 | 15201 | maskbit = 6; |
---|
15179 | 15202 | break; |
---|
15180 | 15203 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15181 | 15204 | DecDepth(); |
---|
15182 | 15205 | maskbit = 5; |
---|
15183 | 15206 | //if(fontsize > 1) fontsize -= 1; |
---|
15184 | | - if (object.editWindow == null) |
---|
15185 | | - new Exception().printStackTrace(); |
---|
15186 | | - else |
---|
15187 | | - object.editWindow.refreshContents(true); |
---|
| 15207 | +// if (object.editWindow == null) |
---|
| 15208 | +// new Exception().printStackTrace(); |
---|
| 15209 | +// else |
---|
| 15210 | + object.GetWindow().refreshContents(true); |
---|
15188 | 15211 | break; |
---|
15189 | 15212 | case '{': |
---|
15190 | 15213 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15408 | 15431 | } |
---|
15409 | 15432 | */ |
---|
15410 | 15433 | |
---|
15411 | | - object.editWindow.EditSelection(false); |
---|
| 15434 | + object.GetWindow().EditSelection(false); |
---|
15412 | 15435 | } |
---|
15413 | 15436 | |
---|
15414 | 15437 | void SelectParent() |
---|
.. | .. |
---|
15425 | 15448 | { |
---|
15426 | 15449 | //selectees.remove(i); |
---|
15427 | 15450 | System.out.println("select parent of " + elem); |
---|
15428 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15451 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15429 | 15452 | } else |
---|
15430 | 15453 | { |
---|
15431 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15454 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15432 | 15455 | } |
---|
15433 | 15456 | |
---|
15434 | 15457 | first = false; |
---|
.. | .. |
---|
15470 | 15493 | for (int j = 0; j < group.children.size(); j++) |
---|
15471 | 15494 | { |
---|
15472 | 15495 | elem = (Object3D) group.children.elementAt(j); |
---|
15473 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15496 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15474 | 15497 | first = false; |
---|
15475 | 15498 | } |
---|
15476 | 15499 | } else |
---|
15477 | 15500 | { |
---|
15478 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15501 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15479 | 15502 | } |
---|
15480 | 15503 | |
---|
15481 | 15504 | first = false; |
---|
.. | .. |
---|
15486 | 15509 | { |
---|
15487 | 15510 | //Composite group = (Composite) object; |
---|
15488 | 15511 | Object3D group = object; |
---|
15489 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15512 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15490 | 15513 | } |
---|
15491 | 15514 | |
---|
15492 | 15515 | void ResetTransform(int mask) |
---|
15493 | 15516 | { |
---|
15494 | 15517 | //Composite group = (Composite) object; |
---|
15495 | 15518 | Object3D group = object; |
---|
15496 | | - group.editWindow.ResetTransform(mask); |
---|
| 15519 | + group.GetWindow().ResetTransform(mask); |
---|
15497 | 15520 | } |
---|
15498 | 15521 | |
---|
15499 | 15522 | void FlipTransform() |
---|
15500 | 15523 | { |
---|
15501 | 15524 | //Composite group = (Composite) object; |
---|
15502 | 15525 | Object3D group = object; |
---|
15503 | | - group.editWindow.FlipTransform(); |
---|
| 15526 | + group.GetWindow().FlipTransform(); |
---|
15504 | 15527 | // group.editWindow.ReduceMesh(true); |
---|
15505 | 15528 | } |
---|
15506 | 15529 | |
---|
.. | .. |
---|
15508 | 15531 | { |
---|
15509 | 15532 | //Composite group = (Composite) object; |
---|
15510 | 15533 | Object3D group = object; |
---|
15511 | | - group.editWindow.PrintMemory(); |
---|
| 15534 | + group.GetWindow().PrintMemory(); |
---|
15512 | 15535 | // group.editWindow.ReduceMesh(true); |
---|
15513 | 15536 | } |
---|
15514 | 15537 | |
---|
.. | .. |
---|
15516 | 15539 | { |
---|
15517 | 15540 | //Composite group = (Composite) object; |
---|
15518 | 15541 | Object3D group = object; |
---|
15519 | | - group.editWindow.ResetCentroid(); |
---|
| 15542 | + group.GetWindow().ResetCentroid(); |
---|
15520 | 15543 | } |
---|
15521 | 15544 | |
---|
15522 | 15545 | void IncDepth() |
---|
.. | .. |
---|
15692 | 15715 | info.bounds.y += (height - desired) / 2; |
---|
15693 | 15716 | } |
---|
15694 | 15717 | } |
---|
| 15718 | + |
---|
15695 | 15719 | info.g = gr; |
---|
15696 | 15720 | info.camera = renderCamera; |
---|
15697 | 15721 | /* |
---|
.. | .. |
---|
15701 | 15725 | */ |
---|
15702 | 15726 | if (!isRenderer) |
---|
15703 | 15727 | { |
---|
15704 | | - object.drawEditHandles(info, 0); |
---|
15705 | | - |
---|
15706 | | - 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) |
---|
15707 | 15731 | { |
---|
15708 | | - 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) |
---|
15709 | 15738 | { |
---|
15710 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15711 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15712 | | - break; |
---|
15713 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15714 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15715 | | - break; |
---|
15716 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15717 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15718 | | - 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; |
---|
15719 | 15746 | } |
---|
15720 | | - |
---|
| 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 | + } |
---|
15721 | 15766 | } |
---|
15722 | 15767 | } |
---|
15723 | 15768 | } |
---|
.. | .. |
---|
16515 | 16560 | } |
---|
16516 | 16561 | } |
---|
16517 | 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 | + |
---|
16518 | 16571 | class SelectBuffer implements GLEventListener |
---|
16519 | 16572 | { |
---|
16520 | 16573 | |
---|
.. | .. |
---|
16594 | 16647 | |
---|
16595 | 16648 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16596 | 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 | + |
---|
16597 | 16661 | //int tmp = selection_view; |
---|
16598 | 16662 | //selection_view = -1; |
---|
16599 | 16663 | int temp = DrawMode(); |
---|
.. | .. |
---|
16605 | 16669 | // temp = DEFAULT; // patch for selection debug |
---|
16606 | 16670 | Globals.drawMode = temp; // WARNING |
---|
16607 | 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 | + |
---|
16608 | 16683 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16609 | 16684 | |
---|
16610 | 16685 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16708 | 16783 | } |
---|
16709 | 16784 | |
---|
16710 | 16785 | if (!movingcamera && !PAINTMODE) |
---|
16711 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16786 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16712 | 16787 | |
---|
16713 | | - 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) |
---|
16714 | 16789 | { |
---|
16715 | | - 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); |
---|
16716 | 16791 | |
---|
16717 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
| 16792 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16793 | + { |
---|
| 16794 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16718 | 16795 | |
---|
16719 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16720 | | - |
---|
16721 | | - group.add(paintobj); // link |
---|
16722 | | - |
---|
16723 | | - object.editWindow.SnapObject(group); |
---|
16724 | | - |
---|
16725 | | - Object3D folder = object.editWindow.copy; |
---|
16726 | | - |
---|
16727 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16728 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
16729 | | - |
---|
16730 | | - folder.add(group); |
---|
16731 | | - |
---|
16732 | | - object.editWindow.ResetModel(); |
---|
16733 | | - 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 | + } |
---|
16734 | 16811 | } |
---|
16735 | 16812 | else |
---|
16736 | 16813 | paintcount = 0; |
---|
.. | .. |
---|
16769 | 16846 | //System.out.println("objects[color] = " + objects[color]); |
---|
16770 | 16847 | //objects[color].Select(); |
---|
16771 | 16848 | indexcount = 0; |
---|
| 16849 | + ObjEditor window = object.GetWindow(); |
---|
| 16850 | + if (window != null && deselect) |
---|
| 16851 | + { |
---|
| 16852 | + window.Select(null, deselect, true); |
---|
| 16853 | + } |
---|
16772 | 16854 | object.Select(color, deselect); |
---|
16773 | 16855 | } |
---|
16774 | 16856 | |
---|