.. | .. |
---|
24 | 24 | |
---|
25 | 25 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 26 | |
---|
| 27 | + // TEMPORARY for mocap undo |
---|
| 28 | + mocap.reader.BVHReader.BVHResult bvh; |
---|
| 29 | + Object3D skeleton; |
---|
| 30 | + // |
---|
| 31 | + |
---|
27 | 32 | ScriptNode scriptnode; |
---|
28 | 33 | |
---|
29 | 34 | void InitOthers() |
---|
.. | .. |
---|
104 | 109 | |
---|
105 | 110 | // transient boolean reduced; // for morph reduction |
---|
106 | 111 | |
---|
107 | | -transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
108 | | -transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
| 112 | + transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
| 113 | + transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
109 | 114 | |
---|
110 | | -transient Object3D transientsupport; // for cloning |
---|
111 | | -transient boolean transientlink2master; |
---|
| 115 | + transient Object3D transientsupport; // for cloning |
---|
| 116 | + transient boolean transientlink2master; |
---|
112 | 117 | |
---|
113 | | -void SaveSupports() |
---|
114 | | -{ |
---|
115 | | - if (blockloop) |
---|
116 | | - return; |
---|
117 | | - |
---|
118 | | - transientsupport = support; |
---|
119 | | - transientlink2master = link2master; |
---|
120 | | - |
---|
121 | | - support = null; |
---|
122 | | - link2master = false; |
---|
123 | | - |
---|
124 | | - if (bRep != null) |
---|
| 118 | + void SaveSupports() |
---|
125 | 119 | { |
---|
126 | | - bRep.SaveSupports(); |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
| 122 | + |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
| 125 | + |
---|
| 126 | + support = null; |
---|
| 127 | + link2master = false; |
---|
| 128 | + |
---|
| 129 | + if (bRep != null) |
---|
| 130 | + { |
---|
| 131 | + bRep.SaveSupports(); |
---|
| 132 | + } |
---|
| 133 | + |
---|
| 134 | + for (int i = 0; i < Size(); i++) |
---|
| 135 | + { |
---|
| 136 | + Object3D child = (Object3D) get(i); |
---|
| 137 | + if (child == null) |
---|
| 138 | + continue; |
---|
| 139 | + blockloop = true; |
---|
| 140 | + child.SaveSupports(); |
---|
| 141 | + blockloop = false; |
---|
| 142 | + } |
---|
127 | 143 | } |
---|
128 | | - |
---|
129 | | - for (int i = 0; i < Size(); i++) |
---|
| 144 | + |
---|
| 145 | + void RestoreSupports() |
---|
130 | 146 | { |
---|
131 | | - Object3D child = (Object3D) get(i); |
---|
132 | | - if (child == null) |
---|
133 | | - continue; |
---|
| 147 | + if (blockloop) |
---|
| 148 | + return; |
---|
| 149 | + |
---|
| 150 | + support = transientsupport; |
---|
| 151 | + link2master = transientlink2master; |
---|
| 152 | + transientsupport = null; |
---|
| 153 | + transientlink2master = false; |
---|
| 154 | + |
---|
| 155 | + if (bRep != null) |
---|
| 156 | + { |
---|
| 157 | + bRep.RestoreSupports(); |
---|
| 158 | + } |
---|
| 159 | + |
---|
| 160 | + for (int i = 0; i < Size(); i++) |
---|
| 161 | + { |
---|
| 162 | + Object3D child = (Object3D) get(i); |
---|
| 163 | + if (child == null) |
---|
| 164 | + continue; |
---|
| 165 | + blockloop = true; |
---|
| 166 | + child.RestoreSupports(); |
---|
| 167 | + blockloop = false; |
---|
| 168 | + } |
---|
| 169 | + } |
---|
| 170 | + |
---|
| 171 | + void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 172 | + { |
---|
| 173 | + if (hashtable.containsKey(GetUUID())) |
---|
| 174 | + { |
---|
| 175 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 176 | + |
---|
| 177 | + Grafreed.Assert(this.bRep == o.bRep); |
---|
| 178 | + if (this.bRep != null) |
---|
| 179 | + assert(this.bRep.support == o.transientrep); |
---|
| 180 | + |
---|
| 181 | + return; |
---|
| 182 | + } |
---|
| 183 | + |
---|
| 184 | + Object3D o = new Object3D("copy of " + this.name); |
---|
| 185 | + |
---|
| 186 | + hashtable.put(GetUUID(), o); |
---|
| 187 | + |
---|
| 188 | + for (int i=0; i<Size(); i++) |
---|
| 189 | + { |
---|
| 190 | + get(i).ExtractBigData(hashtable); |
---|
| 191 | + } |
---|
| 192 | + |
---|
| 193 | + ExtractBigData(o); |
---|
| 194 | + } |
---|
| 195 | + |
---|
| 196 | + void ExtractBigData(Object3D o) |
---|
| 197 | + { |
---|
| 198 | + o.bRep = this.bRep; |
---|
| 199 | + if (this.bRep != null) |
---|
| 200 | + { |
---|
| 201 | + o.transientrep = this.bRep.support; |
---|
| 202 | + o.bRep.support = null; |
---|
| 203 | + } |
---|
| 204 | + |
---|
| 205 | + // o.support = this.support; |
---|
| 206 | + // o.fileparent = this.fileparent; |
---|
| 207 | + // if (this.bRep != null) |
---|
| 208 | + // o.bRep = this.bRep.support; |
---|
| 209 | + |
---|
| 210 | + this.bRep = null; |
---|
| 211 | + // if (this.bRep != null) |
---|
| 212 | + // this.bRep.support = null; |
---|
| 213 | + // this.support = null; |
---|
| 214 | + // this.fileparent = null; |
---|
| 215 | + } |
---|
| 216 | + |
---|
| 217 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 218 | + { |
---|
| 219 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 220 | + return; |
---|
| 221 | + |
---|
| 222 | + if (blockloop) |
---|
| 223 | + return; |
---|
| 224 | + |
---|
134 | 225 | blockloop = true; |
---|
135 | | - child.SaveSupports(); |
---|
| 226 | + |
---|
| 227 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 228 | + |
---|
| 229 | + RestoreBigData(o); |
---|
| 230 | + |
---|
| 231 | + //hashtable.remove(GetUUID()); |
---|
| 232 | + |
---|
| 233 | + for (int i=0; i<Size(); i++) |
---|
| 234 | + { |
---|
| 235 | + get(i).RestoreBigData(hashtable); |
---|
| 236 | + } |
---|
| 237 | + |
---|
136 | 238 | blockloop = false; |
---|
137 | 239 | } |
---|
138 | | -} |
---|
139 | 240 | |
---|
140 | | -void RestoreSupports() |
---|
141 | | -{ |
---|
142 | | - if (blockloop) |
---|
143 | | - return; |
---|
144 | | - |
---|
145 | | - support = transientsupport; |
---|
146 | | - link2master = transientlink2master; |
---|
147 | | - transientsupport = null; |
---|
148 | | - transientlink2master = false; |
---|
149 | | - |
---|
150 | | - if (bRep != null) |
---|
| 241 | + void RestoreBigData(Object3D o) |
---|
151 | 242 | { |
---|
152 | | - bRep.RestoreSupports(); |
---|
| 243 | + this.bRep = o.bRep; |
---|
| 244 | + if (this.bRep != null) |
---|
| 245 | + this.bRep.support = o.transientrep; |
---|
| 246 | + // this.support = o.support; |
---|
| 247 | + // this.fileparent = o.fileparent; |
---|
153 | 248 | } |
---|
154 | | - |
---|
155 | | - for (int i = 0; i < Size(); i++) |
---|
156 | | - { |
---|
157 | | - Object3D child = (Object3D) get(i); |
---|
158 | | - if (child == null) |
---|
159 | | - continue; |
---|
160 | | - blockloop = true; |
---|
161 | | - child.RestoreSupports(); |
---|
162 | | - blockloop = false; |
---|
163 | | - } |
---|
164 | | -} |
---|
165 | 249 | |
---|
166 | 250 | // MOCAP SUPPORT |
---|
167 | 251 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
486 | 570 | toParent = LA.newMatrix(); |
---|
487 | 571 | fromParent = LA.newMatrix(); |
---|
488 | 572 | } |
---|
| 573 | + |
---|
489 | 574 | if (toParentMarked == null) |
---|
490 | 575 | { |
---|
491 | 576 | if (maxcount != 1) |
---|
492 | 577 | { |
---|
493 | 578 | new Exception().printStackTrace(); |
---|
494 | 579 | } |
---|
| 580 | + |
---|
495 | 581 | toParentMarked = LA.newMatrix(); |
---|
496 | 582 | fromParentMarked = LA.newMatrix(); |
---|
497 | 583 | } |
---|
.. | .. |
---|
802 | 888 | |
---|
803 | 889 | if (marked && Globals.isLIVE() && live && |
---|
804 | 890 | //TEMP21aug2018 |
---|
805 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 891 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
806 | 892 | currentframe != Globals.framecount) |
---|
807 | 893 | { |
---|
808 | 894 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
814 | 900 | |
---|
815 | 901 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
816 | 902 | |
---|
817 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 903 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 904 | + (step == 1 && changedir)) |
---|
818 | 905 | { |
---|
819 | 906 | countdown = 1; |
---|
820 | 907 | delay = speedup?8:1; |
---|
.. | .. |
---|
886 | 973 | if (material == null || material.multiply) |
---|
887 | 974 | return true; |
---|
888 | 975 | |
---|
| 976 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
889 | 977 | return material.opacity > 0.99; |
---|
890 | 978 | } |
---|
891 | 979 | |
---|
.. | .. |
---|
2307 | 2395 | } |
---|
2308 | 2396 | */ |
---|
2309 | 2397 | } |
---|
| 2398 | + else |
---|
| 2399 | + { |
---|
| 2400 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2401 | + } |
---|
2310 | 2402 | } |
---|
2311 | 2403 | |
---|
2312 | 2404 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2348 | 2440 | { |
---|
2349 | 2441 | editWindow.refreshContents(); |
---|
2350 | 2442 | } |
---|
| 2443 | + else |
---|
| 2444 | + { |
---|
| 2445 | + if (manipWindow != null) |
---|
| 2446 | + { |
---|
| 2447 | + manipWindow.refreshContents(); |
---|
| 2448 | + } |
---|
| 2449 | + } |
---|
| 2450 | + |
---|
2351 | 2451 | //if (parent != null) |
---|
2352 | 2452 | //parent.refreshEditWindow(); |
---|
2353 | 2453 | } |
---|
.. | .. |
---|
2632 | 2732 | //Touch(); |
---|
2633 | 2733 | } |
---|
2634 | 2734 | |
---|
| 2735 | + void GenNormalsMeshS() |
---|
| 2736 | + { |
---|
| 2737 | + selection.GenNormalsMesh(); |
---|
| 2738 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2739 | +// { |
---|
| 2740 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2741 | +// selectee.GenNormals(crease); |
---|
| 2742 | +// } |
---|
| 2743 | + |
---|
| 2744 | + //Touch(); |
---|
| 2745 | + } |
---|
| 2746 | + |
---|
2635 | 2747 | void ClearColorsS() |
---|
2636 | 2748 | { |
---|
2637 | 2749 | selection.ClearColors(); |
---|
.. | .. |
---|
2763 | 2875 | if (child == null) |
---|
2764 | 2876 | continue; |
---|
2765 | 2877 | child.GenNormals(crease); |
---|
| 2878 | +// Children().release(i); |
---|
| 2879 | + } |
---|
| 2880 | + blockloop = false; |
---|
| 2881 | + } |
---|
| 2882 | + |
---|
| 2883 | + void GenNormalsMesh() |
---|
| 2884 | + { |
---|
| 2885 | + if (blockloop) |
---|
| 2886 | + return; |
---|
| 2887 | + |
---|
| 2888 | + blockloop = true; |
---|
| 2889 | + GenNormalsMesh0(); |
---|
| 2890 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2891 | + { |
---|
| 2892 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2893 | + if (child == null) |
---|
| 2894 | + continue; |
---|
| 2895 | + child.GenNormalsMesh(); |
---|
2766 | 2896 | // Children().release(i); |
---|
2767 | 2897 | } |
---|
2768 | 2898 | blockloop = false; |
---|
.. | .. |
---|
2931 | 3061 | if (bRep != null) |
---|
2932 | 3062 | { |
---|
2933 | 3063 | bRep.GenerateNormals(crease); |
---|
| 3064 | + Touch(); |
---|
| 3065 | + } |
---|
| 3066 | + } |
---|
| 3067 | + |
---|
| 3068 | + void GenNormalsMesh0() |
---|
| 3069 | + { |
---|
| 3070 | + if (bRep != null) |
---|
| 3071 | + { |
---|
| 3072 | + bRep.GenerateNormalsMesh(); |
---|
2934 | 3073 | Touch(); |
---|
2935 | 3074 | } |
---|
2936 | 3075 | } |
---|
.. | .. |
---|
3385 | 3524 | if (blockloop) |
---|
3386 | 3525 | return; |
---|
3387 | 3526 | |
---|
3388 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3527 | + if (//marked || // does not make sense |
---|
| 3528 | + (bRep != null || material != null)) // borderline... |
---|
3389 | 3529 | live = h; |
---|
3390 | 3530 | |
---|
3391 | 3531 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3406 | 3546 | return; |
---|
3407 | 3547 | |
---|
3408 | 3548 | //if (bRep != null) |
---|
3409 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3549 | + if (//marked || // does not make sense |
---|
| 3550 | + (bRep != null || material != null)) // borderline... |
---|
3410 | 3551 | link2master = h; |
---|
3411 | 3552 | |
---|
3412 | 3553 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3426 | 3567 | if (blockloop) |
---|
3427 | 3568 | return; |
---|
3428 | 3569 | |
---|
3429 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3570 | + if (//marked || // does not make sense |
---|
| 3571 | + (bRep != null || material != null)) // borderline... |
---|
3430 | 3572 | hide = h; |
---|
3431 | 3573 | |
---|
3432 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3446 | 3588 | if (blockloop) |
---|
3447 | 3589 | return; |
---|
3448 | 3590 | |
---|
3449 | | - if (bRep != null && material != null) // borderline... |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
3450 | 3592 | marked = h; |
---|
3451 | 3593 | |
---|
3452 | 3594 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3456 | 3598 | continue; |
---|
3457 | 3599 | blockloop = true; |
---|
3458 | 3600 | child.MarkLeaves(h); |
---|
| 3601 | + blockloop = false; |
---|
| 3602 | + // release(i); |
---|
| 3603 | + } |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + void RewindLeaves(boolean h) |
---|
| 3607 | + { |
---|
| 3608 | + if (blockloop) |
---|
| 3609 | + return; |
---|
| 3610 | + |
---|
| 3611 | + if (bRep != null || material != null) // borderline... |
---|
| 3612 | + rewind = h; |
---|
| 3613 | + |
---|
| 3614 | + for (int i = 0; i < Size(); i++) |
---|
| 3615 | + { |
---|
| 3616 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3617 | + if (child == null) |
---|
| 3618 | + continue; |
---|
| 3619 | + blockloop = true; |
---|
| 3620 | + child.RewindLeaves(h); |
---|
| 3621 | + blockloop = false; |
---|
| 3622 | + // release(i); |
---|
| 3623 | + } |
---|
| 3624 | + } |
---|
| 3625 | + |
---|
| 3626 | + void RandomLeaves(boolean h) |
---|
| 3627 | + { |
---|
| 3628 | + if (blockloop) |
---|
| 3629 | + return; |
---|
| 3630 | + |
---|
| 3631 | + if (bRep != null || material != null) // borderline... |
---|
| 3632 | + random = h; |
---|
| 3633 | + |
---|
| 3634 | + for (int i = 0; i < Size(); i++) |
---|
| 3635 | + { |
---|
| 3636 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3637 | + if (child == null) |
---|
| 3638 | + continue; |
---|
| 3639 | + blockloop = true; |
---|
| 3640 | + child.RandomLeaves(h); |
---|
3459 | 3641 | blockloop = false; |
---|
3460 | 3642 | // release(i); |
---|
3461 | 3643 | } |
---|
.. | .. |
---|
4233 | 4415 | } |
---|
4234 | 4416 | } |
---|
4235 | 4417 | |
---|
| 4418 | + void RepairSOV() |
---|
| 4419 | + { |
---|
| 4420 | + if (blockloop) |
---|
| 4421 | + return; |
---|
| 4422 | + |
---|
| 4423 | + String texname = this.GetPigmentTexture(); |
---|
| 4424 | + |
---|
| 4425 | + if (texname.startsWith("sov")) |
---|
| 4426 | + { |
---|
| 4427 | + String[] s = texname.split("/"); |
---|
| 4428 | + |
---|
| 4429 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4430 | + |
---|
| 4431 | + texname = sname[0]; |
---|
| 4432 | + |
---|
| 4433 | + if (sname.length > 1) |
---|
| 4434 | + { |
---|
| 4435 | + texname += "Color.jpg"; |
---|
| 4436 | + } |
---|
| 4437 | + |
---|
| 4438 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4439 | + } |
---|
| 4440 | + |
---|
| 4441 | + texname = this.GetBumpTexture(); |
---|
| 4442 | + |
---|
| 4443 | + if (texname.startsWith("sov")) |
---|
| 4444 | + { |
---|
| 4445 | + String[] s = texname.split("/"); |
---|
| 4446 | + |
---|
| 4447 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4448 | + |
---|
| 4449 | + texname = sname[0]; |
---|
| 4450 | + |
---|
| 4451 | + if (sname.length > 1) |
---|
| 4452 | + { |
---|
| 4453 | + texname += "Bump.jpg"; |
---|
| 4454 | + } |
---|
| 4455 | + |
---|
| 4456 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4457 | + } |
---|
| 4458 | + |
---|
| 4459 | + for (int i=0; i<Size(); i++) |
---|
| 4460 | + { |
---|
| 4461 | + blockloop = true; |
---|
| 4462 | + get(i).RepairSOV(); |
---|
| 4463 | + blockloop = false; |
---|
| 4464 | + } |
---|
| 4465 | + } |
---|
| 4466 | + |
---|
4236 | 4467 | void RepairTexture() |
---|
4237 | 4468 | { |
---|
4238 | 4469 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
4747 | 4978 | } |
---|
4748 | 4979 | } |
---|
4749 | 4980 | |
---|
| 4981 | + ObjEditor GetWindow() |
---|
| 4982 | + { |
---|
| 4983 | + if (editWindow != null) |
---|
| 4984 | + return editWindow; |
---|
| 4985 | + |
---|
| 4986 | + return manipWindow; |
---|
| 4987 | + } |
---|
| 4988 | + |
---|
4750 | 4989 | cTreePath Select(int indexcount, boolean deselect) |
---|
4751 | 4990 | { |
---|
4752 | 4991 | if (hide || dontselect) |
---|
.. | .. |
---|
4783 | 5022 | if (leaf != null) |
---|
4784 | 5023 | { |
---|
4785 | 5024 | cTreePath tp = new cTreePath(this, leaf); |
---|
4786 | | - if (editWindow != null) |
---|
| 5025 | + ObjEditor window = GetWindow(); |
---|
| 5026 | + if (window != null) |
---|
4787 | 5027 | { |
---|
4788 | 5028 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4789 | | - editWindow.Select(tp, deselect, true); |
---|
| 5029 | + window.Select(tp, deselect, true); |
---|
4790 | 5030 | } |
---|
4791 | 5031 | |
---|
4792 | 5032 | return tp; |
---|
.. | .. |
---|
4803 | 5043 | |
---|
4804 | 5044 | if (child == null) |
---|
4805 | 5045 | continue; |
---|
| 5046 | + |
---|
4806 | 5047 | if (child.HasTransparency() && child.size() != 0) |
---|
4807 | 5048 | { |
---|
4808 | 5049 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4812 | 5053 | if (leaf != null) |
---|
4813 | 5054 | { |
---|
4814 | 5055 | cTreePath tp = new cTreePath(this, leaf); |
---|
4815 | | - if (editWindow != null) |
---|
| 5056 | + ObjEditor window = GetWindow(); |
---|
| 5057 | + if (window != null) |
---|
4816 | 5058 | { |
---|
4817 | | - editWindow.Select(tp, deselect, true); |
---|
| 5059 | + window.Select(tp, deselect, true); |
---|
4818 | 5060 | } |
---|
4819 | 5061 | |
---|
4820 | 5062 | return tp; |
---|
.. | .. |
---|
5456 | 5698 | boolean NeedSupport() |
---|
5457 | 5699 | { |
---|
5458 | 5700 | return |
---|
5459 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5701 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5460 | 5702 | // PROBLEM with CROWD!! |
---|
5461 | 5703 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5462 | 5704 | } |
---|
5463 | 5705 | |
---|
5464 | 5706 | static boolean DEBUG_SELECTION = false; |
---|
| 5707 | + |
---|
| 5708 | + boolean IsLive() |
---|
| 5709 | + { |
---|
| 5710 | + if (live) |
---|
| 5711 | + return true; |
---|
| 5712 | + |
---|
| 5713 | + if (parent == null) |
---|
| 5714 | + return false; |
---|
| 5715 | + |
---|
| 5716 | + return parent.IsLive(); |
---|
| 5717 | + } |
---|
5465 | 5718 | |
---|
5466 | 5719 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5467 | 5720 | { |
---|
.. | .. |
---|
5524 | 5777 | support = support; |
---|
5525 | 5778 | |
---|
5526 | 5779 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5527 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5780 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5528 | 5781 | |
---|
5529 | 5782 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5530 | 5783 | { |
---|
.. | .. |
---|
5544 | 5797 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5545 | 5798 | |
---|
5546 | 5799 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5547 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5800 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5801 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5548 | 5802 | { |
---|
5549 | 5803 | Globals.lighttouched = true; |
---|
5550 | 5804 | } // all panes... |
---|
| 5805 | + |
---|
5551 | 5806 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5552 | 5807 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5553 | 5808 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5675 | 5930 | if (GetBRep() != null) |
---|
5676 | 5931 | { |
---|
5677 | 5932 | display.NextIndex(); |
---|
| 5933 | + |
---|
5678 | 5934 | // vertex color conflict : gl.glCallList(list); |
---|
5679 | 5935 | DrawNode(display, root, selected); |
---|
5680 | 5936 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5715 | 5971 | tex = GetTextures(); |
---|
5716 | 5972 | } |
---|
5717 | 5973 | |
---|
5718 | | - boolean failed = false; |
---|
| 5974 | + boolean failedPigment = false; |
---|
| 5975 | + boolean failedBump = false; |
---|
5719 | 5976 | |
---|
5720 | 5977 | try |
---|
5721 | 5978 | { |
---|
5722 | | - display.BindTextures(tex, texres); |
---|
| 5979 | + display.BindPigmentTexture(tex, texres); |
---|
5723 | 5980 | } |
---|
5724 | 5981 | catch (Exception e) |
---|
5725 | 5982 | { |
---|
5726 | 5983 | System.err.println("FAILED: " + this); |
---|
5727 | | - failed = true; |
---|
| 5984 | + failedPigment = true; |
---|
| 5985 | + } |
---|
| 5986 | + |
---|
| 5987 | + try |
---|
| 5988 | + { |
---|
| 5989 | + display.BindBumpTexture(tex, texres); |
---|
| 5990 | + } |
---|
| 5991 | + catch (Exception e) |
---|
| 5992 | + { |
---|
| 5993 | + //System.err.println("FAILED: " + this); |
---|
| 5994 | + failedBump = true; |
---|
5728 | 5995 | } |
---|
5729 | 5996 | |
---|
5730 | 5997 | if (!compiled) |
---|
.. | .. |
---|
5747 | 6014 | } |
---|
5748 | 6015 | } |
---|
5749 | 6016 | |
---|
5750 | | - if (!failed) |
---|
5751 | | - display.ReleaseTextures(tex); |
---|
| 6017 | + if (!failedBump) |
---|
| 6018 | + display.ReleaseBumpTexture(tex); |
---|
| 6019 | + |
---|
| 6020 | + if (!failedPigment) |
---|
| 6021 | + display.ReleasePigmentTexture(tex); |
---|
5752 | 6022 | |
---|
5753 | 6023 | display.PopMaterial(this, selected); |
---|
5754 | 6024 | } |
---|
.. | .. |
---|
6121 | 6391 | // dec 2012 |
---|
6122 | 6392 | new Exception().printStackTrace(); |
---|
6123 | 6393 | return; |
---|
| 6394 | + } |
---|
| 6395 | + |
---|
| 6396 | + if (dontselect) |
---|
| 6397 | + { |
---|
| 6398 | + //bRep.GenerateNormalsMINE(); |
---|
6124 | 6399 | } |
---|
6125 | 6400 | |
---|
6126 | 6401 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
6973 | 7248 | spot.translate(32, 32); |
---|
6974 | 7249 | spotw = spot.x + spot.width; |
---|
6975 | 7250 | spoth = spot.y + spot.height; |
---|
6976 | | - info.g.setColor(Color.blue); |
---|
| 7251 | + info.g.setColor(Color.cyan); |
---|
6977 | 7252 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6978 | 7253 | // if (CameraPane.Xmin > spot.x) |
---|
6979 | 7254 | // { |
---|
.. | .. |
---|
6991 | 7266 | // { |
---|
6992 | 7267 | // CameraPane.Ymax = spoth; |
---|
6993 | 7268 | // } |
---|
6994 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6995 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7269 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7270 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6996 | 7271 | spot.translate(0, -32); |
---|
6997 | | - info.g.setColor(Color.green); |
---|
| 7272 | + info.g.setColor(Color.yellow); |
---|
6998 | 7273 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7274 | + info.g.setColor(Color.green); |
---|
6999 | 7275 | // if (CameraPane.Xmin > spot.x) |
---|
7000 | 7276 | // { |
---|
7001 | 7277 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7012 | 7288 | // { |
---|
7013 | 7289 | // CameraPane.Ymax = spoth; |
---|
7014 | 7290 | // } |
---|
7015 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7016 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7291 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7292 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
7017 | 7293 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7018 | 7294 | // if (CameraPane.Xmin > boundary.x) |
---|
7019 | 7295 | // { |
---|
.. | .. |
---|
7313 | 7589 | switch (info.pane.RenderCamera().viewCode) |
---|
7314 | 7590 | { |
---|
7315 | 7591 | case 3: // '\001' |
---|
7316 | | - if (modified) |
---|
| 7592 | + if (modified || opposite) |
---|
7317 | 7593 | { |
---|
7318 | 7594 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7319 | 7595 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7320 | 7596 | } // vScale, 1); |
---|
7321 | 7597 | else |
---|
7322 | 7598 | { |
---|
| 7599 | + // EXCEPTION! |
---|
7323 | 7600 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7324 | 7601 | } // vScale, 1); |
---|
7325 | 7602 | break; |
---|
7326 | 7603 | |
---|
7327 | 7604 | case 2: // '\002' |
---|
7328 | | - if (modified) |
---|
| 7605 | + if (modified || opposite) |
---|
7329 | 7606 | { |
---|
7330 | 7607 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7331 | 7608 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7336 | 7613 | break; |
---|
7337 | 7614 | |
---|
7338 | 7615 | case 1: // '\003' |
---|
7339 | | - if (modified) |
---|
| 7616 | + if (modified || opposite) |
---|
7340 | 7617 | { |
---|
7341 | 7618 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7342 | 7619 | LA.matScale(toParent, 1, 1, totalScale); |
---|
.. | .. |
---|
7556 | 7833 | editWindow = null; |
---|
7557 | 7834 | } // ? |
---|
7558 | 7835 | } |
---|
| 7836 | + else |
---|
| 7837 | + { |
---|
| 7838 | + //editWindow.closeUI(); |
---|
| 7839 | + } |
---|
7559 | 7840 | } |
---|
7560 | 7841 | |
---|
7561 | 7842 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7567 | 7848 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7568 | 7849 | |
---|
7569 | 7850 | Object3D /*Composite*/ parent; |
---|
7570 | | - Object3D /*Composite*/ fileparent; |
---|
| 7851 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7571 | 7852 | |
---|
7572 | 7853 | double[][] toParent; // dynamic matrix |
---|
7573 | 7854 | double[][] fromParent; |
---|
.. | .. |
---|
7713 | 7994 | } |
---|
7714 | 7995 | |
---|
7715 | 7996 | transient ObjEditor editWindow; |
---|
| 7997 | + transient ObjEditor manipWindow; |
---|
| 7998 | + |
---|
| 7999 | + transient boolean pinned; |
---|
| 8000 | + |
---|
7716 | 8001 | transient ObjectUI objectUI; |
---|
7717 | 8002 | public static int povDepth = 0; |
---|
7718 | 8003 | private static cVector tbMin = new cVector(); |
---|