.. | .. |
---|
797 | 797 | |
---|
798 | 798 | if (marked && Globals.isLIVE() && live && |
---|
799 | 799 | //TEMP21aug2018 |
---|
800 | | - Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 800 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
801 | 801 | currentframe != Globals.framecount) |
---|
802 | 802 | { |
---|
803 | 803 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
912 | 912 | fromParent = null; // LA.newMatrix(); |
---|
913 | 913 | bRep = null; // new BoundaryRep(); |
---|
914 | 914 | |
---|
| 915 | + if (oname != null && oname.equals("LeftHand")) |
---|
| 916 | + { |
---|
| 917 | + name = oname; |
---|
| 918 | + } |
---|
| 919 | + |
---|
915 | 920 | /* |
---|
916 | 921 | float hue = (float)Math.random(); |
---|
917 | 922 | Color col; |
---|
.. | .. |
---|
954 | 959 | |
---|
955 | 960 | public Object clone() |
---|
956 | 961 | { |
---|
957 | | - return GrafreeD.clone(this); |
---|
| 962 | + return Grafreed.clone(this); |
---|
958 | 963 | } |
---|
959 | 964 | |
---|
960 | 965 | Object3D copyExpand() |
---|
.. | .. |
---|
1470 | 1475 | BoundaryRep.SEUIL = other.material.cameralight; |
---|
1471 | 1476 | |
---|
1472 | 1477 | // Set default to 0.1 |
---|
1473 | | - BoundaryRep.SEUIL /= 2; |
---|
| 1478 | + BoundaryRep.SEUIL /= 4; // 2; |
---|
1474 | 1479 | System.out.println("SEUIL = " + BoundaryRep.SEUIL); |
---|
1475 | 1480 | } |
---|
1476 | 1481 | |
---|
.. | .. |
---|
1729 | 1734 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1730 | 1735 | o.bRep = transientrep; |
---|
1731 | 1736 | if (clone) |
---|
1732 | | - o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
| 1737 | + o.bRep = (BoundaryRep) Grafreed.clone(transientrep); |
---|
1733 | 1738 | o.CreateMaterial(); |
---|
1734 | 1739 | o.SetAttributes(this, -1); |
---|
1735 | 1740 | //parent |
---|
.. | .. |
---|
1742 | 1747 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1743 | 1748 | o.bRep = bRep; |
---|
1744 | 1749 | if (clone) |
---|
1745 | | - o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 1750 | + o.bRep = (BoundaryRep) Grafreed.clone(bRep); |
---|
1746 | 1751 | o.CreateMaterial(); |
---|
1747 | 1752 | //o.overwriteThis(this, -1); |
---|
1748 | 1753 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
2300 | 2305 | { |
---|
2301 | 2306 | if (newWindow) |
---|
2302 | 2307 | { |
---|
| 2308 | + new Exception().printStackTrace(); |
---|
2303 | 2309 | System.exit(0); |
---|
2304 | 2310 | if (parent != null) |
---|
2305 | 2311 | { |
---|
.. | .. |
---|
2476 | 2482 | return retval; |
---|
2477 | 2483 | } |
---|
2478 | 2484 | |
---|
2479 | | - void doEditDrag(ClickInfo info) |
---|
| 2485 | + void doEditDrag(ClickInfo info, boolean opposite) |
---|
2480 | 2486 | { |
---|
2481 | 2487 | switch (doSomething) |
---|
2482 | 2488 | { |
---|
2483 | 2489 | case 1: // '\001' |
---|
2484 | 2490 | //super. |
---|
2485 | | - doEditDrag0(info); |
---|
| 2491 | + doEditDrag0(info, opposite); |
---|
2486 | 2492 | break; |
---|
2487 | 2493 | |
---|
2488 | 2494 | case 2: // '\002' |
---|
.. | .. |
---|
2495 | 2501 | { |
---|
2496 | 2502 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2497 | 2503 | //childToDrag.doEditDrag(info); |
---|
2498 | | - sel.doEditDrag(info); |
---|
| 2504 | + sel.doEditDrag(info, opposite); |
---|
2499 | 2505 | } else |
---|
2500 | 2506 | { |
---|
2501 | 2507 | //super. |
---|
2502 | | - doEditDrag0(info); |
---|
| 2508 | + doEditDrag0(info, opposite); |
---|
2503 | 2509 | } |
---|
2504 | 2510 | } |
---|
2505 | 2511 | break; |
---|
.. | .. |
---|
2982 | 2988 | blockloop = false; |
---|
2983 | 2989 | } |
---|
2984 | 2990 | |
---|
| 2991 | + void TransformChildren() |
---|
| 2992 | + { |
---|
| 2993 | + if (toParent != null) |
---|
| 2994 | + { |
---|
| 2995 | + for (int i=Size(); --i>=0;) |
---|
| 2996 | + { |
---|
| 2997 | + Object3D v = get(i); |
---|
| 2998 | + |
---|
| 2999 | + if (v.toParent == null) |
---|
| 3000 | + { |
---|
| 3001 | + v.toParent = LA.newMatrix(); |
---|
| 3002 | + v.fromParent = LA.newMatrix(); |
---|
| 3003 | + } |
---|
| 3004 | + |
---|
| 3005 | + LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3006 | + LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3007 | + } |
---|
| 3008 | + |
---|
| 3009 | + toParent = null; // LA.matIdentity(toParent); |
---|
| 3010 | + fromParent = null; // LA.matIdentity(fromParent); |
---|
| 3011 | + |
---|
| 3012 | + Touch(); |
---|
| 3013 | + } |
---|
| 3014 | + } |
---|
| 3015 | + |
---|
2985 | 3016 | void TransformGeometry() |
---|
2986 | 3017 | { |
---|
2987 | 3018 | Object3D obj = this; |
---|
.. | .. |
---|
3203 | 3234 | |
---|
3204 | 3235 | BoundaryRep sup = bRep.support; |
---|
3205 | 3236 | bRep.support = null; |
---|
3206 | | - BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 3237 | + BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3207 | 3238 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3208 | 3239 | temprep.SplitInTwo(reduction34, onlyone); |
---|
3209 | 3240 | bRep = temprep; |
---|
.. | .. |
---|
3727 | 3758 | if (child == null) |
---|
3728 | 3759 | continue; |
---|
3729 | 3760 | |
---|
3730 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3761 | + if (Grafreed.RENDERME > 0) |
---|
3731 | 3762 | { |
---|
3732 | 3763 | if (child instanceof Merge) |
---|
3733 | 3764 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3878 | 3909 | if (child == null) |
---|
3879 | 3910 | continue; |
---|
3880 | 3911 | |
---|
3881 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3912 | + if (Grafreed.RENDERME > 0) |
---|
3882 | 3913 | { |
---|
3883 | 3914 | if (child instanceof Merge) |
---|
3884 | 3915 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4073 | 4104 | if (child == null) |
---|
4074 | 4105 | continue; |
---|
4075 | 4106 | |
---|
4076 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4107 | + if (Grafreed.RENDERME > 0) |
---|
4077 | 4108 | { |
---|
4078 | 4109 | if (child instanceof Merge) |
---|
4079 | 4110 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
5158 | 5189 | |
---|
5159 | 5190 | // System.out.println("Fullname = " + fullname); |
---|
5160 | 5191 | |
---|
5161 | | - if (fullname.name.indexOf(":") == -1) |
---|
5162 | | - return fullname.name; |
---|
| 5192 | + // Does not work on Windows due to C: |
---|
| 5193 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5194 | +// return fullname.name; |
---|
| 5195 | +// |
---|
| 5196 | +// return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
5163 | 5197 | |
---|
5164 | | - return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
| 5198 | + String[] split = fullname.name.split(":"); |
---|
| 5199 | + |
---|
| 5200 | + if (split.length == 0) |
---|
| 5201 | + { |
---|
| 5202 | + return ""; |
---|
| 5203 | + } |
---|
| 5204 | + |
---|
| 5205 | + if (split.length <= 2) |
---|
| 5206 | + { |
---|
| 5207 | + if (fullname.name.endsWith(":")) |
---|
| 5208 | + { |
---|
| 5209 | + // Windows |
---|
| 5210 | + return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5211 | + } |
---|
| 5212 | + |
---|
| 5213 | + return split[0]; |
---|
| 5214 | + } |
---|
| 5215 | + |
---|
| 5216 | + // Windows |
---|
| 5217 | + assert(split.length == 4); |
---|
| 5218 | + |
---|
| 5219 | + return split[0] + ":" + split[1]; |
---|
5165 | 5220 | } |
---|
5166 | 5221 | |
---|
5167 | 5222 | static String GetBump(cTexture fullname) |
---|
.. | .. |
---|
5170 | 5225 | return ""; |
---|
5171 | 5226 | |
---|
5172 | 5227 | // System.out.println("Fullname = " + fullname); |
---|
5173 | | - if (fullname.name.indexOf(":") == -1) |
---|
5174 | | - return ""; |
---|
5175 | | - |
---|
5176 | | - return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5228 | + // Does not work on Windows due to C: |
---|
| 5229 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5230 | +// return ""; |
---|
| 5231 | +// |
---|
| 5232 | +// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5233 | + String[] split = fullname.name.split(":"); |
---|
| 5234 | + |
---|
| 5235 | + if (split.length == 0) |
---|
| 5236 | + { |
---|
| 5237 | + return ""; |
---|
| 5238 | + } |
---|
| 5239 | + |
---|
| 5240 | + if (split.length == 1) |
---|
| 5241 | + { |
---|
| 5242 | + return ""; |
---|
| 5243 | + } |
---|
| 5244 | + |
---|
| 5245 | + if (split.length == 2) |
---|
| 5246 | + { |
---|
| 5247 | + if (fullname.name.endsWith(":")) |
---|
| 5248 | + { |
---|
| 5249 | + // Windows |
---|
| 5250 | + return ""; |
---|
| 5251 | + } |
---|
| 5252 | + |
---|
| 5253 | + return split[1]; |
---|
| 5254 | + } |
---|
| 5255 | + |
---|
| 5256 | + // Windows |
---|
| 5257 | + assert(split.length == 4); |
---|
| 5258 | + |
---|
| 5259 | + return split[2] + ":" + split[3]; |
---|
5177 | 5260 | } |
---|
5178 | 5261 | |
---|
5179 | 5262 | String GetPigmentTexture() |
---|
.. | .. |
---|
5247 | 5330 | System.out.print("; textures = " + textures); |
---|
5248 | 5331 | System.out.println("; usedtextures = " + usedtextures); |
---|
5249 | 5332 | |
---|
5250 | | - if (GetTextures() == null) |
---|
| 5333 | + if (GetTextures() == null) // What is that?? |
---|
5251 | 5334 | GetTextures().name = ":"; |
---|
5252 | 5335 | |
---|
5253 | 5336 | String texname = tex; |
---|
.. | .. |
---|
5326 | 5409 | return |
---|
5327 | 5410 | CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
5328 | 5411 | // PROBLEM with CROWD!! |
---|
5329 | | - && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
| 5412 | + && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5330 | 5413 | } |
---|
5331 | 5414 | |
---|
5332 | 5415 | static boolean DEBUG_SELECTION = false; |
---|
.. | .. |
---|
6931 | 7014 | } |
---|
6932 | 7015 | |
---|
6933 | 7016 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
6934 | | - modified = (info.modifiers & CameraPane.META) != 0; |
---|
| 7017 | + modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
6935 | 7018 | //System.out.println("modified = " + modified); |
---|
6936 | 7019 | //new Exception().printStackTrace(); |
---|
6937 | 7020 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
6959 | 7042 | return true; |
---|
6960 | 7043 | } |
---|
6961 | 7044 | |
---|
6962 | | - void doEditDrag0(ClickInfo info) |
---|
| 7045 | + void doEditDrag0(ClickInfo info, boolean opposite) |
---|
6963 | 7046 | { |
---|
6964 | 7047 | if (hitSomething == 0) |
---|
6965 | 7048 | { |
---|
.. | .. |
---|
6986 | 7069 | |
---|
6987 | 7070 | scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
6988 | 7071 | |
---|
6989 | | - if (modified) |
---|
| 7072 | + if (modified || opposite) |
---|
6990 | 7073 | { |
---|
6991 | 7074 | //assert(false); |
---|
6992 | 7075 | /* |
---|
.. | .. |
---|
7080 | 7163 | |
---|
7081 | 7164 | if (modified) |
---|
7082 | 7165 | { |
---|
| 7166 | + // Rotate 90 degrees |
---|
7083 | 7167 | angle /= (Math.PI / 4); |
---|
7084 | 7168 | angle = Math.floor(angle + 0.5); |
---|
7085 | 7169 | angle *= (Math.PI / 4); |
---|
.. | .. |
---|
7314 | 7398 | //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")"; |
---|
7315 | 7399 | //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString(); |
---|
7316 | 7400 | //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString(); |
---|
| 7401 | + |
---|
| 7402 | + String objname; |
---|
| 7403 | + |
---|
7317 | 7404 | if (false) //parent != null) |
---|
7318 | 7405 | { |
---|
7319 | | - return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
| 7406 | + objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7320 | 7407 | } else |
---|
7321 | 7408 | { |
---|
7322 | | - return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this); |
---|
| 7409 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7323 | 7410 | } // + super.toString(); |
---|
7324 | 7411 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
| 7412 | + |
---|
| 7413 | + if (!Globals.ADVANCED) |
---|
| 7414 | + return objname; |
---|
| 7415 | + |
---|
| 7416 | + return objname + " " + System.identityHashCode(this); |
---|
7325 | 7417 | } |
---|
7326 | 7418 | |
---|
7327 | 7419 | public int hashCode() |
---|
.. | .. |
---|
7377 | 7469 | objectUI.closeUI(); |
---|
7378 | 7470 | if (editWindow != null) |
---|
7379 | 7471 | { |
---|
| 7472 | + editWindow.ctrlPanel.FlushUI(); |
---|
7380 | 7473 | editWindow.refreshContents(); |
---|
7381 | 7474 | } // ? new |
---|
7382 | 7475 | objectUI = null; |
---|
.. | .. |
---|
7512 | 7605 | { |
---|
7513 | 7606 | assert(bRep != null); |
---|
7514 | 7607 | if (!(support instanceof GenericJoint)) // support.bRep != null) |
---|
7515 | | - GrafreeD.Assert(support.bRep == bRep.support); |
---|
| 7608 | + Grafreed.Assert(support.bRep == bRep.support); |
---|
7516 | 7609 | } |
---|
7517 | 7610 | else |
---|
7518 | 7611 | { |
---|