.. | .. |
---|
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; |
---|
| 118 | + void SaveSupports() |
---|
| 119 | + { |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
117 | 122 | |
---|
118 | | - transientsupport = support; |
---|
119 | | - transientlink2master = link2master; |
---|
120 | | - |
---|
121 | | - support = null; |
---|
122 | | - link2master = false; |
---|
123 | | - |
---|
124 | | - if (bRep != null) |
---|
125 | | - { |
---|
126 | | - bRep.SaveSupports(); |
---|
127 | | - } |
---|
128 | | - |
---|
129 | | - for (int i = 0; i < Size(); i++) |
---|
130 | | - { |
---|
131 | | - Object3D child = (Object3D) get(i); |
---|
132 | | - if (child == null) |
---|
133 | | - continue; |
---|
134 | | - blockloop = true; |
---|
135 | | - child.SaveSupports(); |
---|
136 | | - blockloop = false; |
---|
137 | | - } |
---|
138 | | -} |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
139 | 125 | |
---|
140 | | -void RestoreSupports() |
---|
141 | | -{ |
---|
142 | | - if (blockloop) |
---|
143 | | - return; |
---|
| 126 | + support = null; |
---|
| 127 | + link2master = false; |
---|
144 | 128 | |
---|
145 | | - support = transientsupport; |
---|
146 | | - link2master = transientlink2master; |
---|
147 | | - transientsupport = null; |
---|
148 | | - transientlink2master = false; |
---|
149 | | - |
---|
150 | | - if (bRep != null) |
---|
151 | | - { |
---|
152 | | - bRep.RestoreSupports(); |
---|
153 | | - } |
---|
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 | | -} |
---|
| 129 | + if (bRep != null) |
---|
| 130 | + { |
---|
| 131 | + bRep.SaveSupports(); |
---|
| 132 | + } |
---|
165 | 133 | |
---|
166 | | -void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
167 | | -{ |
---|
168 | | - if (hashtable.containsKey(GetUUID())) |
---|
169 | | - return; |
---|
170 | | - |
---|
171 | | - Object3D o = new Object3D(); |
---|
172 | | - o.bRep = this.bRep; |
---|
173 | | - if (this.bRep != null) |
---|
174 | | - { |
---|
175 | | - o.transientrep = this.bRep.support; |
---|
176 | | - o.bRep.support = null; |
---|
| 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 | + } |
---|
177 | 143 | } |
---|
178 | | - |
---|
179 | | -// o.support = this.support; |
---|
180 | | -// o.fileparent = this.fileparent; |
---|
181 | | -// if (this.bRep != null) |
---|
182 | | -// o.bRep = this.bRep.support; |
---|
183 | | - |
---|
184 | | - hashtable.put(GetUUID(), o); |
---|
185 | | - |
---|
186 | | - this.bRep = null; |
---|
187 | | -// if (this.bRep != null) |
---|
188 | | -// this.bRep.support = null; |
---|
189 | | -// this.support = null; |
---|
190 | | -// this.fileparent = null; |
---|
191 | | - |
---|
192 | | - for (int i=0; i<Size(); i++) |
---|
193 | | - { |
---|
194 | | - get(i).ExtractBigData(hashtable); |
---|
195 | | - } |
---|
196 | | -} |
---|
197 | 144 | |
---|
198 | | -void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
199 | | -{ |
---|
200 | | - if (!hashtable.containsKey(GetUUID())) |
---|
201 | | - return; |
---|
202 | | - |
---|
203 | | - Object3D o = hashtable.get(GetUUID()); |
---|
204 | | - |
---|
205 | | - this.bRep = o.bRep; |
---|
206 | | - if (this.bRep != null) |
---|
207 | | - this.bRep.support = o.transientrep; |
---|
208 | | -// this.support = o.support; |
---|
209 | | -// this.fileparent = o.fileparent; |
---|
210 | | - |
---|
211 | | - hashtable.remove(GetUUID()); |
---|
212 | | - |
---|
213 | | - for (int i=0; i<Size(); i++) |
---|
| 145 | + void RestoreSupports() |
---|
214 | 146 | { |
---|
215 | | - get(i).RestoreBigData(hashtable); |
---|
| 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 | + } |
---|
216 | 169 | } |
---|
217 | | -} |
---|
| 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(); |
---|
| 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 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 223 | + |
---|
| 224 | + RestoreBigData(o); |
---|
| 225 | + |
---|
| 226 | + hashtable.remove(GetUUID()); |
---|
| 227 | + |
---|
| 228 | + for (int i=0; i<Size(); i++) |
---|
| 229 | + { |
---|
| 230 | + get(i).RestoreBigData(hashtable); |
---|
| 231 | + } |
---|
| 232 | + } |
---|
| 233 | + |
---|
| 234 | + void RestoreBigData(Object3D o) |
---|
| 235 | + { |
---|
| 236 | + this.bRep = o.bRep; |
---|
| 237 | + if (this.bRep != null) |
---|
| 238 | + this.bRep.support = o.transientrep; |
---|
| 239 | + // this.support = o.support; |
---|
| 240 | + // this.fileparent = o.fileparent; |
---|
| 241 | + } |
---|
218 | 242 | |
---|
219 | 243 | // MOCAP SUPPORT |
---|
220 | 244 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
539 | 563 | toParent = LA.newMatrix(); |
---|
540 | 564 | fromParent = LA.newMatrix(); |
---|
541 | 565 | } |
---|
| 566 | + |
---|
542 | 567 | if (toParentMarked == null) |
---|
543 | 568 | { |
---|
544 | 569 | if (maxcount != 1) |
---|
545 | 570 | { |
---|
546 | 571 | new Exception().printStackTrace(); |
---|
547 | 572 | } |
---|
| 573 | + |
---|
548 | 574 | toParentMarked = LA.newMatrix(); |
---|
549 | 575 | fromParentMarked = LA.newMatrix(); |
---|
550 | 576 | } |
---|
.. | .. |
---|
867 | 893 | |
---|
868 | 894 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
869 | 895 | |
---|
870 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 896 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 897 | + (step == 1 && changedir)) |
---|
871 | 898 | { |
---|
872 | 899 | countdown = 1; |
---|
873 | 900 | delay = speedup?8:1; |
---|
.. | .. |
---|
2685 | 2712 | //Touch(); |
---|
2686 | 2713 | } |
---|
2687 | 2714 | |
---|
| 2715 | + void GenNormalsMeshS() |
---|
| 2716 | + { |
---|
| 2717 | + selection.GenNormalsMesh(); |
---|
| 2718 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2719 | +// { |
---|
| 2720 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2721 | +// selectee.GenNormals(crease); |
---|
| 2722 | +// } |
---|
| 2723 | + |
---|
| 2724 | + //Touch(); |
---|
| 2725 | + } |
---|
| 2726 | + |
---|
2688 | 2727 | void ClearColorsS() |
---|
2689 | 2728 | { |
---|
2690 | 2729 | selection.ClearColors(); |
---|
.. | .. |
---|
2816 | 2855 | if (child == null) |
---|
2817 | 2856 | continue; |
---|
2818 | 2857 | child.GenNormals(crease); |
---|
| 2858 | +// Children().release(i); |
---|
| 2859 | + } |
---|
| 2860 | + blockloop = false; |
---|
| 2861 | + } |
---|
| 2862 | + |
---|
| 2863 | + void GenNormalsMesh() |
---|
| 2864 | + { |
---|
| 2865 | + if (blockloop) |
---|
| 2866 | + return; |
---|
| 2867 | + |
---|
| 2868 | + blockloop = true; |
---|
| 2869 | + GenNormalsMesh0(); |
---|
| 2870 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2871 | + { |
---|
| 2872 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2873 | + if (child == null) |
---|
| 2874 | + continue; |
---|
| 2875 | + child.GenNormalsMesh(); |
---|
2819 | 2876 | // Children().release(i); |
---|
2820 | 2877 | } |
---|
2821 | 2878 | blockloop = false; |
---|
.. | .. |
---|
2984 | 3041 | if (bRep != null) |
---|
2985 | 3042 | { |
---|
2986 | 3043 | bRep.GenerateNormals(crease); |
---|
| 3044 | + Touch(); |
---|
| 3045 | + } |
---|
| 3046 | + } |
---|
| 3047 | + |
---|
| 3048 | + void GenNormalsMesh0() |
---|
| 3049 | + { |
---|
| 3050 | + if (bRep != null) |
---|
| 3051 | + { |
---|
| 3052 | + bRep.GenerateNormalsMesh(); |
---|
2987 | 3053 | Touch(); |
---|
2988 | 3054 | } |
---|
2989 | 3055 | } |
---|
.. | .. |
---|
3438 | 3504 | if (blockloop) |
---|
3439 | 3505 | return; |
---|
3440 | 3506 | |
---|
3441 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3507 | + if (//marked || // does not make sense |
---|
| 3508 | + (bRep != null || material != null)) // borderline... |
---|
3442 | 3509 | live = h; |
---|
3443 | 3510 | |
---|
3444 | 3511 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3459 | 3526 | return; |
---|
3460 | 3527 | |
---|
3461 | 3528 | //if (bRep != null) |
---|
3462 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3529 | + if (//marked || // does not make sense |
---|
| 3530 | + (bRep != null || material != null)) // borderline... |
---|
3463 | 3531 | link2master = h; |
---|
3464 | 3532 | |
---|
3465 | 3533 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3479 | 3547 | if (blockloop) |
---|
3480 | 3548 | return; |
---|
3481 | 3549 | |
---|
3482 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3550 | + if (//marked || // does not make sense |
---|
| 3551 | + (bRep != null || material != null)) // borderline... |
---|
3483 | 3552 | hide = h; |
---|
3484 | 3553 | |
---|
3485 | 3554 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3499 | 3568 | if (blockloop) |
---|
3500 | 3569 | return; |
---|
3501 | 3570 | |
---|
3502 | | - if (bRep != null && material != null) // borderline... |
---|
| 3571 | + if (bRep != null || material != null) // borderline... |
---|
3503 | 3572 | marked = h; |
---|
3504 | 3573 | |
---|
3505 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3509 | 3578 | continue; |
---|
3510 | 3579 | blockloop = true; |
---|
3511 | 3580 | child.MarkLeaves(h); |
---|
| 3581 | + blockloop = false; |
---|
| 3582 | + // release(i); |
---|
| 3583 | + } |
---|
| 3584 | + } |
---|
| 3585 | + |
---|
| 3586 | + void RewindLeaves(boolean h) |
---|
| 3587 | + { |
---|
| 3588 | + if (blockloop) |
---|
| 3589 | + return; |
---|
| 3590 | + |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
| 3592 | + rewind = h; |
---|
| 3593 | + |
---|
| 3594 | + for (int i = 0; i < Size(); i++) |
---|
| 3595 | + { |
---|
| 3596 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3597 | + if (child == null) |
---|
| 3598 | + continue; |
---|
| 3599 | + blockloop = true; |
---|
| 3600 | + child.RewindLeaves(h); |
---|
| 3601 | + blockloop = false; |
---|
| 3602 | + // release(i); |
---|
| 3603 | + } |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + void RandomLeaves(boolean h) |
---|
| 3607 | + { |
---|
| 3608 | + if (blockloop) |
---|
| 3609 | + return; |
---|
| 3610 | + |
---|
| 3611 | + if (bRep != null || material != null) // borderline... |
---|
| 3612 | + random = 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.RandomLeaves(h); |
---|
3512 | 3621 | blockloop = false; |
---|
3513 | 3622 | // release(i); |
---|
3514 | 3623 | } |
---|
.. | .. |
---|
4282 | 4391 | { |
---|
4283 | 4392 | blockloop = true; |
---|
4284 | 4393 | get(i).RepairShadow(); |
---|
| 4394 | + blockloop = false; |
---|
| 4395 | + } |
---|
| 4396 | + } |
---|
| 4397 | + |
---|
| 4398 | + void RepairSOV() |
---|
| 4399 | + { |
---|
| 4400 | + if (blockloop) |
---|
| 4401 | + return; |
---|
| 4402 | + |
---|
| 4403 | + String texname = this.GetPigmentTexture(); |
---|
| 4404 | + |
---|
| 4405 | + if (texname.startsWith("sov")) |
---|
| 4406 | + { |
---|
| 4407 | + String[] s = texname.split("/"); |
---|
| 4408 | + |
---|
| 4409 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4410 | + |
---|
| 4411 | + texname = sname[0]; |
---|
| 4412 | + |
---|
| 4413 | + if (sname.length > 1) |
---|
| 4414 | + { |
---|
| 4415 | + texname += "Color.jpg"; |
---|
| 4416 | + } |
---|
| 4417 | + |
---|
| 4418 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4419 | + } |
---|
| 4420 | + |
---|
| 4421 | + texname = this.GetBumpTexture(); |
---|
| 4422 | + |
---|
| 4423 | + if (texname.startsWith("sov")) |
---|
| 4424 | + { |
---|
| 4425 | + String[] s = texname.split("/"); |
---|
| 4426 | + |
---|
| 4427 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4428 | + |
---|
| 4429 | + texname = sname[0]; |
---|
| 4430 | + |
---|
| 4431 | + if (sname.length > 1) |
---|
| 4432 | + { |
---|
| 4433 | + texname += "Bump.jpg"; |
---|
| 4434 | + } |
---|
| 4435 | + |
---|
| 4436 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4437 | + } |
---|
| 4438 | + |
---|
| 4439 | + for (int i=0; i<Size(); i++) |
---|
| 4440 | + { |
---|
| 4441 | + blockloop = true; |
---|
| 4442 | + get(i).RepairSOV(); |
---|
4285 | 4443 | blockloop = false; |
---|
4286 | 4444 | } |
---|
4287 | 4445 | } |
---|
.. | .. |
---|
5509 | 5667 | boolean NeedSupport() |
---|
5510 | 5668 | { |
---|
5511 | 5669 | return |
---|
5512 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5670 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5513 | 5671 | // PROBLEM with CROWD!! |
---|
5514 | 5672 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5515 | 5673 | } |
---|
5516 | 5674 | |
---|
5517 | 5675 | static boolean DEBUG_SELECTION = false; |
---|
| 5676 | + |
---|
| 5677 | + boolean IsLive() |
---|
| 5678 | + { |
---|
| 5679 | + if (live) |
---|
| 5680 | + return true; |
---|
| 5681 | + |
---|
| 5682 | + if (parent == null) |
---|
| 5683 | + return false; |
---|
| 5684 | + |
---|
| 5685 | + return parent.IsLive(); |
---|
| 5686 | + } |
---|
5518 | 5687 | |
---|
5519 | 5688 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5520 | 5689 | { |
---|
.. | .. |
---|
5577 | 5746 | support = support; |
---|
5578 | 5747 | |
---|
5579 | 5748 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5580 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5749 | + boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5581 | 5750 | |
---|
5582 | 5751 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5583 | 5752 | { |
---|
.. | .. |
---|
5597 | 5766 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5598 | 5767 | |
---|
5599 | 5768 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5600 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5769 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5770 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5601 | 5771 | { |
---|
5602 | 5772 | Globals.lighttouched = true; |
---|
5603 | 5773 | } // all panes... |
---|
| 5774 | + |
---|
5604 | 5775 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5605 | 5776 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5606 | 5777 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5768 | 5939 | tex = GetTextures(); |
---|
5769 | 5940 | } |
---|
5770 | 5941 | |
---|
5771 | | - boolean failed = false; |
---|
| 5942 | + boolean failedPigment = false; |
---|
| 5943 | + boolean failedBump = false; |
---|
5772 | 5944 | |
---|
5773 | 5945 | try |
---|
5774 | 5946 | { |
---|
5775 | | - display.BindTextures(tex, texres); |
---|
| 5947 | + display.BindPigmentTexture(tex, texres); |
---|
5776 | 5948 | } |
---|
5777 | 5949 | catch (Exception e) |
---|
5778 | 5950 | { |
---|
5779 | 5951 | System.err.println("FAILED: " + this); |
---|
5780 | | - failed = true; |
---|
| 5952 | + failedPigment = true; |
---|
| 5953 | + } |
---|
| 5954 | + |
---|
| 5955 | + try |
---|
| 5956 | + { |
---|
| 5957 | + display.BindBumpTexture(tex, texres); |
---|
| 5958 | + } |
---|
| 5959 | + catch (Exception e) |
---|
| 5960 | + { |
---|
| 5961 | + //System.err.println("FAILED: " + this); |
---|
| 5962 | + failedBump = true; |
---|
5781 | 5963 | } |
---|
5782 | 5964 | |
---|
5783 | 5965 | if (!compiled) |
---|
.. | .. |
---|
5800 | 5982 | } |
---|
5801 | 5983 | } |
---|
5802 | 5984 | |
---|
5803 | | - if (!failed) |
---|
5804 | | - display.ReleaseTextures(tex); |
---|
| 5985 | + if (!failedBump) |
---|
| 5986 | + display.ReleaseBumpTexture(tex); |
---|
| 5987 | + |
---|
| 5988 | + if (!failedPigment) |
---|
| 5989 | + display.ReleasePigmentTexture(tex); |
---|
5805 | 5990 | |
---|
5806 | 5991 | display.PopMaterial(this, selected); |
---|
5807 | 5992 | } |
---|
.. | .. |
---|
7026 | 7211 | spot.translate(32, 32); |
---|
7027 | 7212 | spotw = spot.x + spot.width; |
---|
7028 | 7213 | spoth = spot.y + spot.height; |
---|
7029 | | - info.g.setColor(Color.blue); |
---|
| 7214 | + info.g.setColor(Color.cyan); |
---|
7030 | 7215 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7031 | 7216 | // if (CameraPane.Xmin > spot.x) |
---|
7032 | 7217 | // { |
---|
.. | .. |
---|
7044 | 7229 | // { |
---|
7045 | 7230 | // CameraPane.Ymax = spoth; |
---|
7046 | 7231 | // } |
---|
7047 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7048 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7232 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7233 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7049 | 7234 | spot.translate(0, -32); |
---|
7050 | | - info.g.setColor(Color.green); |
---|
| 7235 | + info.g.setColor(Color.yellow); |
---|
7051 | 7236 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7237 | + info.g.setColor(Color.green); |
---|
7052 | 7238 | // if (CameraPane.Xmin > spot.x) |
---|
7053 | 7239 | // { |
---|
7054 | 7240 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7366 | 7552 | switch (info.pane.RenderCamera().viewCode) |
---|
7367 | 7553 | { |
---|
7368 | 7554 | case 3: // '\001' |
---|
7369 | | - if (modified) |
---|
| 7555 | + if (modified || opposite) |
---|
7370 | 7556 | { |
---|
7371 | 7557 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7372 | 7558 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7373 | 7559 | } // vScale, 1); |
---|
7374 | 7560 | else |
---|
7375 | 7561 | { |
---|
| 7562 | + // EXCEPTION! |
---|
7376 | 7563 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7377 | 7564 | } // vScale, 1); |
---|
7378 | 7565 | break; |
---|
7379 | 7566 | |
---|
7380 | 7567 | case 2: // '\002' |
---|
7381 | | - if (modified) |
---|
| 7568 | + if (modified || opposite) |
---|
7382 | 7569 | { |
---|
7383 | 7570 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7384 | 7571 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7389 | 7576 | break; |
---|
7390 | 7577 | |
---|
7391 | 7578 | case 1: // '\003' |
---|
7392 | | - if (modified) |
---|
| 7579 | + if (modified || opposite) |
---|
7393 | 7580 | { |
---|
7394 | 7581 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7395 | 7582 | LA.matScale(toParent, 1, 1, totalScale); |
---|