.. | .. |
---|
22 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
23 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
24 | 24 | |
---|
| 25 | + // Use GetUUID for backward compatibility with null. |
---|
25 | 26 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 27 | |
---|
27 | | - // TEMPORARY for mocap undo |
---|
28 | | - mocap.reader.BVHReader.BVHResult bvh; |
---|
29 | | - Object3D skeleton; |
---|
| 28 | + // TEMPORARY for mocap undo. No need to be transient. |
---|
| 29 | + mocap.reader.BVHReader.BVHResult savebvh; |
---|
| 30 | + Object3D saveskeleton; |
---|
30 | 31 | // |
---|
| 32 | + |
---|
| 33 | + String skyboxname; |
---|
| 34 | + String skyboxext; |
---|
| 35 | + |
---|
| 36 | + Object3D versionlist[]; |
---|
| 37 | + int versionindex = -1; |
---|
| 38 | + |
---|
| 39 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
31 | 40 | |
---|
32 | 41 | ScriptNode scriptnode; |
---|
33 | 42 | |
---|
.. | .. |
---|
170 | 179 | |
---|
171 | 180 | void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
172 | 181 | { |
---|
| 182 | + Object3D o; |
---|
| 183 | + |
---|
173 | 184 | if (hashtable.containsKey(GetUUID())) |
---|
174 | 185 | { |
---|
175 | | - Object3D o = hashtable.get(GetUUID()); |
---|
| 186 | + o = hashtable.get(GetUUID()); |
---|
176 | 187 | |
---|
177 | 188 | Grafreed.Assert(this.bRep == o.bRep); |
---|
178 | | - if (this.bRep != null) |
---|
179 | | - assert(this.bRep.support == o.transientrep); |
---|
| 189 | + //if (this.bRep != null) |
---|
| 190 | + // assert(this.bRep.support == o.transientrep); |
---|
| 191 | + if (this.support != null) |
---|
| 192 | + assert(this.support.bRep == o.transientrep); |
---|
| 193 | + } |
---|
| 194 | + else |
---|
| 195 | + { |
---|
| 196 | + o = new Object3D("copy of " + this.name); |
---|
180 | 197 | |
---|
181 | | - return; |
---|
| 198 | + hashtable.put(GetUUID(), o); |
---|
182 | 199 | } |
---|
183 | 200 | |
---|
184 | | - Object3D o = new Object3D("copy of " + this.name); |
---|
185 | | - |
---|
186 | | - hashtable.put(GetUUID(), o); |
---|
187 | | - |
---|
188 | | - for (int i=0; i<Size(); i++) |
---|
| 201 | + if (!blockloop) |
---|
189 | 202 | { |
---|
190 | | - get(i).ExtractBigData(hashtable); |
---|
| 203 | + blockloop = true; |
---|
| 204 | + |
---|
| 205 | + for (int i=0; i<Size(); i++) |
---|
| 206 | + { |
---|
| 207 | + get(i).ExtractBigData(hashtable); |
---|
| 208 | + } |
---|
| 209 | + |
---|
| 210 | + blockloop = false; |
---|
191 | 211 | } |
---|
192 | 212 | |
---|
193 | 213 | ExtractBigData(o); |
---|
.. | .. |
---|
195 | 215 | |
---|
196 | 216 | void ExtractBigData(Object3D o) |
---|
197 | 217 | { |
---|
| 218 | + if (o.bRep != null) |
---|
| 219 | + Grafreed.Assert(o.bRep == this.bRep); |
---|
| 220 | + |
---|
198 | 221 | o.bRep = this.bRep; |
---|
199 | | - if (this.bRep != null) |
---|
| 222 | +// July 2019 if (this.bRep != null) |
---|
| 223 | +// { |
---|
| 224 | +// o.transientrep = this.bRep.support; |
---|
| 225 | +// o.bRep.support = null; |
---|
| 226 | +// } |
---|
| 227 | + o.selection = this.selection; |
---|
| 228 | + o.versionlist = this.versionlist; |
---|
| 229 | + o.versionindex = this.versionindex; |
---|
| 230 | + |
---|
| 231 | + if (this.support != null) |
---|
200 | 232 | { |
---|
201 | | - o.transientrep = this.bRep.support; |
---|
202 | | - o.bRep.support = null; |
---|
| 233 | + if (o.transientrep != null) |
---|
| 234 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 235 | + |
---|
| 236 | + o.transientrep = this.support.bRep; |
---|
| 237 | + this.support.bRep = null; |
---|
203 | 238 | } |
---|
204 | 239 | |
---|
205 | 240 | // o.support = this.support; |
---|
.. | .. |
---|
214 | 249 | // this.fileparent = null; |
---|
215 | 250 | } |
---|
216 | 251 | |
---|
| 252 | +// Object3D GetObject(java.util.UUID uuid) |
---|
| 253 | +// { |
---|
| 254 | +// if (this.uuid.equals(uuid)) |
---|
| 255 | +// return this; |
---|
| 256 | +// |
---|
| 257 | +// if (blockloop) |
---|
| 258 | +// return null; |
---|
| 259 | +// |
---|
| 260 | +// blockloop = true; |
---|
| 261 | +// |
---|
| 262 | +// for (int i=0; i<Size(); i++) |
---|
| 263 | +// { |
---|
| 264 | +// Object3D o = get(i).GetObject(uuid); |
---|
| 265 | +// |
---|
| 266 | +// if (o != null) |
---|
| 267 | +// return o; |
---|
| 268 | +// } |
---|
| 269 | +// |
---|
| 270 | +// blockloop = false; |
---|
| 271 | +// |
---|
| 272 | +// return null; |
---|
| 273 | +// } |
---|
| 274 | + |
---|
217 | 275 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
218 | 276 | { |
---|
219 | 277 | if (!hashtable.containsKey(GetUUID())) |
---|
220 | 278 | return; |
---|
221 | 279 | |
---|
| 280 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 281 | + |
---|
| 282 | + RestoreBigData(o); |
---|
| 283 | + |
---|
222 | 284 | if (blockloop) |
---|
223 | 285 | return; |
---|
224 | 286 | |
---|
225 | 287 | blockloop = true; |
---|
226 | | - |
---|
227 | | - Object3D o = hashtable.get(GetUUID()); |
---|
228 | | - |
---|
229 | | - RestoreBigData(o); |
---|
230 | 288 | |
---|
231 | 289 | //hashtable.remove(GetUUID()); |
---|
232 | 290 | |
---|
.. | .. |
---|
241 | 299 | void RestoreBigData(Object3D o) |
---|
242 | 300 | { |
---|
243 | 301 | this.bRep = o.bRep; |
---|
244 | | - if (this.bRep != null) |
---|
245 | | - this.bRep.support = o.transientrep; |
---|
| 302 | + if (this.support != null && o.transientrep != null) |
---|
| 303 | + { |
---|
| 304 | + this.support.bRep = o.transientrep; |
---|
| 305 | + } |
---|
| 306 | + |
---|
| 307 | + this.selection = o.selection; |
---|
| 308 | + |
---|
| 309 | + this.versionlist = o.versionlist; |
---|
| 310 | + this.versionindex = o.versionindex; |
---|
| 311 | +// July 2019 if (this.bRep != null) |
---|
| 312 | +// this.bRep.support = o.transientrep; |
---|
246 | 313 | // this.support = o.support; |
---|
247 | 314 | // this.fileparent = o.fileparent; |
---|
248 | 315 | } |
---|
.. | .. |
---|
388 | 455 | } |
---|
389 | 456 | |
---|
390 | 457 | boolean live = false; |
---|
| 458 | + transient boolean keepdontselect; |
---|
391 | 459 | boolean dontselect = false; |
---|
392 | 460 | boolean hide = false; |
---|
393 | 461 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
973 | 1041 | if (material == null || material.multiply) |
---|
974 | 1042 | return true; |
---|
975 | 1043 | |
---|
| 1044 | + if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 1045 | + return false; |
---|
| 1046 | + |
---|
976 | 1047 | // Transparent objects are dynamic because we have to sort the triangles. |
---|
977 | 1048 | return material.opacity > 0.99; |
---|
978 | 1049 | } |
---|
.. | .. |
---|
1374 | 1445 | toParent = LA.newMatrix(); |
---|
1375 | 1446 | fromParent = LA.newMatrix(); |
---|
1376 | 1447 | } |
---|
| 1448 | + |
---|
1377 | 1449 | LA.matCopy(other.toParent, toParent); |
---|
1378 | 1450 | LA.matCopy(other.fromParent, fromParent); |
---|
1379 | 1451 | |
---|
.. | .. |
---|
2398 | 2470 | else |
---|
2399 | 2471 | { |
---|
2400 | 2472 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2473 | + if (objectUI != null) |
---|
| 2474 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2475 | + else |
---|
| 2476 | + //new Exception().printStackTrace(); |
---|
| 2477 | + System.err.println("objectUI is null"); |
---|
2401 | 2478 | } |
---|
2402 | 2479 | } |
---|
2403 | 2480 | |
---|
.. | .. |
---|
2527 | 2604 | private static final int editSelf = 1; |
---|
2528 | 2605 | private static final int editChild = 2; |
---|
2529 | 2606 | |
---|
2530 | | - void drawEditHandles(ClickInfo info, int level) |
---|
| 2607 | + void drawEditHandles(//ClickInfo info, |
---|
| 2608 | + int level) |
---|
2531 | 2609 | { |
---|
2532 | 2610 | if (level == 0) |
---|
2533 | 2611 | { |
---|
.. | .. |
---|
2535 | 2613 | return; |
---|
2536 | 2614 | |
---|
2537 | 2615 | Object3D selectee; |
---|
2538 | | - for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1)) |
---|
| 2616 | + for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info, |
---|
| 2617 | + level + 1)) |
---|
2539 | 2618 | { |
---|
2540 | 2619 | selectee = (Object3D) e.nextElement(); |
---|
2541 | 2620 | } |
---|
.. | .. |
---|
2543 | 2622 | } else |
---|
2544 | 2623 | { |
---|
2545 | 2624 | //super. |
---|
2546 | | - drawEditHandles0(info, level + 1); |
---|
| 2625 | + drawEditHandles0(//info, |
---|
| 2626 | + level + 1); |
---|
2547 | 2627 | } |
---|
2548 | 2628 | } |
---|
2549 | 2629 | |
---|
2550 | | - boolean doEditClick(ClickInfo info, int level) |
---|
| 2630 | + boolean doEditClick(//ClickInfo info, |
---|
| 2631 | + int level) |
---|
2551 | 2632 | { |
---|
2552 | 2633 | doSomething = 0; |
---|
2553 | 2634 | if (level == 0) |
---|
2554 | 2635 | { |
---|
2555 | | - return doParentClick(info); |
---|
| 2636 | + return doParentClick(); //info); |
---|
2556 | 2637 | } |
---|
2557 | 2638 | if (//super. |
---|
2558 | | - doEditClick0(info, level)) |
---|
| 2639 | + doEditClick0(//info, |
---|
| 2640 | + level)) |
---|
2559 | 2641 | { |
---|
2560 | 2642 | doSomething = 1; |
---|
2561 | 2643 | return true; |
---|
.. | .. |
---|
2565 | 2647 | } |
---|
2566 | 2648 | } |
---|
2567 | 2649 | |
---|
2568 | | - boolean doParentClick(ClickInfo info) |
---|
| 2650 | + boolean doParentClick() //ClickInfo info) |
---|
2569 | 2651 | { |
---|
2570 | 2652 | if (selection == null) |
---|
2571 | 2653 | { |
---|
.. | .. |
---|
2578 | 2660 | for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();) |
---|
2579 | 2661 | { |
---|
2580 | 2662 | Object3D selectee = (Object3D) e.nextElement(); |
---|
2581 | | - if (selectee.doEditClick(info, 1)) |
---|
| 2663 | + if (selectee.doEditClick(//info, |
---|
| 2664 | + 1)) |
---|
2582 | 2665 | { |
---|
2583 | 2666 | childToDrag = selectee; |
---|
2584 | 2667 | doSomething = 2; |
---|
.. | .. |
---|
2590 | 2673 | return retval; |
---|
2591 | 2674 | } |
---|
2592 | 2675 | |
---|
2593 | | - void doEditDrag(ClickInfo info, boolean opposite) |
---|
| 2676 | + void doEditDrag(//ClickInfo clickInfo, |
---|
| 2677 | + boolean opposite) |
---|
2594 | 2678 | { |
---|
2595 | 2679 | switch (doSomething) |
---|
2596 | 2680 | { |
---|
2597 | 2681 | case 1: // '\001' |
---|
2598 | 2682 | //super. |
---|
2599 | | - doEditDrag0(info, opposite); |
---|
| 2683 | + doEditDrag0(//clickInfo, |
---|
| 2684 | + opposite); |
---|
2600 | 2685 | break; |
---|
2601 | 2686 | |
---|
2602 | 2687 | case 2: // '\002' |
---|
.. | .. |
---|
2609 | 2694 | { |
---|
2610 | 2695 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2611 | 2696 | //childToDrag.doEditDrag(info); |
---|
2612 | | - sel.doEditDrag(info, opposite); |
---|
| 2697 | + sel.doEditDrag(//clickInfo, |
---|
| 2698 | + opposite); |
---|
2613 | 2699 | } else |
---|
2614 | 2700 | { |
---|
2615 | 2701 | //super. |
---|
2616 | | - doEditDrag0(info, opposite); |
---|
| 2702 | + doEditDrag0(//clickInfo, |
---|
| 2703 | + opposite); |
---|
2617 | 2704 | } |
---|
2618 | 2705 | } |
---|
2619 | 2706 | break; |
---|
.. | .. |
---|
2631 | 2718 | { |
---|
2632 | 2719 | deselectAll(); |
---|
2633 | 2720 | } |
---|
| 2721 | + |
---|
| 2722 | + new Exception().printStackTrace(); |
---|
| 2723 | + |
---|
2634 | 2724 | ClickInfo newInfo = new ClickInfo(); |
---|
2635 | 2725 | newInfo.flags = info.flags; |
---|
2636 | 2726 | newInfo.bounds = info.bounds; |
---|
.. | .. |
---|
3078 | 3168 | { |
---|
3079 | 3169 | if (bRep != null) |
---|
3080 | 3170 | { |
---|
3081 | | - bRep.GenerateNormalsMINE(); |
---|
| 3171 | + bRep.MergeNormals(); //.GenerateNormalsMINE(); |
---|
3082 | 3172 | Touch(); |
---|
3083 | 3173 | } |
---|
3084 | 3174 | } |
---|
.. | .. |
---|
5381 | 5471 | blockloop = false; |
---|
5382 | 5472 | } |
---|
5383 | 5473 | |
---|
| 5474 | + void ResetSelectable() |
---|
| 5475 | + { |
---|
| 5476 | + if (blockloop) |
---|
| 5477 | + return; |
---|
| 5478 | + |
---|
| 5479 | + blockloop = true; |
---|
| 5480 | + |
---|
| 5481 | + keepdontselect = dontselect; |
---|
| 5482 | + dontselect = true; |
---|
| 5483 | + |
---|
| 5484 | + Object3D child; |
---|
| 5485 | + int nb = Size(); |
---|
| 5486 | + for (int i = 0; i < nb; i++) |
---|
| 5487 | + { |
---|
| 5488 | + child = (Object3D) get(i); |
---|
| 5489 | + if (child == null) |
---|
| 5490 | + continue; |
---|
| 5491 | + child.ResetSelectable(); |
---|
| 5492 | + } |
---|
| 5493 | + |
---|
| 5494 | + blockloop = false; |
---|
| 5495 | + } |
---|
| 5496 | + |
---|
| 5497 | + void RestoreSelectable() |
---|
| 5498 | + { |
---|
| 5499 | + if (blockloop) |
---|
| 5500 | + return; |
---|
| 5501 | + |
---|
| 5502 | + blockloop = true; |
---|
| 5503 | + |
---|
| 5504 | + dontselect = keepdontselect; |
---|
| 5505 | + |
---|
| 5506 | + Object3D child; |
---|
| 5507 | + int nb = Size(); |
---|
| 5508 | + for (int i = 0; i < nb; i++) |
---|
| 5509 | + { |
---|
| 5510 | + child = (Object3D) get(i); |
---|
| 5511 | + if (child == null) |
---|
| 5512 | + continue; |
---|
| 5513 | + child.RestoreSelectable(); |
---|
| 5514 | + } |
---|
| 5515 | + |
---|
| 5516 | + blockloop = false; |
---|
| 5517 | + } |
---|
| 5518 | + |
---|
5384 | 5519 | boolean IsSelected() |
---|
5385 | 5520 | { |
---|
5386 | 5521 | if (parent == null) |
---|
.. | .. |
---|
5441 | 5576 | if (fullname == null) |
---|
5442 | 5577 | return ""; |
---|
5443 | 5578 | |
---|
| 5579 | + if (fullname.pigment != null) |
---|
| 5580 | + { |
---|
| 5581 | + return fullname.pigment; |
---|
| 5582 | + } |
---|
| 5583 | + |
---|
5444 | 5584 | // System.out.println("Fullname = " + fullname); |
---|
5445 | 5585 | |
---|
5446 | 5586 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5453 | 5593 | |
---|
5454 | 5594 | if (split.length == 0) |
---|
5455 | 5595 | { |
---|
5456 | | - return ""; |
---|
| 5596 | + return fullname.pigment = ""; |
---|
5457 | 5597 | } |
---|
5458 | 5598 | |
---|
5459 | 5599 | if (split.length <= 2) |
---|
.. | .. |
---|
5461 | 5601 | if (fullname.name.endsWith(":")) |
---|
5462 | 5602 | { |
---|
5463 | 5603 | // Windows |
---|
5464 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5604 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5465 | 5605 | } |
---|
5466 | 5606 | |
---|
5467 | | - return split[0]; |
---|
| 5607 | + return fullname.pigment = split[0]; |
---|
5468 | 5608 | } |
---|
5469 | 5609 | |
---|
5470 | 5610 | // Windows |
---|
5471 | 5611 | assert(split.length == 4); |
---|
5472 | 5612 | |
---|
5473 | | - return split[0] + ":" + split[1]; |
---|
| 5613 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5474 | 5614 | } |
---|
5475 | 5615 | |
---|
5476 | 5616 | static String GetBump(cTexture fullname) |
---|
5477 | 5617 | { |
---|
5478 | 5618 | if (fullname == null) |
---|
5479 | 5619 | return ""; |
---|
| 5620 | + |
---|
| 5621 | + if (fullname.bump != null) |
---|
| 5622 | + { |
---|
| 5623 | + return fullname.bump; |
---|
| 5624 | + } |
---|
5480 | 5625 | |
---|
5481 | 5626 | // System.out.println("Fullname = " + fullname); |
---|
5482 | 5627 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5488 | 5633 | |
---|
5489 | 5634 | if (split.length == 0) |
---|
5490 | 5635 | { |
---|
5491 | | - return ""; |
---|
| 5636 | + return fullname.bump = ""; |
---|
5492 | 5637 | } |
---|
5493 | 5638 | |
---|
5494 | 5639 | if (split.length == 1) |
---|
5495 | 5640 | { |
---|
5496 | | - return ""; |
---|
| 5641 | + return fullname.bump = ""; |
---|
5497 | 5642 | } |
---|
5498 | 5643 | |
---|
5499 | 5644 | if (split.length == 2) |
---|
.. | .. |
---|
5501 | 5646 | if (fullname.name.endsWith(":")) |
---|
5502 | 5647 | { |
---|
5503 | 5648 | // Windows |
---|
5504 | | - return ""; |
---|
| 5649 | + return fullname.bump = ""; |
---|
5505 | 5650 | } |
---|
5506 | 5651 | |
---|
5507 | | - return split[1]; |
---|
| 5652 | + return fullname.bump = split[1]; |
---|
5508 | 5653 | } |
---|
5509 | 5654 | |
---|
5510 | 5655 | // Windows |
---|
5511 | 5656 | assert(split.length == 4); |
---|
5512 | 5657 | |
---|
5513 | | - return split[2] + ":" + split[3]; |
---|
| 5658 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5514 | 5659 | } |
---|
5515 | 5660 | |
---|
5516 | 5661 | String GetPigmentTexture() |
---|
.. | .. |
---|
5593 | 5738 | texname = ""; |
---|
5594 | 5739 | |
---|
5595 | 5740 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5741 | + |
---|
| 5742 | + GetTextures().pigment = null; |
---|
| 5743 | + |
---|
5596 | 5744 | Touch(); |
---|
5597 | 5745 | } |
---|
5598 | 5746 | |
---|
.. | .. |
---|
5666 | 5814 | |
---|
5667 | 5815 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
5668 | 5816 | |
---|
| 5817 | + GetTextures().bump = null; |
---|
| 5818 | + |
---|
5669 | 5819 | Touch(); |
---|
5670 | 5820 | } |
---|
5671 | 5821 | |
---|
.. | .. |
---|
5686 | 5836 | |
---|
5687 | 5837 | blockloop = true; |
---|
5688 | 5838 | child.ResetBumpTexture(); |
---|
| 5839 | + blockloop = false; |
---|
| 5840 | + } |
---|
| 5841 | + } |
---|
| 5842 | + |
---|
| 5843 | + void EmbedTextures(boolean embed) |
---|
| 5844 | + { |
---|
| 5845 | + if (blockloop) |
---|
| 5846 | + return; |
---|
| 5847 | + |
---|
| 5848 | + //if (GetTextures() != null) |
---|
| 5849 | + if (embed) |
---|
| 5850 | + CameraPane.EmbedTextures(GetTextures()); |
---|
| 5851 | + else |
---|
| 5852 | + { |
---|
| 5853 | + GetTextures().pigmentdata = null; |
---|
| 5854 | + GetTextures().bumpdata = null; |
---|
| 5855 | + GetTextures().pw = 0; |
---|
| 5856 | + GetTextures().ph = 0; |
---|
| 5857 | + GetTextures().bw = 0; |
---|
| 5858 | + GetTextures().bh = 0; |
---|
| 5859 | + } |
---|
| 5860 | + |
---|
| 5861 | + int nb = Size(); |
---|
| 5862 | + for (int i = 0; i < nb; i++) |
---|
| 5863 | + { |
---|
| 5864 | + Object3D child = (Object3D) get(i); |
---|
| 5865 | + |
---|
| 5866 | + if (child == null) |
---|
| 5867 | + continue; |
---|
| 5868 | + |
---|
| 5869 | + blockloop = true; |
---|
| 5870 | + child.EmbedTextures(embed); |
---|
5689 | 5871 | blockloop = false; |
---|
5690 | 5872 | } |
---|
5691 | 5873 | } |
---|
.. | .. |
---|
5776 | 5958 | if (support != null) |
---|
5777 | 5959 | support = support; |
---|
5778 | 5960 | |
---|
5779 | | - //boolean usecalllists = 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); |
---|
| 5961 | + boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5962 | + //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5963 | + |
---|
| 5964 | + //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass. |
---|
5781 | 5965 | |
---|
5782 | 5966 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5783 | 5967 | { |
---|
.. | .. |
---|
5787 | 5971 | // usecalllists &= !(parent instanceof RandomNode); |
---|
5788 | 5972 | // usecalllists = false; |
---|
5789 | 5973 | |
---|
5790 | | - if (GetBRep() != null) |
---|
5791 | | - usecalllists = usecalllists; |
---|
| 5974 | + if (display.DrawMode() == display.SHADOW) |
---|
| 5975 | + //GetBRep() != null) |
---|
| 5976 | + usecalllists = !!usecalllists; |
---|
5792 | 5977 | //System.out.println("draw " + this); |
---|
5793 | 5978 | //new Exception().printStackTrace(); |
---|
5794 | 5979 | |
---|
.. | .. |
---|
5798 | 5983 | |
---|
5799 | 5984 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5800 | 5985 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5801 | | - (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5986 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5802 | 5987 | { |
---|
5803 | 5988 | Globals.lighttouched = true; |
---|
5804 | 5989 | } // all panes... |
---|
.. | .. |
---|
5810 | 5995 | if (!(this instanceof Composite)) |
---|
5811 | 5996 | touched = false; |
---|
5812 | 5997 | //if (displaylist == -1 && usecalllists) |
---|
5813 | | - if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
| 5998 | + if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013 |
---|
5814 | 5999 | { |
---|
5815 | 6000 | bRep.displaylist = display.GenList(); |
---|
5816 | 6001 | assert(bRep.displaylist != 0); |
---|
.. | .. |
---|
5821 | 6006 | |
---|
5822 | 6007 | //System.out.println("\tnew list " + list); |
---|
5823 | 6008 | //gl.glDrawBuffer(gl.GL_NONE); |
---|
5824 | | - if (usecalllists) |
---|
| 6009 | + if (usecalllists && bRep.displaylist > 0) |
---|
5825 | 6010 | { |
---|
5826 | 6011 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5827 | 6012 | display.NewList(bRep.displaylist); |
---|
.. | .. |
---|
5830 | 6015 | CallList(display, root, selected, blocked); |
---|
5831 | 6016 | |
---|
5832 | 6017 | // compiled = true; |
---|
5833 | | - if (usecalllists) |
---|
| 6018 | + if (usecalllists && bRep.displaylist > 0) |
---|
5834 | 6019 | { |
---|
5835 | 6020 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5836 | 6021 | display.EndList(); |
---|
.. | .. |
---|
7181 | 7366 | } |
---|
7182 | 7367 | } |
---|
7183 | 7368 | |
---|
7184 | | - protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec) |
---|
| 7369 | + static ClickInfo clickInfo = new ClickInfo(); |
---|
| 7370 | + |
---|
| 7371 | + protected void calcHotSpot(cVector in, //ClickInfo clickInfo, |
---|
| 7372 | + Point outPt, Rectangle outRec) |
---|
7185 | 7373 | { |
---|
7186 | | - int hc = info.bounds.x + info.bounds.width / 2; |
---|
7187 | | - int vc = info.bounds.y + info.bounds.height / 2; |
---|
7188 | | - double[][] toscreen = info.toScreen; |
---|
| 7374 | + int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2; |
---|
| 7375 | + int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2; |
---|
| 7376 | + double[][] toscreen = clickInfo.toScreen; |
---|
7189 | 7377 | if (toscreen == null) |
---|
7190 | 7378 | { |
---|
7191 | | - toscreen = new Camera(info.camera.viewCode).toScreen; |
---|
| 7379 | + toscreen = new Camera(clickInfo.camera.viewCode).toScreen; |
---|
7192 | 7380 | } |
---|
7193 | 7381 | cVector vec = in; |
---|
7194 | 7382 | LA.xformPos(in, toscreen, in); |
---|
7195 | 7383 | //System.out.println("Distance = " + info.camera.Distance()); |
---|
7196 | | - vec.x *= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
7197 | | - vec.y *= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
| 7384 | + vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
| 7385 | + vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
7198 | 7386 | outPt.x = hc + (int) vec.x; |
---|
7199 | 7387 | outPt.y = vc - (int) vec.y; |
---|
7200 | 7388 | outRec.x = outPt.x - 3; |
---|
.. | .. |
---|
7202 | 7390 | outRec.width = outRec.height = 6; |
---|
7203 | 7391 | } |
---|
7204 | 7392 | |
---|
7205 | | - protected Rectangle calcHotSpot(cVector in, ClickInfo info) |
---|
| 7393 | + protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo |
---|
| 7394 | + ) |
---|
7206 | 7395 | { |
---|
7207 | 7396 | Point pt = new Point(0, 0); |
---|
7208 | 7397 | Rectangle rec = new Rectangle(); |
---|
7209 | | - calcHotSpot(in, info, pt, rec); |
---|
| 7398 | + calcHotSpot(in, //clickInfo, |
---|
| 7399 | + pt, rec); |
---|
7210 | 7400 | return rec; |
---|
7211 | 7401 | } |
---|
7212 | 7402 | |
---|
7213 | | - void drawEditHandles0(ClickInfo info, int level) |
---|
| 7403 | + void drawEditHandles0(//ClickInfo clickInfo, |
---|
| 7404 | + int level) |
---|
7214 | 7405 | { |
---|
7215 | 7406 | if (level == 0) |
---|
7216 | 7407 | { |
---|
.. | .. |
---|
7219 | 7410 | { |
---|
7220 | 7411 | cVector origin = new cVector(); |
---|
7221 | 7412 | //LA.xformPos(origin, toParent, origin); |
---|
7222 | | - Rectangle spot = calcHotSpot(origin, info); |
---|
| 7413 | + if (this.clickInfo == null) |
---|
| 7414 | + this.clickInfo = new ClickInfo(); |
---|
| 7415 | + |
---|
| 7416 | + Rectangle spot = calcHotSpot(origin); //, clickInfo); |
---|
7223 | 7417 | Rectangle boundary = new Rectangle(); |
---|
7224 | 7418 | boundary.x = spot.x - 30; |
---|
7225 | 7419 | boundary.y = spot.y - 30; |
---|
7226 | 7420 | boundary.width = spot.width + 60; |
---|
7227 | 7421 | boundary.height = spot.height + 60; |
---|
7228 | | - info.g.setColor(Color.red); |
---|
| 7422 | + clickInfo.g.setColor(Color.white); |
---|
7229 | 7423 | int spotw = spot.x + spot.width; |
---|
7230 | 7424 | int spoth = spot.y + spot.height; |
---|
7231 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7425 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7232 | 7426 | // if (CameraPane.Xmin > spot.x) |
---|
7233 | 7427 | // { |
---|
7234 | 7428 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7245 | 7439 | // { |
---|
7246 | 7440 | // CameraPane.Ymax = spoth; |
---|
7247 | 7441 | // } |
---|
7248 | | - spot.translate(32, 32); |
---|
7249 | | - spotw = spot.x + spot.width; |
---|
7250 | | - spoth = spot.y + spot.height; |
---|
7251 | | - info.g.setColor(Color.cyan); |
---|
7252 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7253 | 7442 | // if (CameraPane.Xmin > spot.x) |
---|
7254 | 7443 | // { |
---|
7255 | 7444 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7268 | 7457 | // } |
---|
7269 | 7458 | // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7270 | 7459 | //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7271 | | - spot.translate(0, -32); |
---|
7272 | | - info.g.setColor(Color.yellow); |
---|
7273 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7274 | | - info.g.setColor(Color.green); |
---|
| 7460 | + spot.translate(32, 0); |
---|
| 7461 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7462 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7463 | + |
---|
| 7464 | + spot.translate(32, 64); |
---|
| 7465 | + spotw = spot.x + spot.width; |
---|
| 7466 | + spoth = spot.y + spot.height; |
---|
| 7467 | + clickInfo.g.setColor(Color.cyan); |
---|
| 7468 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7275 | 7469 | // if (CameraPane.Xmin > spot.x) |
---|
7276 | 7470 | // { |
---|
7277 | 7471 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7288 | 7482 | // { |
---|
7289 | 7483 | // CameraPane.Ymax = spoth; |
---|
7290 | 7484 | // } |
---|
7291 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7292 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7485 | + clickInfo.g.setColor(Color.green); |
---|
| 7486 | + clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
| 7487 | + (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7293 | 7488 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7294 | 7489 | // if (CameraPane.Xmin > boundary.x) |
---|
7295 | 7490 | // { |
---|
.. | .. |
---|
7311 | 7506 | } |
---|
7312 | 7507 | } |
---|
7313 | 7508 | |
---|
7314 | | - boolean doEditClick0(ClickInfo info, int level) |
---|
| 7509 | + boolean doEditClick0(//ClickInfo clickInfo, |
---|
| 7510 | + int level) |
---|
7315 | 7511 | { |
---|
7316 | 7512 | if (level == 0) |
---|
7317 | 7513 | { |
---|
.. | .. |
---|
7320 | 7516 | |
---|
7321 | 7517 | boolean retval = false; |
---|
7322 | 7518 | |
---|
7323 | | - startX = info.x; |
---|
7324 | | - startY = info.y; |
---|
| 7519 | + startX = clickInfo.x; |
---|
| 7520 | + startY = clickInfo.y; |
---|
7325 | 7521 | |
---|
7326 | 7522 | hitSomething = -1; |
---|
7327 | 7523 | cVector origin = new cVector(); |
---|
.. | .. |
---|
7331 | 7527 | { |
---|
7332 | 7528 | centerPt = new Point(0, 0); |
---|
7333 | 7529 | } |
---|
7334 | | - calcHotSpot(origin, info, centerPt, spot); |
---|
7335 | | - if (spot.contains(info.x, info.y)) |
---|
| 7530 | + calcHotSpot(origin, //info, |
---|
| 7531 | + centerPt, spot); |
---|
| 7532 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7336 | 7533 | { |
---|
7337 | 7534 | hitSomething = hitCenter; |
---|
7338 | 7535 | retval = true; |
---|
7339 | 7536 | } |
---|
7340 | 7537 | spot.translate(32, 0); |
---|
7341 | | - if (spot.contains(info.x, info.y)) |
---|
| 7538 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7342 | 7539 | { |
---|
7343 | 7540 | hitSomething = hitRotate; |
---|
7344 | 7541 | retval = true; |
---|
7345 | 7542 | } |
---|
7346 | 7543 | spot.translate(0, 32); |
---|
7347 | | - if (spot.contains(info.x, info.y)) |
---|
| 7544 | + spot.translate(32, 0); |
---|
| 7545 | + spot.translate(0, 32); |
---|
| 7546 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7348 | 7547 | { |
---|
7349 | 7548 | hitSomething = hitScale; |
---|
| 7549 | + |
---|
| 7550 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
| 7551 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
| 7552 | + double sign = 1; |
---|
| 7553 | + if (hScale < 0) |
---|
| 7554 | + { |
---|
| 7555 | + sign = -1; |
---|
| 7556 | + } |
---|
| 7557 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
| 7558 | + if (hScale < 0.01) |
---|
| 7559 | + { |
---|
| 7560 | + //hScale = 0.01; |
---|
| 7561 | + } |
---|
| 7562 | + |
---|
| 7563 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
| 7564 | + sign = 1; |
---|
| 7565 | + if (vScale < 0) |
---|
| 7566 | + { |
---|
| 7567 | + sign = -1; |
---|
| 7568 | + } |
---|
| 7569 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
| 7570 | + if (vScale < 0.01) |
---|
| 7571 | + { |
---|
| 7572 | + //vScale = 0.01; |
---|
| 7573 | + } |
---|
| 7574 | + |
---|
| 7575 | + clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale); |
---|
| 7576 | + |
---|
7350 | 7577 | retval = true; |
---|
7351 | 7578 | } |
---|
7352 | 7579 | |
---|
.. | .. |
---|
7356 | 7583 | } |
---|
7357 | 7584 | |
---|
7358 | 7585 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
7359 | | - modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
| 7586 | + modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
7360 | 7587 | //System.out.println("modified = " + modified); |
---|
7361 | 7588 | //new Exception().printStackTrace(); |
---|
7362 | 7589 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
7384 | 7611 | return true; |
---|
7385 | 7612 | } |
---|
7386 | 7613 | |
---|
7387 | | - void doEditDrag0(ClickInfo info, boolean opposite) |
---|
| 7614 | + void doEditDrag0(//ClickInfo info, |
---|
| 7615 | + boolean opposite) |
---|
7388 | 7616 | { |
---|
7389 | 7617 | if (hitSomething == 0) |
---|
7390 | 7618 | { |
---|
.. | .. |
---|
7398 | 7626 | |
---|
7399 | 7627 | //System.out.println("hitSomething = " + hitSomething); |
---|
7400 | 7628 | |
---|
7401 | | - double scale = 0.005f * info.camera.Distance(); |
---|
| 7629 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7402 | 7630 | |
---|
7403 | 7631 | cVector xlate = new cVector(); |
---|
7404 | 7632 | //cVector xlate2 = new cVector(); |
---|
.. | .. |
---|
7432 | 7660 | toParent[3][i] = xlate.get(i); |
---|
7433 | 7661 | LA.matInvert(toParent, fromParent); |
---|
7434 | 7662 | */ |
---|
7435 | | - cVector delta = LA.newVector(0, 0, startY - info.y); |
---|
7436 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7663 | + cVector delta = LA.newVector(0, 0, startY - clickInfo.y); |
---|
| 7664 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7437 | 7665 | |
---|
7438 | 7666 | LA.matCopy(startMat, toParent); |
---|
7439 | 7667 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7442 | 7670 | } else |
---|
7443 | 7671 | { |
---|
7444 | 7672 | //LA.xformDir(delta, info.camera.fromScreen, delta); |
---|
7445 | | - cVector up = new cVector(info.camera.up); |
---|
| 7673 | + cVector up = new cVector(clickInfo.camera.up); |
---|
7446 | 7674 | cVector away = new cVector(); |
---|
7447 | 7675 | //cVector right2 = new cVector(); |
---|
7448 | 7676 | //LA.vecCross(up, cVector.Z, right); |
---|
.. | .. |
---|
7459 | 7687 | LA.xformDir(up, ClickInfo.matbuffer, up); |
---|
7460 | 7688 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7461 | 7689 | LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up); |
---|
7462 | | - LA.xformDir(info.camera.away, ClickInfo.matbuffer, away); |
---|
| 7690 | + LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away); |
---|
7463 | 7691 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7464 | 7692 | LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away); |
---|
7465 | 7693 | //LA.vecCross(up, cVector.Z, right2); |
---|
7466 | 7694 | |
---|
7467 | | - cVector delta = LA.newVector(info.x - startX, startY - info.y, 0); |
---|
| 7695 | + cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0); |
---|
7468 | 7696 | |
---|
7469 | 7697 | //System.out.println("DELTA0 = " + delta); |
---|
7470 | 7698 | //System.out.println("AWAY = " + info.camera.away); |
---|
7471 | 7699 | //System.out.println("UP = " + info.camera.up); |
---|
7472 | 7700 | if (away.z > 0) |
---|
7473 | 7701 | { |
---|
7474 | | - if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
| 7702 | + if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
7475 | 7703 | { |
---|
7476 | 7704 | delta.x = -delta.x; |
---|
7477 | 7705 | } else |
---|
.. | .. |
---|
7486 | 7714 | //System.out.println("DELTA1 = " + delta); |
---|
7487 | 7715 | LA.xformDir(delta, ClickInfo.matbuffer, delta); |
---|
7488 | 7716 | //System.out.println("DELTA2 = " + delta); |
---|
7489 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7717 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7490 | 7718 | LA.matCopy(startMat, toParent); |
---|
7491 | 7719 | //System.out.println("DELTA3 = " + delta); |
---|
7492 | 7720 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7496 | 7724 | break; |
---|
7497 | 7725 | |
---|
7498 | 7726 | case hitRotate: // rotate |
---|
7499 | | - int dx = info.x - centerPt.x; |
---|
7500 | | - int dy = -(info.y - centerPt.y); |
---|
| 7727 | + int dx = clickInfo.x - centerPt.x; |
---|
| 7728 | + int dy = -(clickInfo.y - centerPt.y); |
---|
7501 | 7729 | double angle = (double) Math.atan2(dx, dy); |
---|
7502 | 7730 | angle = -(1.570796 - angle); |
---|
7503 | 7731 | |
---|
.. | .. |
---|
7520 | 7748 | } |
---|
7521 | 7749 | /**/ |
---|
7522 | 7750 | |
---|
7523 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 7751 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7524 | 7752 | { |
---|
7525 | 7753 | case 1: // '\001' |
---|
7526 | 7754 | LA.matZRotate(toParent, angle); |
---|
.. | .. |
---|
7547 | 7775 | break; |
---|
7548 | 7776 | |
---|
7549 | 7777 | case hitScale: // scale |
---|
7550 | | - double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7778 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7551 | 7779 | double sign = 1; |
---|
7552 | 7780 | if (hScale < 0) |
---|
7553 | 7781 | { |
---|
.. | .. |
---|
7559 | 7787 | //hScale = 0.01; |
---|
7560 | 7788 | } |
---|
7561 | 7789 | |
---|
7562 | | - double vScale = (double) (info.y - centerPt.y) / 32; |
---|
| 7790 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7563 | 7791 | sign = 1; |
---|
7564 | 7792 | if (vScale < 0) |
---|
7565 | 7793 | { |
---|
.. | .. |
---|
7570 | 7798 | { |
---|
7571 | 7799 | //vScale = 0.01; |
---|
7572 | 7800 | } |
---|
| 7801 | + |
---|
7573 | 7802 | LA.matCopy(startMat, toParent); |
---|
7574 | 7803 | /**/ |
---|
7575 | 7804 | for (int i = 0; i < 3; i++) |
---|
.. | .. |
---|
7579 | 7808 | } |
---|
7580 | 7809 | /**/ |
---|
7581 | 7810 | |
---|
7582 | | - double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7811 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale; |
---|
7583 | 7812 | |
---|
7584 | 7813 | if (totalScale < 0.01) |
---|
7585 | 7814 | { |
---|
7586 | 7815 | totalScale = 0.01; |
---|
7587 | 7816 | } |
---|
7588 | 7817 | |
---|
7589 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 7818 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7590 | 7819 | { |
---|
7591 | 7820 | case 3: // '\001' |
---|
7592 | 7821 | if (modified || opposite) |
---|
7593 | 7822 | { |
---|
| 7823 | + if (modified && opposite) |
---|
| 7824 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7825 | + else |
---|
7594 | 7826 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7595 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7827 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7596 | 7828 | } // vScale, 1); |
---|
7597 | 7829 | else |
---|
7598 | 7830 | { |
---|
7599 | 7831 | // EXCEPTION! |
---|
7600 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7832 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7601 | 7833 | } // vScale, 1); |
---|
7602 | 7834 | break; |
---|
7603 | 7835 | |
---|
7604 | 7836 | case 2: // '\002' |
---|
7605 | 7837 | if (modified || opposite) |
---|
7606 | 7838 | { |
---|
7607 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7608 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 7839 | + if (modified && opposite) |
---|
| 7840 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7841 | + else |
---|
| 7842 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 7843 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7609 | 7844 | } else |
---|
7610 | 7845 | { |
---|
7611 | 7846 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7615 | 7850 | case 1: // '\003' |
---|
7616 | 7851 | if (modified || opposite) |
---|
7617 | 7852 | { |
---|
7618 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7619 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 7853 | + if (modified && opposite) |
---|
| 7854 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7855 | + else |
---|
| 7856 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 7857 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7620 | 7858 | } else |
---|
7621 | 7859 | { |
---|
7622 | 7860 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|
.. | .. |
---|
7653 | 7891 | } // NEW ... |
---|
7654 | 7892 | |
---|
7655 | 7893 | |
---|
7656 | | - info.pane.repaint(); |
---|
| 7894 | + clickInfo.pane.repaint(); |
---|
7657 | 7895 | } |
---|
7658 | 7896 | |
---|
7659 | 7897 | boolean overflow = false; |
---|