.. | .. |
---|
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 | 28 | // TEMPORARY for mocap undo. No need to be transient. |
---|
.. | .. |
---|
29 | 30 | Object3D saveskeleton; |
---|
30 | 31 | // |
---|
31 | 32 | |
---|
32 | | - byte[] versions[]; |
---|
| 33 | + String skyboxname; |
---|
| 34 | + String skyboxext; |
---|
| 35 | + |
---|
| 36 | + Object3D versionlist[]; |
---|
33 | 37 | int versionindex = -1; |
---|
34 | 38 | |
---|
35 | 39 | ScriptNode scriptnode; |
---|
.. | .. |
---|
219 | 223 | // o.bRep.support = null; |
---|
220 | 224 | // } |
---|
221 | 225 | o.selection = this.selection; |
---|
222 | | - o.versions = this.versions; |
---|
| 226 | + o.versionlist = this.versionlist; |
---|
223 | 227 | o.versionindex = this.versionindex; |
---|
224 | 228 | |
---|
225 | 229 | if (this.support != null) |
---|
.. | .. |
---|
242 | 246 | // this.support = null; |
---|
243 | 247 | // this.fileparent = null; |
---|
244 | 248 | } |
---|
| 249 | + |
---|
| 250 | +// Object3D GetObject(java.util.UUID uuid) |
---|
| 251 | +// { |
---|
| 252 | +// if (this.uuid.equals(uuid)) |
---|
| 253 | +// return this; |
---|
| 254 | +// |
---|
| 255 | +// if (blockloop) |
---|
| 256 | +// return null; |
---|
| 257 | +// |
---|
| 258 | +// blockloop = true; |
---|
| 259 | +// |
---|
| 260 | +// for (int i=0; i<Size(); i++) |
---|
| 261 | +// { |
---|
| 262 | +// Object3D o = get(i).GetObject(uuid); |
---|
| 263 | +// |
---|
| 264 | +// if (o != null) |
---|
| 265 | +// return o; |
---|
| 266 | +// } |
---|
| 267 | +// |
---|
| 268 | +// blockloop = false; |
---|
| 269 | +// |
---|
| 270 | +// return null; |
---|
| 271 | +// } |
---|
245 | 272 | |
---|
246 | 273 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
247 | 274 | { |
---|
.. | .. |
---|
277 | 304 | |
---|
278 | 305 | this.selection = o.selection; |
---|
279 | 306 | |
---|
280 | | - this.versions = o.versions; |
---|
| 307 | + this.versionlist = o.versionlist; |
---|
281 | 308 | this.versionindex = o.versionindex; |
---|
282 | 309 | // July 2019 if (this.bRep != null) |
---|
283 | 310 | // this.bRep.support = o.transientrep; |
---|
.. | .. |
---|
1011 | 1038 | |
---|
1012 | 1039 | if (material == null || material.multiply) |
---|
1013 | 1040 | return true; |
---|
| 1041 | + |
---|
| 1042 | + if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 1043 | + return false; |
---|
1014 | 1044 | |
---|
1015 | 1045 | // Transparent objects are dynamic because we have to sort the triangles. |
---|
1016 | 1046 | return material.opacity > 0.99; |
---|
.. | .. |
---|
2438 | 2468 | else |
---|
2439 | 2469 | { |
---|
2440 | 2470 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2471 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
2441 | 2472 | } |
---|
2442 | 2473 | } |
---|
2443 | 2474 | |
---|
.. | .. |
---|
2567 | 2598 | private static final int editSelf = 1; |
---|
2568 | 2599 | private static final int editChild = 2; |
---|
2569 | 2600 | |
---|
2570 | | - void drawEditHandles(ClickInfo info, int level) |
---|
| 2601 | + void drawEditHandles(//ClickInfo info, |
---|
| 2602 | + int level) |
---|
2571 | 2603 | { |
---|
2572 | 2604 | if (level == 0) |
---|
2573 | 2605 | { |
---|
.. | .. |
---|
2575 | 2607 | return; |
---|
2576 | 2608 | |
---|
2577 | 2609 | Object3D selectee; |
---|
2578 | | - for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1)) |
---|
| 2610 | + for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info, |
---|
| 2611 | + level + 1)) |
---|
2579 | 2612 | { |
---|
2580 | 2613 | selectee = (Object3D) e.nextElement(); |
---|
2581 | 2614 | } |
---|
.. | .. |
---|
2583 | 2616 | } else |
---|
2584 | 2617 | { |
---|
2585 | 2618 | //super. |
---|
2586 | | - drawEditHandles0(info, level + 1); |
---|
| 2619 | + drawEditHandles0(//info, |
---|
| 2620 | + level + 1); |
---|
2587 | 2621 | } |
---|
2588 | 2622 | } |
---|
2589 | 2623 | |
---|
2590 | | - boolean doEditClick(ClickInfo info, int level) |
---|
| 2624 | + boolean doEditClick(//ClickInfo info, |
---|
| 2625 | + int level) |
---|
2591 | 2626 | { |
---|
2592 | 2627 | doSomething = 0; |
---|
2593 | 2628 | if (level == 0) |
---|
2594 | 2629 | { |
---|
2595 | | - return doParentClick(info); |
---|
| 2630 | + return doParentClick(); //info); |
---|
2596 | 2631 | } |
---|
2597 | 2632 | if (//super. |
---|
2598 | | - doEditClick0(info, level)) |
---|
| 2633 | + doEditClick0(//info, |
---|
| 2634 | + level)) |
---|
2599 | 2635 | { |
---|
2600 | 2636 | doSomething = 1; |
---|
2601 | 2637 | return true; |
---|
.. | .. |
---|
2605 | 2641 | } |
---|
2606 | 2642 | } |
---|
2607 | 2643 | |
---|
2608 | | - boolean doParentClick(ClickInfo info) |
---|
| 2644 | + boolean doParentClick() //ClickInfo info) |
---|
2609 | 2645 | { |
---|
2610 | 2646 | if (selection == null) |
---|
2611 | 2647 | { |
---|
.. | .. |
---|
2618 | 2654 | for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();) |
---|
2619 | 2655 | { |
---|
2620 | 2656 | Object3D selectee = (Object3D) e.nextElement(); |
---|
2621 | | - if (selectee.doEditClick(info, 1)) |
---|
| 2657 | + if (selectee.doEditClick(//info, |
---|
| 2658 | + 1)) |
---|
2622 | 2659 | { |
---|
2623 | 2660 | childToDrag = selectee; |
---|
2624 | 2661 | doSomething = 2; |
---|
.. | .. |
---|
2630 | 2667 | return retval; |
---|
2631 | 2668 | } |
---|
2632 | 2669 | |
---|
2633 | | - void doEditDrag(ClickInfo info, boolean opposite) |
---|
| 2670 | + void doEditDrag(//ClickInfo clickInfo, |
---|
| 2671 | + boolean opposite) |
---|
2634 | 2672 | { |
---|
2635 | 2673 | switch (doSomething) |
---|
2636 | 2674 | { |
---|
2637 | 2675 | case 1: // '\001' |
---|
2638 | 2676 | //super. |
---|
2639 | | - doEditDrag0(info, opposite); |
---|
| 2677 | + doEditDrag0(//clickInfo, |
---|
| 2678 | + opposite); |
---|
2640 | 2679 | break; |
---|
2641 | 2680 | |
---|
2642 | 2681 | case 2: // '\002' |
---|
.. | .. |
---|
2649 | 2688 | { |
---|
2650 | 2689 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2651 | 2690 | //childToDrag.doEditDrag(info); |
---|
2652 | | - sel.doEditDrag(info, opposite); |
---|
| 2691 | + sel.doEditDrag(//clickInfo, |
---|
| 2692 | + opposite); |
---|
2653 | 2693 | } else |
---|
2654 | 2694 | { |
---|
2655 | 2695 | //super. |
---|
2656 | | - doEditDrag0(info, opposite); |
---|
| 2696 | + doEditDrag0(//clickInfo, |
---|
| 2697 | + opposite); |
---|
2657 | 2698 | } |
---|
2658 | 2699 | } |
---|
2659 | 2700 | break; |
---|
.. | .. |
---|
2671 | 2712 | { |
---|
2672 | 2713 | deselectAll(); |
---|
2673 | 2714 | } |
---|
| 2715 | + |
---|
| 2716 | + new Exception().printStackTrace(); |
---|
| 2717 | + |
---|
2674 | 2718 | ClickInfo newInfo = new ClickInfo(); |
---|
2675 | 2719 | newInfo.flags = info.flags; |
---|
2676 | 2720 | newInfo.bounds = info.bounds; |
---|
.. | .. |
---|
5893 | 5937 | if (support != null) |
---|
5894 | 5938 | support = support; |
---|
5895 | 5939 | |
---|
5896 | | - //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5897 | | - boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5940 | + boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5941 | + //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5942 | + |
---|
| 5943 | + //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass. |
---|
5898 | 5944 | |
---|
5899 | 5945 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5900 | 5946 | { |
---|
.. | .. |
---|
5904 | 5950 | // usecalllists &= !(parent instanceof RandomNode); |
---|
5905 | 5951 | // usecalllists = false; |
---|
5906 | 5952 | |
---|
5907 | | - if (GetBRep() != null) |
---|
5908 | | - usecalllists = usecalllists; |
---|
| 5953 | + if (display.DrawMode() == display.SHADOW) |
---|
| 5954 | + //GetBRep() != null) |
---|
| 5955 | + usecalllists = !!usecalllists; |
---|
5909 | 5956 | //System.out.println("draw " + this); |
---|
5910 | 5957 | //new Exception().printStackTrace(); |
---|
5911 | 5958 | |
---|
.. | .. |
---|
5927 | 5974 | if (!(this instanceof Composite)) |
---|
5928 | 5975 | touched = false; |
---|
5929 | 5976 | //if (displaylist == -1 && usecalllists) |
---|
5930 | | - if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
| 5977 | + if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013 |
---|
5931 | 5978 | { |
---|
5932 | 5979 | bRep.displaylist = display.GenList(); |
---|
5933 | 5980 | assert(bRep.displaylist != 0); |
---|
.. | .. |
---|
5938 | 5985 | |
---|
5939 | 5986 | //System.out.println("\tnew list " + list); |
---|
5940 | 5987 | //gl.glDrawBuffer(gl.GL_NONE); |
---|
5941 | | - if (usecalllists) |
---|
| 5988 | + if (usecalllists && bRep.displaylist > 0) |
---|
5942 | 5989 | { |
---|
5943 | 5990 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5944 | 5991 | display.NewList(bRep.displaylist); |
---|
.. | .. |
---|
5947 | 5994 | CallList(display, root, selected, blocked); |
---|
5948 | 5995 | |
---|
5949 | 5996 | // compiled = true; |
---|
5950 | | - if (usecalllists) |
---|
| 5997 | + if (usecalllists && bRep.displaylist > 0) |
---|
5951 | 5998 | { |
---|
5952 | 5999 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5953 | 6000 | display.EndList(); |
---|
.. | .. |
---|
7298 | 7345 | } |
---|
7299 | 7346 | } |
---|
7300 | 7347 | |
---|
7301 | | - protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec) |
---|
| 7348 | + static ClickInfo clickInfo = new ClickInfo(); |
---|
| 7349 | + |
---|
| 7350 | + protected void calcHotSpot(cVector in, //ClickInfo clickInfo, |
---|
| 7351 | + Point outPt, Rectangle outRec) |
---|
7302 | 7352 | { |
---|
7303 | | - int hc = info.bounds.x + info.bounds.width / 2; |
---|
7304 | | - int vc = info.bounds.y + info.bounds.height / 2; |
---|
7305 | | - double[][] toscreen = info.toScreen; |
---|
| 7353 | + int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2; |
---|
| 7354 | + int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2; |
---|
| 7355 | + double[][] toscreen = clickInfo.toScreen; |
---|
7306 | 7356 | if (toscreen == null) |
---|
7307 | 7357 | { |
---|
7308 | | - toscreen = new Camera(info.camera.viewCode).toScreen; |
---|
| 7358 | + toscreen = new Camera(clickInfo.camera.viewCode).toScreen; |
---|
7309 | 7359 | } |
---|
7310 | 7360 | cVector vec = in; |
---|
7311 | 7361 | LA.xformPos(in, toscreen, in); |
---|
7312 | 7362 | //System.out.println("Distance = " + info.camera.Distance()); |
---|
7313 | | - vec.x *= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
7314 | | - vec.y *= 100 * info.camera.SCALE / info.camera.Distance(); |
---|
| 7363 | + vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
| 7364 | + vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
7315 | 7365 | outPt.x = hc + (int) vec.x; |
---|
7316 | 7366 | outPt.y = vc - (int) vec.y; |
---|
7317 | 7367 | outRec.x = outPt.x - 3; |
---|
.. | .. |
---|
7319 | 7369 | outRec.width = outRec.height = 6; |
---|
7320 | 7370 | } |
---|
7321 | 7371 | |
---|
7322 | | - protected Rectangle calcHotSpot(cVector in, ClickInfo info) |
---|
| 7372 | + protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo |
---|
| 7373 | + ) |
---|
7323 | 7374 | { |
---|
7324 | 7375 | Point pt = new Point(0, 0); |
---|
7325 | 7376 | Rectangle rec = new Rectangle(); |
---|
7326 | | - calcHotSpot(in, info, pt, rec); |
---|
| 7377 | + calcHotSpot(in, //clickInfo, |
---|
| 7378 | + pt, rec); |
---|
7327 | 7379 | return rec; |
---|
7328 | 7380 | } |
---|
7329 | 7381 | |
---|
7330 | | - void drawEditHandles0(ClickInfo info, int level) |
---|
| 7382 | + void drawEditHandles0(//ClickInfo clickInfo, |
---|
| 7383 | + int level) |
---|
7331 | 7384 | { |
---|
7332 | 7385 | if (level == 0) |
---|
7333 | 7386 | { |
---|
.. | .. |
---|
7336 | 7389 | { |
---|
7337 | 7390 | cVector origin = new cVector(); |
---|
7338 | 7391 | //LA.xformPos(origin, toParent, origin); |
---|
7339 | | - Rectangle spot = calcHotSpot(origin, info); |
---|
| 7392 | + if (this.clickInfo == null) |
---|
| 7393 | + this.clickInfo = new ClickInfo(); |
---|
| 7394 | + |
---|
| 7395 | + Rectangle spot = calcHotSpot(origin); //, clickInfo); |
---|
7340 | 7396 | Rectangle boundary = new Rectangle(); |
---|
7341 | 7397 | boundary.x = spot.x - 30; |
---|
7342 | 7398 | boundary.y = spot.y - 30; |
---|
7343 | 7399 | boundary.width = spot.width + 60; |
---|
7344 | 7400 | boundary.height = spot.height + 60; |
---|
7345 | | - info.g.setColor(Color.red); |
---|
| 7401 | + clickInfo.g.setColor(Color.red); |
---|
7346 | 7402 | int spotw = spot.x + spot.width; |
---|
7347 | 7403 | int spoth = spot.y + spot.height; |
---|
7348 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7404 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7349 | 7405 | // if (CameraPane.Xmin > spot.x) |
---|
7350 | 7406 | // { |
---|
7351 | 7407 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7365 | 7421 | spot.translate(32, 32); |
---|
7366 | 7422 | spotw = spot.x + spot.width; |
---|
7367 | 7423 | spoth = spot.y + spot.height; |
---|
7368 | | - info.g.setColor(Color.cyan); |
---|
7369 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7424 | + clickInfo.g.setColor(Color.cyan); |
---|
| 7425 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7370 | 7426 | // if (CameraPane.Xmin > spot.x) |
---|
7371 | 7427 | // { |
---|
7372 | 7428 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7386 | 7442 | // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7387 | 7443 | //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7388 | 7444 | spot.translate(0, -32); |
---|
7389 | | - info.g.setColor(Color.yellow); |
---|
7390 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7391 | | - info.g.setColor(Color.green); |
---|
| 7445 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7446 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7447 | + clickInfo.g.setColor(Color.green); |
---|
7392 | 7448 | // if (CameraPane.Xmin > spot.x) |
---|
7393 | 7449 | // { |
---|
7394 | 7450 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7405 | 7461 | // { |
---|
7406 | 7462 | // CameraPane.Ymax = spoth; |
---|
7407 | 7463 | // } |
---|
7408 | | - info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
7409 | | - (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
| 7464 | + clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
| 7465 | + (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7410 | 7466 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7411 | 7467 | // if (CameraPane.Xmin > boundary.x) |
---|
7412 | 7468 | // { |
---|
.. | .. |
---|
7428 | 7484 | } |
---|
7429 | 7485 | } |
---|
7430 | 7486 | |
---|
7431 | | - boolean doEditClick0(ClickInfo info, int level) |
---|
| 7487 | + boolean doEditClick0(//ClickInfo clickInfo, |
---|
| 7488 | + int level) |
---|
7432 | 7489 | { |
---|
7433 | 7490 | if (level == 0) |
---|
7434 | 7491 | { |
---|
.. | .. |
---|
7437 | 7494 | |
---|
7438 | 7495 | boolean retval = false; |
---|
7439 | 7496 | |
---|
7440 | | - startX = info.x; |
---|
7441 | | - startY = info.y; |
---|
| 7497 | + startX = clickInfo.x; |
---|
| 7498 | + startY = clickInfo.y; |
---|
7442 | 7499 | |
---|
7443 | 7500 | hitSomething = -1; |
---|
7444 | 7501 | cVector origin = new cVector(); |
---|
.. | .. |
---|
7448 | 7505 | { |
---|
7449 | 7506 | centerPt = new Point(0, 0); |
---|
7450 | 7507 | } |
---|
7451 | | - calcHotSpot(origin, info, centerPt, spot); |
---|
7452 | | - if (spot.contains(info.x, info.y)) |
---|
| 7508 | + calcHotSpot(origin, //info, |
---|
| 7509 | + centerPt, spot); |
---|
| 7510 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7453 | 7511 | { |
---|
7454 | 7512 | hitSomething = hitCenter; |
---|
7455 | 7513 | retval = true; |
---|
7456 | 7514 | } |
---|
7457 | 7515 | spot.translate(32, 0); |
---|
7458 | | - if (spot.contains(info.x, info.y)) |
---|
| 7516 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7459 | 7517 | { |
---|
7460 | 7518 | hitSomething = hitRotate; |
---|
7461 | 7519 | retval = true; |
---|
7462 | 7520 | } |
---|
7463 | 7521 | spot.translate(0, 32); |
---|
7464 | | - if (spot.contains(info.x, info.y)) |
---|
| 7522 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7465 | 7523 | { |
---|
7466 | 7524 | hitSomething = hitScale; |
---|
| 7525 | + |
---|
| 7526 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
| 7527 | + double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7528 | + double sign = 1; |
---|
| 7529 | + if (hScale < 0) |
---|
| 7530 | + { |
---|
| 7531 | + sign = -1; |
---|
| 7532 | + } |
---|
| 7533 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
| 7534 | + if (hScale < 0.01) |
---|
| 7535 | + { |
---|
| 7536 | + //hScale = 0.01; |
---|
| 7537 | + } |
---|
| 7538 | + |
---|
| 7539 | + double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7540 | + sign = 1; |
---|
| 7541 | + if (vScale < 0) |
---|
| 7542 | + { |
---|
| 7543 | + sign = -1; |
---|
| 7544 | + } |
---|
| 7545 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
| 7546 | + if (vScale < 0.01) |
---|
| 7547 | + { |
---|
| 7548 | + //vScale = 0.01; |
---|
| 7549 | + } |
---|
| 7550 | + |
---|
| 7551 | + clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale); |
---|
| 7552 | + |
---|
7467 | 7553 | retval = true; |
---|
7468 | 7554 | } |
---|
7469 | 7555 | |
---|
.. | .. |
---|
7473 | 7559 | } |
---|
7474 | 7560 | |
---|
7475 | 7561 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
7476 | | - modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
| 7562 | + modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
7477 | 7563 | //System.out.println("modified = " + modified); |
---|
7478 | 7564 | //new Exception().printStackTrace(); |
---|
7479 | 7565 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
7501 | 7587 | return true; |
---|
7502 | 7588 | } |
---|
7503 | 7589 | |
---|
7504 | | - void doEditDrag0(ClickInfo info, boolean opposite) |
---|
| 7590 | + void doEditDrag0(//ClickInfo info, |
---|
| 7591 | + boolean opposite) |
---|
7505 | 7592 | { |
---|
7506 | 7593 | if (hitSomething == 0) |
---|
7507 | 7594 | { |
---|
.. | .. |
---|
7515 | 7602 | |
---|
7516 | 7603 | //System.out.println("hitSomething = " + hitSomething); |
---|
7517 | 7604 | |
---|
7518 | | - double scale = 0.005f * info.camera.Distance(); |
---|
| 7605 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7519 | 7606 | |
---|
7520 | 7607 | cVector xlate = new cVector(); |
---|
7521 | 7608 | //cVector xlate2 = new cVector(); |
---|
.. | .. |
---|
7549 | 7636 | toParent[3][i] = xlate.get(i); |
---|
7550 | 7637 | LA.matInvert(toParent, fromParent); |
---|
7551 | 7638 | */ |
---|
7552 | | - cVector delta = LA.newVector(0, 0, startY - info.y); |
---|
7553 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7639 | + cVector delta = LA.newVector(0, 0, startY - clickInfo.y); |
---|
| 7640 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7554 | 7641 | |
---|
7555 | 7642 | LA.matCopy(startMat, toParent); |
---|
7556 | 7643 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7559 | 7646 | } else |
---|
7560 | 7647 | { |
---|
7561 | 7648 | //LA.xformDir(delta, info.camera.fromScreen, delta); |
---|
7562 | | - cVector up = new cVector(info.camera.up); |
---|
| 7649 | + cVector up = new cVector(clickInfo.camera.up); |
---|
7563 | 7650 | cVector away = new cVector(); |
---|
7564 | 7651 | //cVector right2 = new cVector(); |
---|
7565 | 7652 | //LA.vecCross(up, cVector.Z, right); |
---|
.. | .. |
---|
7576 | 7663 | LA.xformDir(up, ClickInfo.matbuffer, up); |
---|
7577 | 7664 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7578 | 7665 | LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up); |
---|
7579 | | - LA.xformDir(info.camera.away, ClickInfo.matbuffer, away); |
---|
| 7666 | + LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away); |
---|
7580 | 7667 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7581 | 7668 | LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away); |
---|
7582 | 7669 | //LA.vecCross(up, cVector.Z, right2); |
---|
7583 | 7670 | |
---|
7584 | | - cVector delta = LA.newVector(info.x - startX, startY - info.y, 0); |
---|
| 7671 | + cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0); |
---|
7585 | 7672 | |
---|
7586 | 7673 | //System.out.println("DELTA0 = " + delta); |
---|
7587 | 7674 | //System.out.println("AWAY = " + info.camera.away); |
---|
7588 | 7675 | //System.out.println("UP = " + info.camera.up); |
---|
7589 | 7676 | if (away.z > 0) |
---|
7590 | 7677 | { |
---|
7591 | | - if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
| 7678 | + if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
7592 | 7679 | { |
---|
7593 | 7680 | delta.x = -delta.x; |
---|
7594 | 7681 | } else |
---|
.. | .. |
---|
7603 | 7690 | //System.out.println("DELTA1 = " + delta); |
---|
7604 | 7691 | LA.xformDir(delta, ClickInfo.matbuffer, delta); |
---|
7605 | 7692 | //System.out.println("DELTA2 = " + delta); |
---|
7606 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7693 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7607 | 7694 | LA.matCopy(startMat, toParent); |
---|
7608 | 7695 | //System.out.println("DELTA3 = " + delta); |
---|
7609 | 7696 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7613 | 7700 | break; |
---|
7614 | 7701 | |
---|
7615 | 7702 | case hitRotate: // rotate |
---|
7616 | | - int dx = info.x - centerPt.x; |
---|
7617 | | - int dy = -(info.y - centerPt.y); |
---|
| 7703 | + int dx = clickInfo.x - centerPt.x; |
---|
| 7704 | + int dy = -(clickInfo.y - centerPt.y); |
---|
7618 | 7705 | double angle = (double) Math.atan2(dx, dy); |
---|
7619 | 7706 | angle = -(1.570796 - angle); |
---|
7620 | 7707 | |
---|
.. | .. |
---|
7637 | 7724 | } |
---|
7638 | 7725 | /**/ |
---|
7639 | 7726 | |
---|
7640 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 7727 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7641 | 7728 | { |
---|
7642 | 7729 | case 1: // '\001' |
---|
7643 | 7730 | LA.matZRotate(toParent, angle); |
---|
.. | .. |
---|
7664 | 7751 | break; |
---|
7665 | 7752 | |
---|
7666 | 7753 | case hitScale: // scale |
---|
7667 | | - double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7754 | + double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
7668 | 7755 | double sign = 1; |
---|
7669 | 7756 | if (hScale < 0) |
---|
7670 | 7757 | { |
---|
.. | .. |
---|
7676 | 7763 | //hScale = 0.01; |
---|
7677 | 7764 | } |
---|
7678 | 7765 | |
---|
7679 | | - double vScale = (double) (info.y - centerPt.y) / 32; |
---|
| 7766 | + double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
7680 | 7767 | sign = 1; |
---|
7681 | 7768 | if (vScale < 0) |
---|
7682 | 7769 | { |
---|
.. | .. |
---|
7687 | 7774 | { |
---|
7688 | 7775 | //vScale = 0.01; |
---|
7689 | 7776 | } |
---|
| 7777 | + |
---|
7690 | 7778 | LA.matCopy(startMat, toParent); |
---|
7691 | 7779 | /**/ |
---|
7692 | 7780 | for (int i = 0; i < 3; i++) |
---|
.. | .. |
---|
7696 | 7784 | } |
---|
7697 | 7785 | /**/ |
---|
7698 | 7786 | |
---|
7699 | | - double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7787 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale; |
---|
7700 | 7788 | |
---|
7701 | 7789 | if (totalScale < 0.01) |
---|
7702 | 7790 | { |
---|
7703 | 7791 | totalScale = 0.01; |
---|
7704 | 7792 | } |
---|
7705 | 7793 | |
---|
7706 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 7794 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7707 | 7795 | { |
---|
7708 | 7796 | case 3: // '\001' |
---|
7709 | 7797 | if (modified || opposite) |
---|
.. | .. |
---|
7770 | 7858 | } // NEW ... |
---|
7771 | 7859 | |
---|
7772 | 7860 | |
---|
7773 | | - info.pane.repaint(); |
---|
| 7861 | + clickInfo.pane.repaint(); |
---|
7774 | 7862 | } |
---|
7775 | 7863 | |
---|
7776 | 7864 | boolean overflow = false; |
---|