.. | .. |
---|
2065 | 2065 | //System.err.println("Oeil on"); |
---|
2066 | 2066 | OEIL = true; |
---|
2067 | 2067 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2068 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2068 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2069 | 2069 | //pingthread.StepToTarget(true); |
---|
2070 | 2070 | } |
---|
2071 | 2071 | |
---|
.. | .. |
---|
11028 | 11028 | |
---|
11029 | 11029 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
11030 | 11030 | |
---|
11031 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
11032 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
11033 | | -//gl.glEnable(gl.GL_MULTISAMPLE); |
---|
| 11031 | +gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
| 11032 | +gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
| 11033 | +gl.glEnable(gl.GL_MULTISAMPLE); |
---|
11034 | 11034 | } else |
---|
11035 | 11035 | { |
---|
11036 | 11036 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11041 | 11041 | //System.out.println("BLENDING ON"); |
---|
11042 | 11042 | gl.glEnable(GL.GL_BLEND); |
---|
11043 | 11043 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
11044 | | - |
---|
| 11044 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
11045 | 11045 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
11046 | 11046 | gl.glLoadIdentity(); |
---|
11047 | 11047 | |
---|
.. | .. |
---|
11527 | 11527 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11528 | 11528 | { |
---|
11529 | 11529 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11530 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11530 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11531 | 11531 | pingthread.StepToTarget(true); // true); |
---|
11532 | 11532 | // zoomonce = false; |
---|
11533 | 11533 | } |
---|
.. | .. |
---|
13375 | 13375 | "DP3 " + dest + ".z," + "normals," + "eye;" + |
---|
13376 | 13376 | "MAX " + dest + ".w," + dest + ".z," + "eps.x;" + |
---|
13377 | 13377 | //"MOV " + dest + ".w," + "normal.z;" + |
---|
13378 | | - "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + |
---|
13379 | | - "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
13380 | | - //"MOV " + dest + ".z," + "params2.w;" + |
---|
| 13378 | +// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET |
---|
| 13379 | +// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" + |
---|
| 13380 | + |
---|
| 13381 | + "MOV " + dest + ".z," + "params2.w;" + // EXACT |
---|
13381 | 13382 | "POW " + dest + ".w," + dest + ".w," + dest + ".z;" + |
---|
13382 | 13383 | "RCP " + dest + ".w," + dest + ".w;" + |
---|
13383 | 13384 | //"RSQ " + dest + ".w," + dest + ".w;" + |
---|
.. | .. |
---|
13942 | 13943 | |
---|
13943 | 13944 | // fev 2014??? |
---|
13944 | 13945 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13945 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13946 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13946 | 13947 | pingthread.StepToTarget(true); // true); |
---|
13947 | 13948 | } |
---|
13948 | 13949 | // if (!LIVE) |
---|
.. | .. |
---|
14296 | 14297 | void GoDown(int mod) |
---|
14297 | 14298 | { |
---|
14298 | 14299 | MODIFIERS |= COMMAND; |
---|
14299 | | - /* |
---|
| 14300 | + /**/ |
---|
14300 | 14301 | if((mod&SHIFT) == SHIFT) |
---|
14301 | 14302 | manipCamera.RotatePosition(0, -speed); |
---|
14302 | 14303 | else |
---|
14303 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14304 | | - */ |
---|
| 14304 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14305 | + /**/ |
---|
14305 | 14306 | if ((mod & SHIFT) == SHIFT) |
---|
14306 | 14307 | { |
---|
14307 | 14308 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14317 | 14318 | void GoUp(int mod) |
---|
14318 | 14319 | { |
---|
14319 | 14320 | MODIFIERS |= COMMAND; |
---|
14320 | | - /* |
---|
| 14321 | + /**/ |
---|
14321 | 14322 | if((mod&SHIFT) == SHIFT) |
---|
14322 | 14323 | manipCamera.RotatePosition(0, speed); |
---|
14323 | 14324 | else |
---|
14324 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14325 | | - */ |
---|
| 14325 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14326 | + /**/ |
---|
14326 | 14327 | if ((mod & SHIFT) == SHIFT) |
---|
14327 | 14328 | { |
---|
14328 | 14329 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14338 | 14339 | void GoLeft(int mod) |
---|
14339 | 14340 | { |
---|
14340 | 14341 | MODIFIERS |= COMMAND; |
---|
14341 | | - /* |
---|
| 14342 | + /**/ |
---|
14342 | 14343 | if((mod&SHIFT) == SHIFT) |
---|
14343 | | - manipCamera.RotatePosition(speed, 0); |
---|
14344 | | - else |
---|
14345 | 14344 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14346 | | - */ |
---|
| 14345 | + else |
---|
| 14346 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14347 | + /**/ |
---|
14347 | 14348 | if ((mod & SHIFT) == SHIFT) |
---|
14348 | 14349 | { |
---|
14349 | 14350 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14359 | 14360 | void GoRight(int mod) |
---|
14360 | 14361 | { |
---|
14361 | 14362 | MODIFIERS |= COMMAND; |
---|
14362 | | - /* |
---|
| 14363 | + /**/ |
---|
14363 | 14364 | if((mod&SHIFT) == SHIFT) |
---|
14364 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14365 | | - else |
---|
14366 | 14365 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14367 | | - */ |
---|
| 14366 | + else |
---|
| 14367 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14368 | + /**/ |
---|
14368 | 14369 | if ((mod & SHIFT) == SHIFT) |
---|
14369 | 14370 | { |
---|
14370 | 14371 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14603 | 14604 | Globals.MOUSEDRAGGED = false; |
---|
14604 | 14605 | |
---|
14605 | 14606 | movingcamera = false; |
---|
14606 | | - X = Y = 0; |
---|
| 14607 | + X = 0; // getBounds().width/2; |
---|
| 14608 | + Y = 0; // getBounds().height/2; |
---|
14607 | 14609 | //System.out.println("mouseReleased: " + e); |
---|
14608 | 14610 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14609 | 14611 | } |
---|
.. | .. |
---|
14944 | 14946 | case 'E' : COMPACT ^= true; |
---|
14945 | 14947 | repaint(); |
---|
14946 | 14948 | break; |
---|
14947 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14949 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14950 | + //DEBUGHSB ^= true; |
---|
| 14951 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14948 | 14952 | repaint(); |
---|
14949 | 14953 | break; |
---|
14950 | 14954 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14970 | 14974 | repaint(); |
---|
14971 | 14975 | break; |
---|
14972 | 14976 | case 'l': |
---|
14973 | | - lightMode ^= true; |
---|
14974 | | - Globals.lighttouched = true; |
---|
14975 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
14976 | | - targetLookAt.set(manipCamera.lookAt); |
---|
14977 | | - repaint(); |
---|
14978 | | - break; |
---|
14979 | | - case 'L': |
---|
| 14977 | + //case 'L': |
---|
14980 | 14978 | if (lightMode) |
---|
14981 | 14979 | { |
---|
14982 | 14980 | lightMode = false; |
---|
.. | .. |
---|
15119 | 15117 | case '_': |
---|
15120 | 15118 | kompactbit = 5; |
---|
15121 | 15119 | break; |
---|
15122 | | - case '+': |
---|
15123 | | - kompactbit = 6; |
---|
15124 | | - break; |
---|
| 15120 | +// case '+': |
---|
| 15121 | +// kompactbit = 6; |
---|
| 15122 | +// break; |
---|
15125 | 15123 | case ' ': |
---|
15126 | | - ObjEditor.theFrame.ToggleFullScreen(); |
---|
| 15124 | + lightMode ^= true; |
---|
| 15125 | + Globals.lighttouched = true; |
---|
| 15126 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 15127 | + targetLookAt.set(manipCamera.lookAt); |
---|
15127 | 15128 | repaint(); |
---|
15128 | 15129 | break; |
---|
15129 | 15130 | //case '`' : |
---|
.. | .. |
---|
15170 | 15171 | case DELETE: |
---|
15171 | 15172 | ClearSelection(); |
---|
15172 | 15173 | break; |
---|
15173 | | - /* |
---|
15174 | 15174 | case '+': |
---|
| 15175 | + |
---|
| 15176 | + /* |
---|
15175 | 15177 | //fontsize += 1; |
---|
15176 | 15178 | bbzoom *= 2; |
---|
15177 | 15179 | repaint(); |
---|
.. | .. |
---|
15188 | 15190 | case '=': |
---|
15189 | 15191 | IncDepth(); |
---|
15190 | 15192 | //fontsize += 1; |
---|
15191 | | - object.editWindow.refreshContents(true); |
---|
| 15193 | + object.GetWindow().refreshContents(true); |
---|
15192 | 15194 | maskbit = 6; |
---|
15193 | 15195 | break; |
---|
15194 | 15196 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15195 | 15197 | DecDepth(); |
---|
15196 | 15198 | maskbit = 5; |
---|
15197 | 15199 | //if(fontsize > 1) fontsize -= 1; |
---|
15198 | | - if (object.editWindow == null) |
---|
15199 | | - new Exception().printStackTrace(); |
---|
15200 | | - else |
---|
15201 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | +// if (object.editWindow == null) |
---|
| 15201 | +// new Exception().printStackTrace(); |
---|
| 15202 | +// else |
---|
| 15203 | + object.GetWindow().refreshContents(true); |
---|
15202 | 15204 | break; |
---|
15203 | 15205 | case '{': |
---|
15204 | 15206 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15422 | 15424 | } |
---|
15423 | 15425 | */ |
---|
15424 | 15426 | |
---|
15425 | | - object.editWindow.EditSelection(false); |
---|
| 15427 | + object.GetWindow().EditSelection(false); |
---|
15426 | 15428 | } |
---|
15427 | 15429 | |
---|
15428 | 15430 | void SelectParent() |
---|
.. | .. |
---|
15439 | 15441 | { |
---|
15440 | 15442 | //selectees.remove(i); |
---|
15441 | 15443 | System.out.println("select parent of " + elem); |
---|
15442 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15444 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15443 | 15445 | } else |
---|
15444 | 15446 | { |
---|
15445 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15447 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15446 | 15448 | } |
---|
15447 | 15449 | |
---|
15448 | 15450 | first = false; |
---|
.. | .. |
---|
15484 | 15486 | for (int j = 0; j < group.children.size(); j++) |
---|
15485 | 15487 | { |
---|
15486 | 15488 | elem = (Object3D) group.children.elementAt(j); |
---|
15487 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15489 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15488 | 15490 | first = false; |
---|
15489 | 15491 | } |
---|
15490 | 15492 | } else |
---|
15491 | 15493 | { |
---|
15492 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15494 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15493 | 15495 | } |
---|
15494 | 15496 | |
---|
15495 | 15497 | first = false; |
---|
.. | .. |
---|
15500 | 15502 | { |
---|
15501 | 15503 | //Composite group = (Composite) object; |
---|
15502 | 15504 | Object3D group = object; |
---|
15503 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15505 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15504 | 15506 | } |
---|
15505 | 15507 | |
---|
15506 | 15508 | void ResetTransform(int mask) |
---|
15507 | 15509 | { |
---|
15508 | 15510 | //Composite group = (Composite) object; |
---|
15509 | 15511 | Object3D group = object; |
---|
15510 | | - group.editWindow.ResetTransform(mask); |
---|
| 15512 | + group.GetWindow().ResetTransform(mask); |
---|
15511 | 15513 | } |
---|
15512 | 15514 | |
---|
15513 | 15515 | void FlipTransform() |
---|
15514 | 15516 | { |
---|
15515 | 15517 | //Composite group = (Composite) object; |
---|
15516 | 15518 | Object3D group = object; |
---|
15517 | | - group.editWindow.FlipTransform(); |
---|
| 15519 | + group.GetWindow().FlipTransform(); |
---|
15518 | 15520 | // group.editWindow.ReduceMesh(true); |
---|
15519 | 15521 | } |
---|
15520 | 15522 | |
---|
.. | .. |
---|
15522 | 15524 | { |
---|
15523 | 15525 | //Composite group = (Composite) object; |
---|
15524 | 15526 | Object3D group = object; |
---|
15525 | | - group.editWindow.PrintMemory(); |
---|
| 15527 | + group.GetWindow().PrintMemory(); |
---|
15526 | 15528 | // group.editWindow.ReduceMesh(true); |
---|
15527 | 15529 | } |
---|
15528 | 15530 | |
---|
.. | .. |
---|
15530 | 15532 | { |
---|
15531 | 15533 | //Composite group = (Composite) object; |
---|
15532 | 15534 | Object3D group = object; |
---|
15533 | | - group.editWindow.ResetCentroid(); |
---|
| 15535 | + group.GetWindow().ResetCentroid(); |
---|
15534 | 15536 | } |
---|
15535 | 15537 | |
---|
15536 | 15538 | void IncDepth() |
---|
.. | .. |
---|
15706 | 15708 | info.bounds.y += (height - desired) / 2; |
---|
15707 | 15709 | } |
---|
15708 | 15710 | } |
---|
| 15711 | + |
---|
15709 | 15712 | info.g = gr; |
---|
15710 | 15713 | info.camera = renderCamera; |
---|
15711 | 15714 | /* |
---|
.. | .. |
---|
15715 | 15718 | */ |
---|
15716 | 15719 | if (!isRenderer) |
---|
15717 | 15720 | { |
---|
15718 | | - object.drawEditHandles(info, 0); |
---|
15719 | | - |
---|
15720 | | - if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0) |
---|
| 15721 | + Grafreed.Assert(object != null); |
---|
| 15722 | + Grafreed.Assert(object.selection != null); |
---|
| 15723 | + if (object.selection.Size() > 0) |
---|
15721 | 15724 | { |
---|
15722 | | - switch (object.selection.get(0).hitSomething) |
---|
| 15725 | + int hitSomething = object.selection.get(0).hitSomething; |
---|
| 15726 | + |
---|
| 15727 | + info.DX = 0; |
---|
| 15728 | + info.DY = 0; |
---|
| 15729 | + info.W = 1; |
---|
| 15730 | + if (hitSomething == Object3D.hitCenter) |
---|
15723 | 15731 | { |
---|
15724 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15725 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15726 | | - break; |
---|
15727 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15728 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15729 | | - break; |
---|
15730 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15731 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15732 | | - break; |
---|
| 15732 | + info.DX = X; |
---|
| 15733 | + if (X != 0) |
---|
| 15734 | + info.DX -= info.bounds.width/2; |
---|
| 15735 | + |
---|
| 15736 | + info.DY = Y; |
---|
| 15737 | + if (Y != 0) |
---|
| 15738 | + info.DY -= info.bounds.height/2; |
---|
15733 | 15739 | } |
---|
15734 | | - |
---|
| 15740 | + |
---|
| 15741 | + object.drawEditHandles(info, 0); |
---|
| 15742 | + |
---|
| 15743 | + if (drag && (X != 0 || Y != 0)) |
---|
| 15744 | + { |
---|
| 15745 | + switch (hitSomething) |
---|
| 15746 | + { |
---|
| 15747 | + case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
| 15748 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15749 | + break; |
---|
| 15750 | + case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
| 15751 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15752 | + break; |
---|
| 15753 | + case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
| 15754 | + gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
| 15755 | + break; |
---|
| 15756 | + } |
---|
| 15757 | + |
---|
| 15758 | + } |
---|
15735 | 15759 | } |
---|
15736 | 15760 | } |
---|
15737 | 15761 | } |
---|
.. | .. |
---|
16722 | 16746 | } |
---|
16723 | 16747 | |
---|
16724 | 16748 | if (!movingcamera && !PAINTMODE) |
---|
16725 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16749 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16726 | 16750 | |
---|
16727 | 16751 | if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16728 | 16752 | { |
---|
.. | .. |
---|
16734 | 16758 | |
---|
16735 | 16759 | group.add(paintobj); // link |
---|
16736 | 16760 | |
---|
16737 | | - object.editWindow.SnapObject(group); |
---|
| 16761 | + object.GetWindow().SnapObject(group); |
---|
16738 | 16762 | |
---|
16739 | | - Object3D folder = object.editWindow.copy; |
---|
| 16763 | + Object3D folder = object.GetWindow().copy; |
---|
16740 | 16764 | |
---|
16741 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16742 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
| 16765 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16766 | + folder = object.GetWindow().copy.selection.elementAt(0); |
---|
16743 | 16767 | |
---|
16744 | 16768 | folder.add(group); |
---|
16745 | 16769 | |
---|
16746 | | - object.editWindow.ResetModel(); |
---|
16747 | | - object.editWindow.refreshContents(); |
---|
| 16770 | + object.GetWindow().ResetModel(); |
---|
| 16771 | + object.GetWindow().refreshContents(); |
---|
16748 | 16772 | } |
---|
16749 | 16773 | else |
---|
16750 | 16774 | paintcount = 0; |
---|
.. | .. |
---|
16783 | 16807 | //System.out.println("objects[color] = " + objects[color]); |
---|
16784 | 16808 | //objects[color].Select(); |
---|
16785 | 16809 | indexcount = 0; |
---|
| 16810 | + ObjEditor window = object.GetWindow(); |
---|
| 16811 | + if (window != null && deselect) |
---|
| 16812 | + { |
---|
| 16813 | + window.Select(null, deselect, true); |
---|
| 16814 | + } |
---|
16786 | 16815 | object.Select(color, deselect); |
---|
16787 | 16816 | } |
---|
16788 | 16817 | |
---|