.. | .. |
---|
300 | 300 | } |
---|
301 | 301 | |
---|
302 | 302 | boolean live = false; |
---|
| 303 | + boolean dontselect = false; |
---|
303 | 304 | boolean hide = false; |
---|
304 | 305 | boolean link2master = false; // performs reset support/master at each frame |
---|
305 | 306 | boolean marked = false; // animation node |
---|
.. | .. |
---|
774 | 775 | if (step == 0) |
---|
775 | 776 | step = 1; |
---|
776 | 777 | if (maxcount == 0) |
---|
777 | | - maxcount = 2048; // 4; |
---|
| 778 | + maxcount = 128; // 2048; // 4; |
---|
778 | 779 | // if (acceleration == 0) |
---|
779 | 780 | // acceleration = 10; |
---|
780 | 781 | if (delay == 0) // serial |
---|
.. | .. |
---|
797 | 798 | |
---|
798 | 799 | if (marked && Globals.isLIVE() && live && |
---|
799 | 800 | //TEMP21aug2018 |
---|
800 | | - Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 801 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
801 | 802 | currentframe != Globals.framecount) |
---|
802 | 803 | { |
---|
803 | 804 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
912 | 913 | fromParent = null; // LA.newMatrix(); |
---|
913 | 914 | bRep = null; // new BoundaryRep(); |
---|
914 | 915 | |
---|
| 916 | + if (oname != null && oname.equals("LeftHand")) |
---|
| 917 | + { |
---|
| 918 | + name = oname; |
---|
| 919 | + } |
---|
| 920 | + |
---|
915 | 921 | /* |
---|
916 | 922 | float hue = (float)Math.random(); |
---|
917 | 923 | Color col; |
---|
.. | .. |
---|
954 | 960 | |
---|
955 | 961 | public Object clone() |
---|
956 | 962 | { |
---|
957 | | - return GrafreeD.clone(this); |
---|
| 963 | + return Grafreed.clone(this); |
---|
958 | 964 | } |
---|
959 | 965 | |
---|
960 | 966 | Object3D copyExpand() |
---|
.. | .. |
---|
1470 | 1476 | BoundaryRep.SEUIL = other.material.cameralight; |
---|
1471 | 1477 | |
---|
1472 | 1478 | // Set default to 0.1 |
---|
1473 | | - BoundaryRep.SEUIL /= 2; |
---|
| 1479 | + BoundaryRep.SEUIL /= 4; // 2; |
---|
1474 | 1480 | System.out.println("SEUIL = " + BoundaryRep.SEUIL); |
---|
1475 | 1481 | } |
---|
1476 | 1482 | |
---|
.. | .. |
---|
1729 | 1735 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1730 | 1736 | o.bRep = transientrep; |
---|
1731 | 1737 | if (clone) |
---|
1732 | | - o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
| 1738 | + o.bRep = (BoundaryRep) Grafreed.clone(transientrep); |
---|
1733 | 1739 | o.CreateMaterial(); |
---|
1734 | 1740 | o.SetAttributes(this, -1); |
---|
1735 | 1741 | //parent |
---|
.. | .. |
---|
1742 | 1748 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1743 | 1749 | o.bRep = bRep; |
---|
1744 | 1750 | if (clone) |
---|
1745 | | - o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 1751 | + o.bRep = (BoundaryRep) Grafreed.clone(bRep); |
---|
1746 | 1752 | o.CreateMaterial(); |
---|
1747 | 1753 | //o.overwriteThis(this, -1); |
---|
1748 | 1754 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
1829 | 1835 | if (obj.name == null) |
---|
1830 | 1836 | continue; // can't be a null one |
---|
1831 | 1837 | |
---|
| 1838 | + // Try perfect match first. |
---|
1832 | 1839 | if (n.equals(obj.name)) |
---|
1833 | 1840 | { |
---|
1834 | 1841 | theobj = obj; |
---|
1835 | 1842 | count++; |
---|
1836 | 1843 | } |
---|
1837 | 1844 | } |
---|
| 1845 | + |
---|
| 1846 | + // not needed: n = n.split(":")[0]; // Poser generates a count |
---|
1838 | 1847 | |
---|
1839 | 1848 | if (count != 1) |
---|
1840 | 1849 | for (int i=Size(); --i>=0;) |
---|
.. | .. |
---|
2300 | 2309 | { |
---|
2301 | 2310 | if (newWindow) |
---|
2302 | 2311 | { |
---|
| 2312 | + new Exception().printStackTrace(); |
---|
2303 | 2313 | System.exit(0); |
---|
2304 | 2314 | if (parent != null) |
---|
2305 | 2315 | { |
---|
.. | .. |
---|
2476 | 2486 | return retval; |
---|
2477 | 2487 | } |
---|
2478 | 2488 | |
---|
2479 | | - void doEditDrag(ClickInfo info) |
---|
| 2489 | + void doEditDrag(ClickInfo info, boolean opposite) |
---|
2480 | 2490 | { |
---|
2481 | 2491 | switch (doSomething) |
---|
2482 | 2492 | { |
---|
2483 | 2493 | case 1: // '\001' |
---|
2484 | 2494 | //super. |
---|
2485 | | - doEditDrag0(info); |
---|
| 2495 | + doEditDrag0(info, opposite); |
---|
2486 | 2496 | break; |
---|
2487 | 2497 | |
---|
2488 | 2498 | case 2: // '\002' |
---|
.. | .. |
---|
2495 | 2505 | { |
---|
2496 | 2506 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2497 | 2507 | //childToDrag.doEditDrag(info); |
---|
2498 | | - sel.doEditDrag(info); |
---|
| 2508 | + sel.doEditDrag(info, opposite); |
---|
2499 | 2509 | } else |
---|
2500 | 2510 | { |
---|
2501 | 2511 | //super. |
---|
2502 | | - doEditDrag0(info); |
---|
| 2512 | + doEditDrag0(info, opposite); |
---|
2503 | 2513 | } |
---|
2504 | 2514 | } |
---|
2505 | 2515 | break; |
---|
.. | .. |
---|
2906 | 2916 | { |
---|
2907 | 2917 | if (bRep != null) |
---|
2908 | 2918 | { |
---|
2909 | | - bRep.GenUV(); |
---|
| 2919 | + bRep.GenUV(); //1); |
---|
| 2920 | + //bRep.UnfoldUV(); |
---|
2910 | 2921 | Touch(); |
---|
2911 | 2922 | } |
---|
2912 | 2923 | } |
---|
.. | .. |
---|
2981 | 2992 | blockloop = false; |
---|
2982 | 2993 | } |
---|
2983 | 2994 | |
---|
| 2995 | + void TransformChildren() |
---|
| 2996 | + { |
---|
| 2997 | + if (toParent != null) |
---|
| 2998 | + { |
---|
| 2999 | + for (int i=Size(); --i>=0;) |
---|
| 3000 | + { |
---|
| 3001 | + Object3D v = get(i); |
---|
| 3002 | + |
---|
| 3003 | + if (v.toParent == null) |
---|
| 3004 | + { |
---|
| 3005 | + v.toParent = LA.newMatrix(); |
---|
| 3006 | + v.fromParent = LA.newMatrix(); |
---|
| 3007 | + } |
---|
| 3008 | + |
---|
| 3009 | +// LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3010 | +// LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3011 | + LA.matConcat(toParent, v.toParent, v.toParent); |
---|
| 3012 | + LA.matConcat(v.fromParent, fromParent, v.fromParent); |
---|
| 3013 | + } |
---|
| 3014 | + |
---|
| 3015 | + toParent = null; // LA.matIdentity(toParent); |
---|
| 3016 | + fromParent = null; // LA.matIdentity(fromParent); |
---|
| 3017 | + |
---|
| 3018 | + Touch(); |
---|
| 3019 | + } |
---|
| 3020 | + } |
---|
| 3021 | + |
---|
2984 | 3022 | void TransformGeometry() |
---|
2985 | 3023 | { |
---|
2986 | 3024 | Object3D obj = this; |
---|
.. | .. |
---|
3202 | 3240 | |
---|
3203 | 3241 | BoundaryRep sup = bRep.support; |
---|
3204 | 3242 | bRep.support = null; |
---|
3205 | | - BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 3243 | + BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3206 | 3244 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3207 | | - temprep.SplitInTwo(reduction34, onlyone); |
---|
| 3245 | + |
---|
| 3246 | + while(temprep.SplitInTwo(reduction34, onlyone)); |
---|
| 3247 | + |
---|
3208 | 3248 | bRep = temprep; |
---|
3209 | 3249 | bRep.support = sup; |
---|
3210 | 3250 | Touch(); |
---|
.. | .. |
---|
3726 | 3766 | if (child == null) |
---|
3727 | 3767 | continue; |
---|
3728 | 3768 | |
---|
3729 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3769 | + if (Grafreed.RENDERME > 0) |
---|
3730 | 3770 | { |
---|
3731 | 3771 | if (child instanceof Merge) |
---|
3732 | 3772 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3877 | 3917 | if (child == null) |
---|
3878 | 3918 | continue; |
---|
3879 | 3919 | |
---|
3880 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3920 | + if (Grafreed.RENDERME > 0) |
---|
3881 | 3921 | { |
---|
3882 | 3922 | if (child instanceof Merge) |
---|
3883 | 3923 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4072 | 4112 | if (child == null) |
---|
4073 | 4113 | continue; |
---|
4074 | 4114 | |
---|
4075 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4115 | + if (Grafreed.RENDERME > 0) |
---|
4076 | 4116 | { |
---|
4077 | 4117 | if (child instanceof Merge) |
---|
4078 | 4118 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4679 | 4719 | |
---|
4680 | 4720 | cTreePath SelectLeaf(int indexcount, boolean deselect) |
---|
4681 | 4721 | { |
---|
4682 | | - if (hide) |
---|
| 4722 | + if (hide || dontselect) |
---|
4683 | 4723 | return null; |
---|
4684 | 4724 | |
---|
4685 | 4725 | if (count <= 0) |
---|
.. | .. |
---|
4705 | 4745 | |
---|
4706 | 4746 | cTreePath Select(int indexcount, boolean deselect) |
---|
4707 | 4747 | { |
---|
4708 | | - if (hide) |
---|
| 4748 | + if (hide || dontselect) |
---|
4709 | 4749 | return null; |
---|
4710 | 4750 | |
---|
4711 | 4751 | if (count <= 0) |
---|
.. | .. |
---|
5157 | 5197 | |
---|
5158 | 5198 | // System.out.println("Fullname = " + fullname); |
---|
5159 | 5199 | |
---|
5160 | | - if (fullname.name.indexOf(":") == -1) |
---|
5161 | | - return fullname.name; |
---|
| 5200 | + // Does not work on Windows due to C: |
---|
| 5201 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5202 | +// return fullname.name; |
---|
| 5203 | +// |
---|
| 5204 | +// return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
5162 | 5205 | |
---|
5163 | | - return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
| 5206 | + String[] split = fullname.name.split(":"); |
---|
| 5207 | + |
---|
| 5208 | + if (split.length == 0) |
---|
| 5209 | + { |
---|
| 5210 | + return ""; |
---|
| 5211 | + } |
---|
| 5212 | + |
---|
| 5213 | + if (split.length <= 2) |
---|
| 5214 | + { |
---|
| 5215 | + if (fullname.name.endsWith(":")) |
---|
| 5216 | + { |
---|
| 5217 | + // Windows |
---|
| 5218 | + return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5219 | + } |
---|
| 5220 | + |
---|
| 5221 | + return split[0]; |
---|
| 5222 | + } |
---|
| 5223 | + |
---|
| 5224 | + // Windows |
---|
| 5225 | + assert(split.length == 4); |
---|
| 5226 | + |
---|
| 5227 | + return split[0] + ":" + split[1]; |
---|
5164 | 5228 | } |
---|
5165 | 5229 | |
---|
5166 | 5230 | static String GetBump(cTexture fullname) |
---|
.. | .. |
---|
5169 | 5233 | return ""; |
---|
5170 | 5234 | |
---|
5171 | 5235 | // System.out.println("Fullname = " + fullname); |
---|
5172 | | - if (fullname.name.indexOf(":") == -1) |
---|
5173 | | - return ""; |
---|
5174 | | - |
---|
5175 | | - return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5236 | + // Does not work on Windows due to C: |
---|
| 5237 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5238 | +// return ""; |
---|
| 5239 | +// |
---|
| 5240 | +// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5241 | + String[] split = fullname.name.split(":"); |
---|
| 5242 | + |
---|
| 5243 | + if (split.length == 0) |
---|
| 5244 | + { |
---|
| 5245 | + return ""; |
---|
| 5246 | + } |
---|
| 5247 | + |
---|
| 5248 | + if (split.length == 1) |
---|
| 5249 | + { |
---|
| 5250 | + return ""; |
---|
| 5251 | + } |
---|
| 5252 | + |
---|
| 5253 | + if (split.length == 2) |
---|
| 5254 | + { |
---|
| 5255 | + if (fullname.name.endsWith(":")) |
---|
| 5256 | + { |
---|
| 5257 | + // Windows |
---|
| 5258 | + return ""; |
---|
| 5259 | + } |
---|
| 5260 | + |
---|
| 5261 | + return split[1]; |
---|
| 5262 | + } |
---|
| 5263 | + |
---|
| 5264 | + // Windows |
---|
| 5265 | + assert(split.length == 4); |
---|
| 5266 | + |
---|
| 5267 | + return split[2] + ":" + split[3]; |
---|
5176 | 5268 | } |
---|
5177 | 5269 | |
---|
5178 | 5270 | String GetPigmentTexture() |
---|
.. | .. |
---|
5246 | 5338 | System.out.print("; textures = " + textures); |
---|
5247 | 5339 | System.out.println("; usedtextures = " + usedtextures); |
---|
5248 | 5340 | |
---|
5249 | | - if (GetTextures() == null) |
---|
| 5341 | + if (GetTextures() == null) // What is that?? |
---|
5250 | 5342 | GetTextures().name = ":"; |
---|
5251 | 5343 | |
---|
5252 | 5344 | String texname = tex; |
---|
.. | .. |
---|
5323 | 5415 | boolean NeedSupport() |
---|
5324 | 5416 | { |
---|
5325 | 5417 | return |
---|
5326 | | - CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
| 5418 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
5327 | 5419 | // PROBLEM with CROWD!! |
---|
5328 | | - && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
| 5420 | + && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5329 | 5421 | } |
---|
5330 | 5422 | |
---|
5331 | 5423 | static boolean DEBUG_SELECTION = false; |
---|
.. | .. |
---|
5340 | 5432 | } |
---|
5341 | 5433 | |
---|
5342 | 5434 | if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5343 | | - hide) |
---|
| 5435 | + (hide || dontselect)) |
---|
5344 | 5436 | return; |
---|
5345 | 5437 | |
---|
5346 | 5438 | if (name != null && name.contains("sclera")) |
---|
.. | .. |
---|
5582 | 5674 | tex = GetTextures(); |
---|
5583 | 5675 | } |
---|
5584 | 5676 | |
---|
5585 | | - display.BindTextures(tex, texres); |
---|
| 5677 | + boolean failed = false; |
---|
| 5678 | + |
---|
| 5679 | + try |
---|
| 5680 | + { |
---|
| 5681 | + display.BindTextures(tex, texres); |
---|
| 5682 | + } |
---|
| 5683 | + catch (Exception e) |
---|
| 5684 | + { |
---|
| 5685 | + System.err.println("FAILED: " + this); |
---|
| 5686 | + failed = true; |
---|
| 5687 | + } |
---|
5586 | 5688 | |
---|
5587 | 5689 | if (!compiled) |
---|
5588 | 5690 | { |
---|
.. | .. |
---|
5604 | 5706 | } |
---|
5605 | 5707 | } |
---|
5606 | 5708 | |
---|
5607 | | - display.ReleaseTextures(tex); |
---|
| 5709 | + if (!failed) |
---|
| 5710 | + display.ReleaseTextures(tex); |
---|
5608 | 5711 | |
---|
5609 | 5712 | display.PopMaterial(this, selected); |
---|
5610 | 5713 | } |
---|
.. | .. |
---|
5733 | 5836 | |
---|
5734 | 5837 | void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5735 | 5838 | { |
---|
| 5839 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 5840 | + return; |
---|
| 5841 | + |
---|
5736 | 5842 | if (hide) |
---|
5737 | 5843 | return; |
---|
5738 | 5844 | // shadow optimisation |
---|
.. | .. |
---|
5858 | 5964 | if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5859 | 5965 | return; // no shadow for transparent objects |
---|
5860 | 5966 | |
---|
| 5967 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 5968 | + return; |
---|
| 5969 | + |
---|
5861 | 5970 | if (hide) |
---|
5862 | 5971 | return; |
---|
5863 | 5972 | |
---|
.. | .. |
---|
5898 | 6007 | return; |
---|
5899 | 6008 | } |
---|
5900 | 6009 | |
---|
| 6010 | + //bRep.GenUV(1/material.diffuseness); |
---|
5901 | 6011 | // bRep.lock = true; |
---|
5902 | 6012 | |
---|
5903 | 6013 | //javax.media.opengl.GL gl = display.GetGL(); |
---|
.. | .. |
---|
6840 | 6950 | // { |
---|
6841 | 6951 | // CameraPane.Ymax = spoth; |
---|
6842 | 6952 | // } |
---|
6843 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6844 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 6953 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
| 6954 | + //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
6845 | 6955 | spot.translate(0, -32); |
---|
6846 | 6956 | info.g.setColor(Color.green); |
---|
6847 | 6957 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
6896 | 7006 | startX = info.x; |
---|
6897 | 7007 | startY = info.y; |
---|
6898 | 7008 | |
---|
6899 | | - hitSomething = 0; |
---|
| 7009 | + hitSomething = -1; |
---|
6900 | 7010 | cVector origin = new cVector(); |
---|
6901 | 7011 | //LA.xformPos(origin, toParent, origin); |
---|
6902 | 7012 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
6929 | 7039 | } |
---|
6930 | 7040 | |
---|
6931 | 7041 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
6932 | | - modified = (info.modifiers & CameraPane.META) != 0; |
---|
| 7042 | + modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
6933 | 7043 | //System.out.println("modified = " + modified); |
---|
6934 | 7044 | //new Exception().printStackTrace(); |
---|
6935 | 7045 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
6957 | 7067 | return true; |
---|
6958 | 7068 | } |
---|
6959 | 7069 | |
---|
6960 | | - void doEditDrag0(ClickInfo info) |
---|
| 7070 | + void doEditDrag0(ClickInfo info, boolean opposite) |
---|
6961 | 7071 | { |
---|
6962 | 7072 | if (hitSomething == 0) |
---|
6963 | 7073 | { |
---|
.. | .. |
---|
6972 | 7082 | //System.out.println("hitSomething = " + hitSomething); |
---|
6973 | 7083 | |
---|
6974 | 7084 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7085 | + |
---|
6975 | 7086 | cVector xlate = new cVector(); |
---|
6976 | 7087 | //cVector xlate2 = new cVector(); |
---|
6977 | 7088 | switch (hitSomething) |
---|
.. | .. |
---|
6984 | 7095 | |
---|
6985 | 7096 | scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
6986 | 7097 | |
---|
6987 | | - if (modified) |
---|
| 7098 | + if (modified || opposite) |
---|
6988 | 7099 | { |
---|
6989 | 7100 | //assert(false); |
---|
6990 | 7101 | /* |
---|
.. | .. |
---|
7078 | 7189 | |
---|
7079 | 7190 | if (modified) |
---|
7080 | 7191 | { |
---|
| 7192 | + // Rotate 90 degrees |
---|
7081 | 7193 | angle /= (Math.PI / 4); |
---|
7082 | 7194 | angle = Math.floor(angle + 0.5); |
---|
7083 | 7195 | angle *= (Math.PI / 4); |
---|
.. | .. |
---|
7119 | 7231 | |
---|
7120 | 7232 | case hitScale: // scale |
---|
7121 | 7233 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7234 | + double sign = 1; |
---|
| 7235 | + if (hScale < 0) |
---|
| 7236 | + { |
---|
| 7237 | + sign = -1; |
---|
| 7238 | + } |
---|
| 7239 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7122 | 7240 | if (hScale < 0.01) |
---|
7123 | 7241 | { |
---|
7124 | | - hScale = 0.01; |
---|
| 7242 | + //hScale = 0.01; |
---|
7125 | 7243 | } |
---|
7126 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7127 | | - if (hScale < 0.01) |
---|
7128 | | - { |
---|
7129 | | - hScale = 0.01; |
---|
7130 | | - } |
---|
| 7244 | + |
---|
7131 | 7245 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7132 | | - if (vScale < 0.01) |
---|
| 7246 | + sign = 1; |
---|
| 7247 | + if (vScale < 0) |
---|
7133 | 7248 | { |
---|
7134 | | - vScale = 0.01; |
---|
| 7249 | + sign = -1; |
---|
7135 | 7250 | } |
---|
7136 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7251 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7137 | 7252 | if (vScale < 0.01) |
---|
7138 | 7253 | { |
---|
7139 | | - vScale = 0.01; |
---|
| 7254 | + //vScale = 0.01; |
---|
7140 | 7255 | } |
---|
7141 | 7256 | LA.matCopy(startMat, toParent); |
---|
7142 | 7257 | /**/ |
---|
.. | .. |
---|
7147 | 7262 | } |
---|
7148 | 7263 | /**/ |
---|
7149 | 7264 | |
---|
| 7265 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7266 | + |
---|
| 7267 | + if (totalScale < 0.01) |
---|
| 7268 | + { |
---|
| 7269 | + totalScale = 0.01; |
---|
| 7270 | + } |
---|
| 7271 | + |
---|
7150 | 7272 | switch (info.pane.RenderCamera().viewCode) |
---|
7151 | 7273 | { |
---|
7152 | 7274 | case 3: // '\001' |
---|
7153 | 7275 | if (modified) |
---|
7154 | 7276 | { |
---|
7155 | 7277 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7156 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7278 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7157 | 7279 | } // vScale, 1); |
---|
7158 | 7280 | else |
---|
7159 | 7281 | { |
---|
7160 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7282 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7161 | 7283 | } // vScale, 1); |
---|
7162 | 7284 | break; |
---|
7163 | 7285 | |
---|
.. | .. |
---|
7165 | 7287 | if (modified) |
---|
7166 | 7288 | { |
---|
7167 | 7289 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7168 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7290 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7169 | 7291 | } else |
---|
7170 | 7292 | { |
---|
7171 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7293 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7172 | 7294 | } |
---|
7173 | 7295 | break; |
---|
7174 | 7296 | |
---|
.. | .. |
---|
7176 | 7298 | if (modified) |
---|
7177 | 7299 | { |
---|
7178 | 7300 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7179 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7301 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7180 | 7302 | } else |
---|
7181 | 7303 | { |
---|
7182 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7304 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7183 | 7305 | } |
---|
7184 | 7306 | break; |
---|
7185 | 7307 | } |
---|
.. | .. |
---|
7312 | 7434 | //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")"; |
---|
7313 | 7435 | //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString(); |
---|
7314 | 7436 | //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString(); |
---|
| 7437 | + |
---|
| 7438 | + String objname; |
---|
| 7439 | + |
---|
7315 | 7440 | if (false) //parent != null) |
---|
7316 | 7441 | { |
---|
7317 | | - return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
| 7442 | + objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7318 | 7443 | } else |
---|
7319 | 7444 | { |
---|
7320 | | - return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this); |
---|
| 7445 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7321 | 7446 | } // + super.toString(); |
---|
7322 | 7447 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
| 7448 | + |
---|
| 7449 | + if (!Globals.ADVANCED) |
---|
| 7450 | + return objname; |
---|
| 7451 | + |
---|
| 7452 | + return objname + " " + System.identityHashCode(this); |
---|
7323 | 7453 | } |
---|
7324 | 7454 | |
---|
7325 | 7455 | public int hashCode() |
---|
.. | .. |
---|
7375 | 7505 | objectUI.closeUI(); |
---|
7376 | 7506 | if (editWindow != null) |
---|
7377 | 7507 | { |
---|
| 7508 | + editWindow.ctrlPanel.FlushUI(); |
---|
7378 | 7509 | editWindow.refreshContents(); |
---|
7379 | 7510 | } // ? new |
---|
7380 | 7511 | objectUI = null; |
---|
.. | .. |
---|
7510 | 7641 | { |
---|
7511 | 7642 | assert(bRep != null); |
---|
7512 | 7643 | if (!(support instanceof GenericJoint)) // support.bRep != null) |
---|
7513 | | - GrafreeD.Assert(support.bRep == bRep.support); |
---|
| 7644 | + Grafreed.Assert(support.bRep == bRep.support); |
---|
7514 | 7645 | } |
---|
7515 | 7646 | else |
---|
7516 | 7647 | { |
---|
.. | .. |
---|
7559 | 7690 | private static cVector edge2 = new cVector(); |
---|
7560 | 7691 | //private static cVector norm = new cVector(); |
---|
7561 | 7692 | /*transient private*/ int hitSomething; |
---|
7562 | | - private static final int hitCenter = 1; |
---|
7563 | | - private static final int hitScale = 2; |
---|
7564 | | - private static final int hitRotate = 3; |
---|
| 7693 | + static final int hitCenter = 1; |
---|
| 7694 | + static final int hitScale = 2; |
---|
| 7695 | + static final int hitRotate = 3; |
---|
7565 | 7696 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7566 | 7697 | /*transient*/ private Point centerPt; |
---|
7567 | 7698 | /*transient*/ private int startX; |
---|