.. | .. |
---|
29 | 29 | Object3D saveskeleton; |
---|
30 | 30 | // |
---|
31 | 31 | |
---|
32 | | - byte[] versions[]; |
---|
| 32 | + String skyboxname; |
---|
| 33 | + String skyboxext; |
---|
| 34 | + |
---|
| 35 | + Object3D versions[]; |
---|
33 | 36 | int versionindex = -1; |
---|
34 | 37 | |
---|
35 | 38 | ScriptNode scriptnode; |
---|
.. | .. |
---|
1011 | 1014 | |
---|
1012 | 1015 | if (material == null || material.multiply) |
---|
1013 | 1016 | return true; |
---|
| 1017 | + |
---|
| 1018 | + if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 1019 | + return false; |
---|
1014 | 1020 | |
---|
1015 | 1021 | // Transparent objects are dynamic because we have to sort the triangles. |
---|
1016 | 1022 | return material.opacity > 0.99; |
---|
.. | .. |
---|
2567 | 2573 | private static final int editSelf = 1; |
---|
2568 | 2574 | private static final int editChild = 2; |
---|
2569 | 2575 | |
---|
2570 | | - void drawEditHandles(ClickInfo info, int level) |
---|
| 2576 | + void drawEditHandles(//ClickInfo info, |
---|
| 2577 | + int level) |
---|
2571 | 2578 | { |
---|
2572 | 2579 | if (level == 0) |
---|
2573 | 2580 | { |
---|
.. | .. |
---|
2575 | 2582 | return; |
---|
2576 | 2583 | |
---|
2577 | 2584 | Object3D selectee; |
---|
2578 | | - for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1)) |
---|
| 2585 | + for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info, |
---|
| 2586 | + level + 1)) |
---|
2579 | 2587 | { |
---|
2580 | 2588 | selectee = (Object3D) e.nextElement(); |
---|
2581 | 2589 | } |
---|
.. | .. |
---|
2583 | 2591 | } else |
---|
2584 | 2592 | { |
---|
2585 | 2593 | //super. |
---|
2586 | | - drawEditHandles0(info, level + 1); |
---|
| 2594 | + drawEditHandles0(//info, |
---|
| 2595 | + level + 1); |
---|
2587 | 2596 | } |
---|
2588 | 2597 | } |
---|
2589 | 2598 | |
---|
2590 | | - boolean doEditClick(ClickInfo info, int level) |
---|
| 2599 | + boolean doEditClick(//ClickInfo info, |
---|
| 2600 | + int level) |
---|
2591 | 2601 | { |
---|
2592 | 2602 | doSomething = 0; |
---|
2593 | 2603 | if (level == 0) |
---|
2594 | 2604 | { |
---|
2595 | | - return doParentClick(info); |
---|
| 2605 | + return doParentClick(); //info); |
---|
2596 | 2606 | } |
---|
2597 | 2607 | if (//super. |
---|
2598 | | - doEditClick0(info, level)) |
---|
| 2608 | + doEditClick0(//info, |
---|
| 2609 | + level)) |
---|
2599 | 2610 | { |
---|
2600 | 2611 | doSomething = 1; |
---|
2601 | 2612 | return true; |
---|
.. | .. |
---|
2605 | 2616 | } |
---|
2606 | 2617 | } |
---|
2607 | 2618 | |
---|
2608 | | - boolean doParentClick(ClickInfo info) |
---|
| 2619 | + boolean doParentClick() //ClickInfo info) |
---|
2609 | 2620 | { |
---|
2610 | 2621 | if (selection == null) |
---|
2611 | 2622 | { |
---|
.. | .. |
---|
2618 | 2629 | for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();) |
---|
2619 | 2630 | { |
---|
2620 | 2631 | Object3D selectee = (Object3D) e.nextElement(); |
---|
2621 | | - if (selectee.doEditClick(info, 1)) |
---|
| 2632 | + if (selectee.doEditClick(//info, |
---|
| 2633 | + 1)) |
---|
2622 | 2634 | { |
---|
2623 | 2635 | childToDrag = selectee; |
---|
2624 | 2636 | doSomething = 2; |
---|
.. | .. |
---|
2630 | 2642 | return retval; |
---|
2631 | 2643 | } |
---|
2632 | 2644 | |
---|
2633 | | - void doEditDrag(ClickInfo info, boolean opposite) |
---|
| 2645 | + void doEditDrag(//ClickInfo clickInfo, |
---|
| 2646 | + boolean opposite) |
---|
2634 | 2647 | { |
---|
2635 | 2648 | switch (doSomething) |
---|
2636 | 2649 | { |
---|
2637 | 2650 | case 1: // '\001' |
---|
2638 | 2651 | //super. |
---|
2639 | | - doEditDrag0(info, opposite); |
---|
| 2652 | + doEditDrag0(//clickInfo, |
---|
| 2653 | + opposite); |
---|
2640 | 2654 | break; |
---|
2641 | 2655 | |
---|
2642 | 2656 | case 2: // '\002' |
---|
.. | .. |
---|
2649 | 2663 | { |
---|
2650 | 2664 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2651 | 2665 | //childToDrag.doEditDrag(info); |
---|
2652 | | - sel.doEditDrag(info, opposite); |
---|
| 2666 | + sel.doEditDrag(//clickInfo, |
---|
| 2667 | + opposite); |
---|
2653 | 2668 | } else |
---|
2654 | 2669 | { |
---|
2655 | 2670 | //super. |
---|
2656 | | - doEditDrag0(info, opposite); |
---|
| 2671 | + doEditDrag0(//clickInfo, |
---|
| 2672 | + opposite); |
---|
2657 | 2673 | } |
---|
2658 | 2674 | } |
---|
2659 | 2675 | break; |
---|
.. | .. |
---|
2671 | 2687 | { |
---|
2672 | 2688 | deselectAll(); |
---|
2673 | 2689 | } |
---|
| 2690 | + |
---|
| 2691 | + new Exception().printStackTrace(); |
---|
| 2692 | + |
---|
2674 | 2693 | ClickInfo newInfo = new ClickInfo(); |
---|
2675 | 2694 | newInfo.flags = info.flags; |
---|
2676 | 2695 | newInfo.bounds = info.bounds; |
---|
.. | .. |
---|
5893 | 5912 | if (support != null) |
---|
5894 | 5913 | support = support; |
---|
5895 | 5914 | |
---|
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); |
---|
| 5915 | + boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5916 | + //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5917 | + |
---|
| 5918 | + //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass. |
---|
5898 | 5919 | |
---|
5899 | 5920 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5900 | 5921 | { |
---|
.. | .. |
---|
5904 | 5925 | // usecalllists &= !(parent instanceof RandomNode); |
---|
5905 | 5926 | // usecalllists = false; |
---|
5906 | 5927 | |
---|
5907 | | - if (GetBRep() != null) |
---|
5908 | | - usecalllists = usecalllists; |
---|
| 5928 | + if (display.DrawMode() == display.SHADOW) |
---|
| 5929 | + //GetBRep() != null) |
---|
| 5930 | + usecalllists = !!usecalllists; |
---|
5909 | 5931 | //System.out.println("draw " + this); |
---|
5910 | 5932 | //new Exception().printStackTrace(); |
---|
5911 | 5933 | |
---|
.. | .. |
---|
5927 | 5949 | if (!(this instanceof Composite)) |
---|
5928 | 5950 | touched = false; |
---|
5929 | 5951 | //if (displaylist == -1 && usecalllists) |
---|
5930 | | - if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
| 5952 | + if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013 |
---|
5931 | 5953 | { |
---|
5932 | 5954 | bRep.displaylist = display.GenList(); |
---|
5933 | 5955 | assert(bRep.displaylist != 0); |
---|
.. | .. |
---|
5938 | 5960 | |
---|
5939 | 5961 | //System.out.println("\tnew list " + list); |
---|
5940 | 5962 | //gl.glDrawBuffer(gl.GL_NONE); |
---|
5941 | | - if (usecalllists) |
---|
| 5963 | + if (usecalllists && bRep.displaylist > 0) |
---|
5942 | 5964 | { |
---|
5943 | 5965 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5944 | 5966 | display.NewList(bRep.displaylist); |
---|
.. | .. |
---|
5947 | 5969 | CallList(display, root, selected, blocked); |
---|
5948 | 5970 | |
---|
5949 | 5971 | // compiled = true; |
---|
5950 | | - if (usecalllists) |
---|
| 5972 | + if (usecalllists && bRep.displaylist > 0) |
---|
5951 | 5973 | { |
---|
5952 | 5974 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5953 | 5975 | display.EndList(); |
---|
.. | .. |
---|
7298 | 7320 | } |
---|
7299 | 7321 | } |
---|
7300 | 7322 | |
---|
7301 | | - protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec) |
---|
| 7323 | + static ClickInfo clickInfo = new ClickInfo(); |
---|
| 7324 | + |
---|
| 7325 | + protected void calcHotSpot(cVector in, //ClickInfo clickInfo, |
---|
| 7326 | + Point outPt, Rectangle outRec) |
---|
7302 | 7327 | { |
---|
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; |
---|
| 7328 | + int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2; |
---|
| 7329 | + int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2; |
---|
| 7330 | + double[][] toscreen = clickInfo.toScreen; |
---|
7306 | 7331 | if (toscreen == null) |
---|
7307 | 7332 | { |
---|
7308 | | - toscreen = new Camera(info.camera.viewCode).toScreen; |
---|
| 7333 | + toscreen = new Camera(clickInfo.camera.viewCode).toScreen; |
---|
7309 | 7334 | } |
---|
7310 | 7335 | cVector vec = in; |
---|
7311 | 7336 | LA.xformPos(in, toscreen, in); |
---|
7312 | 7337 | //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(); |
---|
| 7338 | + vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
| 7339 | + vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance(); |
---|
7315 | 7340 | outPt.x = hc + (int) vec.x; |
---|
7316 | 7341 | outPt.y = vc - (int) vec.y; |
---|
7317 | 7342 | outRec.x = outPt.x - 3; |
---|
.. | .. |
---|
7319 | 7344 | outRec.width = outRec.height = 6; |
---|
7320 | 7345 | } |
---|
7321 | 7346 | |
---|
7322 | | - protected Rectangle calcHotSpot(cVector in, ClickInfo info) |
---|
| 7347 | + protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo |
---|
| 7348 | + ) |
---|
7323 | 7349 | { |
---|
7324 | 7350 | Point pt = new Point(0, 0); |
---|
7325 | 7351 | Rectangle rec = new Rectangle(); |
---|
7326 | | - calcHotSpot(in, info, pt, rec); |
---|
| 7352 | + calcHotSpot(in, //clickInfo, |
---|
| 7353 | + pt, rec); |
---|
7327 | 7354 | return rec; |
---|
7328 | 7355 | } |
---|
7329 | 7356 | |
---|
7330 | | - void drawEditHandles0(ClickInfo info, int level) |
---|
| 7357 | + void drawEditHandles0(//ClickInfo clickInfo, |
---|
| 7358 | + int level) |
---|
7331 | 7359 | { |
---|
7332 | 7360 | if (level == 0) |
---|
7333 | 7361 | { |
---|
.. | .. |
---|
7336 | 7364 | { |
---|
7337 | 7365 | cVector origin = new cVector(); |
---|
7338 | 7366 | //LA.xformPos(origin, toParent, origin); |
---|
7339 | | - Rectangle spot = calcHotSpot(origin, info); |
---|
| 7367 | + if (this.clickInfo == null) |
---|
| 7368 | + this.clickInfo = new ClickInfo(); |
---|
| 7369 | + |
---|
| 7370 | + Rectangle spot = calcHotSpot(origin); //, clickInfo); |
---|
7340 | 7371 | Rectangle boundary = new Rectangle(); |
---|
7341 | 7372 | boundary.x = spot.x - 30; |
---|
7342 | 7373 | boundary.y = spot.y - 30; |
---|
7343 | 7374 | boundary.width = spot.width + 60; |
---|
7344 | 7375 | boundary.height = spot.height + 60; |
---|
7345 | | - info.g.setColor(Color.red); |
---|
| 7376 | + clickInfo.g.setColor(Color.red); |
---|
7346 | 7377 | int spotw = spot.x + spot.width; |
---|
7347 | 7378 | int spoth = spot.y + spot.height; |
---|
7348 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7379 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7349 | 7380 | // if (CameraPane.Xmin > spot.x) |
---|
7350 | 7381 | // { |
---|
7351 | 7382 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7365 | 7396 | spot.translate(32, 32); |
---|
7366 | 7397 | spotw = spot.x + spot.width; |
---|
7367 | 7398 | spoth = spot.y + spot.height; |
---|
7368 | | - info.g.setColor(Color.cyan); |
---|
7369 | | - info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7399 | + clickInfo.g.setColor(Color.cyan); |
---|
| 7400 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7370 | 7401 | // if (CameraPane.Xmin > spot.x) |
---|
7371 | 7402 | // { |
---|
7372 | 7403 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7386 | 7417 | // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7387 | 7418 | //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7388 | 7419 | 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); |
---|
| 7420 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7421 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7422 | + clickInfo.g.setColor(Color.green); |
---|
7392 | 7423 | // if (CameraPane.Xmin > spot.x) |
---|
7393 | 7424 | // { |
---|
7394 | 7425 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7405 | 7436 | // { |
---|
7406 | 7437 | // CameraPane.Ymax = spoth; |
---|
7407 | 7438 | // } |
---|
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); |
---|
| 7439 | + clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
| 7440 | + (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7410 | 7441 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7411 | 7442 | // if (CameraPane.Xmin > boundary.x) |
---|
7412 | 7443 | // { |
---|
.. | .. |
---|
7428 | 7459 | } |
---|
7429 | 7460 | } |
---|
7430 | 7461 | |
---|
7431 | | - boolean doEditClick0(ClickInfo info, int level) |
---|
| 7462 | + boolean doEditClick0(//ClickInfo clickInfo, |
---|
| 7463 | + int level) |
---|
7432 | 7464 | { |
---|
7433 | 7465 | if (level == 0) |
---|
7434 | 7466 | { |
---|
.. | .. |
---|
7437 | 7469 | |
---|
7438 | 7470 | boolean retval = false; |
---|
7439 | 7471 | |
---|
7440 | | - startX = info.x; |
---|
7441 | | - startY = info.y; |
---|
| 7472 | + startX = clickInfo.x; |
---|
| 7473 | + startY = clickInfo.y; |
---|
7442 | 7474 | |
---|
7443 | 7475 | hitSomething = -1; |
---|
7444 | 7476 | cVector origin = new cVector(); |
---|
.. | .. |
---|
7448 | 7480 | { |
---|
7449 | 7481 | centerPt = new Point(0, 0); |
---|
7450 | 7482 | } |
---|
7451 | | - calcHotSpot(origin, info, centerPt, spot); |
---|
7452 | | - if (spot.contains(info.x, info.y)) |
---|
| 7483 | + calcHotSpot(origin, //info, |
---|
| 7484 | + centerPt, spot); |
---|
| 7485 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7453 | 7486 | { |
---|
7454 | 7487 | hitSomething = hitCenter; |
---|
7455 | 7488 | retval = true; |
---|
7456 | 7489 | } |
---|
7457 | 7490 | spot.translate(32, 0); |
---|
7458 | | - if (spot.contains(info.x, info.y)) |
---|
| 7491 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7459 | 7492 | { |
---|
7460 | 7493 | hitSomething = hitRotate; |
---|
7461 | 7494 | retval = true; |
---|
7462 | 7495 | } |
---|
7463 | 7496 | spot.translate(0, 32); |
---|
7464 | | - if (spot.contains(info.x, info.y)) |
---|
| 7497 | + if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7465 | 7498 | { |
---|
7466 | 7499 | hitSomething = hitScale; |
---|
| 7500 | + |
---|
| 7501 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
| 7502 | + double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7503 | + double sign = 1; |
---|
| 7504 | + if (hScale < 0) |
---|
| 7505 | + { |
---|
| 7506 | + sign = -1; |
---|
| 7507 | + } |
---|
| 7508 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
| 7509 | + if (hScale < 0.01) |
---|
| 7510 | + { |
---|
| 7511 | + //hScale = 0.01; |
---|
| 7512 | + } |
---|
| 7513 | + |
---|
| 7514 | + double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7515 | + sign = 1; |
---|
| 7516 | + if (vScale < 0) |
---|
| 7517 | + { |
---|
| 7518 | + sign = -1; |
---|
| 7519 | + } |
---|
| 7520 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
| 7521 | + if (vScale < 0.01) |
---|
| 7522 | + { |
---|
| 7523 | + //vScale = 0.01; |
---|
| 7524 | + } |
---|
| 7525 | + |
---|
| 7526 | + clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale); |
---|
| 7527 | + |
---|
7467 | 7528 | retval = true; |
---|
7468 | 7529 | } |
---|
7469 | 7530 | |
---|
.. | .. |
---|
7473 | 7534 | } |
---|
7474 | 7535 | |
---|
7475 | 7536 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
7476 | | - modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
| 7537 | + modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
7477 | 7538 | //System.out.println("modified = " + modified); |
---|
7478 | 7539 | //new Exception().printStackTrace(); |
---|
7479 | 7540 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
7501 | 7562 | return true; |
---|
7502 | 7563 | } |
---|
7503 | 7564 | |
---|
7504 | | - void doEditDrag0(ClickInfo info, boolean opposite) |
---|
| 7565 | + void doEditDrag0(//ClickInfo info, |
---|
| 7566 | + boolean opposite) |
---|
7505 | 7567 | { |
---|
7506 | 7568 | if (hitSomething == 0) |
---|
7507 | 7569 | { |
---|
.. | .. |
---|
7515 | 7577 | |
---|
7516 | 7578 | //System.out.println("hitSomething = " + hitSomething); |
---|
7517 | 7579 | |
---|
7518 | | - double scale = 0.005f * info.camera.Distance(); |
---|
| 7580 | + double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7519 | 7581 | |
---|
7520 | 7582 | cVector xlate = new cVector(); |
---|
7521 | 7583 | //cVector xlate2 = new cVector(); |
---|
.. | .. |
---|
7549 | 7611 | toParent[3][i] = xlate.get(i); |
---|
7550 | 7612 | LA.matInvert(toParent, fromParent); |
---|
7551 | 7613 | */ |
---|
7552 | | - cVector delta = LA.newVector(0, 0, startY - info.y); |
---|
7553 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7614 | + cVector delta = LA.newVector(0, 0, startY - clickInfo.y); |
---|
| 7615 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7554 | 7616 | |
---|
7555 | 7617 | LA.matCopy(startMat, toParent); |
---|
7556 | 7618 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7559 | 7621 | } else |
---|
7560 | 7622 | { |
---|
7561 | 7623 | //LA.xformDir(delta, info.camera.fromScreen, delta); |
---|
7562 | | - cVector up = new cVector(info.camera.up); |
---|
| 7624 | + cVector up = new cVector(clickInfo.camera.up); |
---|
7563 | 7625 | cVector away = new cVector(); |
---|
7564 | 7626 | //cVector right2 = new cVector(); |
---|
7565 | 7627 | //LA.vecCross(up, cVector.Z, right); |
---|
.. | .. |
---|
7576 | 7638 | LA.xformDir(up, ClickInfo.matbuffer, up); |
---|
7577 | 7639 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7578 | 7640 | LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up); |
---|
7579 | | - LA.xformDir(info.camera.away, ClickInfo.matbuffer, away); |
---|
| 7641 | + LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away); |
---|
7580 | 7642 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7581 | 7643 | LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away); |
---|
7582 | 7644 | //LA.vecCross(up, cVector.Z, right2); |
---|
7583 | 7645 | |
---|
7584 | | - cVector delta = LA.newVector(info.x - startX, startY - info.y, 0); |
---|
| 7646 | + cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0); |
---|
7585 | 7647 | |
---|
7586 | 7648 | //System.out.println("DELTA0 = " + delta); |
---|
7587 | 7649 | //System.out.println("AWAY = " + info.camera.away); |
---|
7588 | 7650 | //System.out.println("UP = " + info.camera.up); |
---|
7589 | 7651 | if (away.z > 0) |
---|
7590 | 7652 | { |
---|
7591 | | - if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
| 7653 | + if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0) |
---|
7592 | 7654 | { |
---|
7593 | 7655 | delta.x = -delta.x; |
---|
7594 | 7656 | } else |
---|
.. | .. |
---|
7603 | 7665 | //System.out.println("DELTA1 = " + delta); |
---|
7604 | 7666 | LA.xformDir(delta, ClickInfo.matbuffer, delta); |
---|
7605 | 7667 | //System.out.println("DELTA2 = " + delta); |
---|
7606 | | - LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta); |
---|
| 7668 | + LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta); |
---|
7607 | 7669 | LA.matCopy(startMat, toParent); |
---|
7608 | 7670 | //System.out.println("DELTA3 = " + delta); |
---|
7609 | 7671 | LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale); |
---|
.. | .. |
---|
7613 | 7675 | break; |
---|
7614 | 7676 | |
---|
7615 | 7677 | case hitRotate: // rotate |
---|
7616 | | - int dx = info.x - centerPt.x; |
---|
7617 | | - int dy = -(info.y - centerPt.y); |
---|
| 7678 | + int dx = clickInfo.x - centerPt.x; |
---|
| 7679 | + int dy = -(clickInfo.y - centerPt.y); |
---|
7618 | 7680 | double angle = (double) Math.atan2(dx, dy); |
---|
7619 | 7681 | angle = -(1.570796 - angle); |
---|
7620 | 7682 | |
---|
.. | .. |
---|
7637 | 7699 | } |
---|
7638 | 7700 | /**/ |
---|
7639 | 7701 | |
---|
7640 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 7702 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7641 | 7703 | { |
---|
7642 | 7704 | case 1: // '\001' |
---|
7643 | 7705 | LA.matZRotate(toParent, angle); |
---|
.. | .. |
---|
7664 | 7726 | break; |
---|
7665 | 7727 | |
---|
7666 | 7728 | case hitScale: // scale |
---|
7667 | | - double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7729 | + double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
7668 | 7730 | double sign = 1; |
---|
7669 | 7731 | if (hScale < 0) |
---|
7670 | 7732 | { |
---|
.. | .. |
---|
7676 | 7738 | //hScale = 0.01; |
---|
7677 | 7739 | } |
---|
7678 | 7740 | |
---|
7679 | | - double vScale = (double) (info.y - centerPt.y) / 32; |
---|
| 7741 | + double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
7680 | 7742 | sign = 1; |
---|
7681 | 7743 | if (vScale < 0) |
---|
7682 | 7744 | { |
---|
.. | .. |
---|
7687 | 7749 | { |
---|
7688 | 7750 | //vScale = 0.01; |
---|
7689 | 7751 | } |
---|
| 7752 | + |
---|
7690 | 7753 | LA.matCopy(startMat, toParent); |
---|
7691 | 7754 | /**/ |
---|
7692 | 7755 | for (int i = 0; i < 3; i++) |
---|
.. | .. |
---|
7696 | 7759 | } |
---|
7697 | 7760 | /**/ |
---|
7698 | 7761 | |
---|
7699 | | - double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7762 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale; |
---|
7700 | 7763 | |
---|
7701 | 7764 | if (totalScale < 0.01) |
---|
7702 | 7765 | { |
---|
7703 | 7766 | totalScale = 0.01; |
---|
7704 | 7767 | } |
---|
7705 | 7768 | |
---|
7706 | | - switch (info.pane.RenderCamera().viewCode) |
---|
| 7769 | + switch (clickInfo.pane.RenderCamera().viewCode) |
---|
7707 | 7770 | { |
---|
7708 | 7771 | case 3: // '\001' |
---|
7709 | 7772 | if (modified || opposite) |
---|
.. | .. |
---|
7770 | 7833 | } // NEW ... |
---|
7771 | 7834 | |
---|
7772 | 7835 | |
---|
7773 | | - info.pane.repaint(); |
---|
| 7836 | + clickInfo.pane.repaint(); |
---|
7774 | 7837 | } |
---|
7775 | 7838 | |
---|
7776 | 7839 | boolean overflow = false; |
---|