.. | .. |
---|
1 | 1 | |
---|
| 2 | +import com.bulletphysics.dynamics.RigidBody; |
---|
2 | 3 | import java.awt.*; |
---|
3 | 4 | import java.awt.event.*; |
---|
4 | 5 | import java.awt.image.*; |
---|
.. | .. |
---|
134 | 135 | static boolean ZOOMBOXMODE = false; |
---|
135 | 136 | static boolean BOXMODE = false; |
---|
136 | 137 | static boolean IMAGEFLIP = false; |
---|
137 | | -static boolean SMOOTHFOCUS = false; |
---|
| 138 | +static boolean SMOOTHFOCUS = true; // false; |
---|
138 | 139 | static boolean SPEAKERMOCAP = true; // jan 2014 false; |
---|
139 | 140 | static boolean SPEAKERCAMERA = false; |
---|
140 | 141 | static boolean SPEAKERFOCUS = false; |
---|
.. | .. |
---|
2109 | 2110 | // Start with free camera |
---|
2110 | 2111 | SwitchCameras(true); |
---|
2111 | 2112 | |
---|
2112 | | - pingthread.jump = true; // optional? |
---|
| 2113 | +// pingthread.jump = true; // optional? |
---|
2113 | 2114 | |
---|
2114 | 2115 | if (TRACKONCE) |
---|
2115 | 2116 | { |
---|
.. | .. |
---|
2296 | 2297 | public void ToggleTrack() |
---|
2297 | 2298 | { |
---|
2298 | 2299 | TRACK ^= true; |
---|
2299 | | - if (TRACK) |
---|
2300 | | - { |
---|
2301 | | - if (object.selection != null && |
---|
2302 | | - object.selection.size() > 0 && |
---|
2303 | | - object.selection.elementAt(0) != null && |
---|
2304 | | - !(object.selection.elementAt(0) instanceof Camera) && |
---|
2305 | | - !(object.selection.elementAt(0) instanceof ScriptNode)) |
---|
2306 | | - { |
---|
2307 | | - trackedobject = object.selection.elementAt(0); |
---|
2308 | | - repaint(); |
---|
2309 | | - } |
---|
2310 | | - } |
---|
2311 | 2300 | |
---|
2312 | 2301 | repaint(); |
---|
2313 | 2302 | } |
---|
.. | .. |
---|
6973 | 6962 | short residu = 0; |
---|
6974 | 6963 | |
---|
6975 | 6964 | // wraparound workarounds |
---|
6976 | | - short fuck = (short) (buffer[i] & 0xFF); |
---|
| 6965 | + short ww = (short) (buffer[i] & 0xFF); |
---|
6977 | 6966 | /* |
---|
6978 | | - residu += (fuck%2); |
---|
6979 | | - if(fuck/2 < 256-residu/2) |
---|
| 6967 | + residu += (ww%2); |
---|
| 6968 | + if(ww/2 < 256-residu/2) |
---|
6980 | 6969 | { |
---|
6981 | | - fuck = (short)((fuck/2) + residu/2); |
---|
| 6970 | + ww = (short)((ww/2) + residu/2); |
---|
6982 | 6971 | if(residu == 2) |
---|
6983 | 6972 | residu = 0; |
---|
6984 | 6973 | } |
---|
6985 | 6974 | else |
---|
6986 | 6975 | { |
---|
6987 | 6976 | residu = 0; |
---|
6988 | | - fuck /= 2; |
---|
| 6977 | + ww /= 2; |
---|
6989 | 6978 | } |
---|
6990 | 6979 | */ |
---|
6991 | | - if (i < imglength / 3 || rnd.nextFloat() < 0.5 || fuck >= 254) |
---|
| 6980 | + if (i < imglength / 3 || rnd.nextFloat() < 0.5 || ww >= 254) |
---|
6992 | 6981 | { |
---|
6993 | | - fuck /= 2; |
---|
| 6982 | + ww /= 2; |
---|
6994 | 6983 | } else |
---|
6995 | 6984 | { |
---|
6996 | | - fuck = (short) ((fuck / 2) + fuck % 2); |
---|
| 6985 | + ww = (short) ((ww / 2) + ww % 2); |
---|
6997 | 6986 | } |
---|
6998 | 6987 | |
---|
6999 | | - buffer[i] = (byte) fuck; |
---|
| 6988 | + buffer[i] = (byte) ww; |
---|
7000 | 6989 | } |
---|
7001 | 6990 | //System.out.print(bytes[i] + " "); |
---|
7002 | 6991 | //if(buffer[i] >= 0 && buffer[i]<=eps-1) buffer[i] = eps; |
---|
.. | .. |
---|
9854 | 9843 | |
---|
9855 | 9844 | boolean vr = capsLocked && !lightMode; |
---|
9856 | 9845 | |
---|
9857 | | - accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 2 : 1), |
---|
| 9846 | + accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 1.2 : 1), |
---|
9858 | 9847 | ratio, |
---|
9859 | 9848 | //near_plane, far_plane, |
---|
9860 | 9849 | renderCamera.shaper_zNear * renderCamera.Distance(), renderCamera.shaper_zFar * renderCamera.Distance(), |
---|
.. | .. |
---|
10916 | 10905 | else |
---|
10917 | 10906 | speedkey[RIGHT_ARROW] = 0; |
---|
10918 | 10907 | |
---|
| 10908 | + if (Globals.WALK && capsLocked) |
---|
| 10909 | + { |
---|
| 10910 | + Walk(); |
---|
| 10911 | + keyon = true; |
---|
| 10912 | + } |
---|
| 10913 | + |
---|
10919 | 10914 | if (keyon) |
---|
10920 | 10915 | { |
---|
10921 | 10916 | repaint(); |
---|
.. | .. |
---|
11513 | 11508 | { |
---|
11514 | 11509 | boolean vr = capsLocked && !lightMode; |
---|
11515 | 11510 | |
---|
11516 | | - glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 2 : 1), ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance()); |
---|
| 11511 | + glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 1.2 : 1), |
---|
| 11512 | + ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance()); |
---|
11517 | 11513 | } |
---|
11518 | 11514 | } |
---|
11519 | 11515 | |
---|
.. | .. |
---|
11869 | 11865 | repaint(); |
---|
11870 | 11866 | } |
---|
11871 | 11867 | |
---|
11872 | | - if (Globals.isLIVE() && DrawMode() == DEFAULT) // may 2013 |
---|
| 11868 | + if (Globals.isLIVE() && DrawMode() == DEFAULT || pingthread.live) // may 2013 |
---|
| 11869 | + { |
---|
| 11870 | + renderCamera.computeTransform(); |
---|
11873 | 11871 | repaint(); |
---|
| 11872 | + } |
---|
11874 | 11873 | |
---|
11875 | 11874 | displaydone = true; |
---|
11876 | 11875 | } |
---|
.. | .. |
---|
11945 | 11944 | //GL gl = getGL(); |
---|
11946 | 11945 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11947 | 11946 | { |
---|
| 11947 | + if (TRACK) |
---|
| 11948 | + { |
---|
| 11949 | + if (object.selection != null && |
---|
| 11950 | + object.selection.size() > 0 && |
---|
| 11951 | + object.selection.elementAt(0) != null && |
---|
| 11952 | + !(object.selection.elementAt(0) instanceof Camera) && |
---|
| 11953 | + !(object.selection.elementAt(0) instanceof ScriptNode)) |
---|
| 11954 | + { |
---|
| 11955 | + trackedobject = object.selection.elementAt(0); |
---|
| 11956 | + //repaint(); |
---|
| 11957 | + } |
---|
| 11958 | + else |
---|
| 11959 | + trackedobject = null; |
---|
| 11960 | + } |
---|
11948 | 11961 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11949 | 11962 | object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11950 | | - pingthread.StepToTarget(true); // true); |
---|
| 11963 | + pingthread.StepToTarget(); // true); |
---|
11951 | 11964 | // zoomonce = false; |
---|
11952 | 11965 | } |
---|
11953 | 11966 | |
---|
.. | .. |
---|
14328 | 14341 | public void mouseClicked(MouseEvent e) |
---|
14329 | 14342 | { |
---|
14330 | 14343 | System.out.println("mouseClicked: " + e); |
---|
| 14344 | + System.exit(0); |
---|
14331 | 14345 | } |
---|
14332 | 14346 | |
---|
14333 | 14347 | public void mousePressed(MouseEvent e) |
---|
14334 | 14348 | { |
---|
| 14349 | + RigidBody.justclicked = true; |
---|
| 14350 | + System.out.println("justclicked: " + e); |
---|
14335 | 14351 | //System.out.println("mousePressed: " + e); |
---|
14336 | 14352 | clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); |
---|
14337 | 14353 | } |
---|
.. | .. |
---|
14412 | 14428 | //} |
---|
14413 | 14429 | |
---|
14414 | 14430 | SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); |
---|
14415 | | - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0); |
---|
| 14431 | + drag(anchorX, anchorY + e.getUnitsToScroll()*8, e.getModifiers(), e.getModifiersEx()); |
---|
14416 | 14432 | anchorX = ax; |
---|
14417 | 14433 | anchorY = ay; |
---|
14418 | 14434 | prevX = px; |
---|
.. | .. |
---|
14507 | 14523 | // fev 2014??? |
---|
14508 | 14524 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
14509 | 14525 | object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
14510 | | - pingthread.StepToTarget(true); // true); |
---|
| 14526 | + pingthread.StepToTarget(); // true); |
---|
14511 | 14527 | } |
---|
| 14528 | + |
---|
14512 | 14529 | // if (!LIVE) |
---|
14513 | 14530 | super.repaint(); |
---|
14514 | 14531 | } |
---|
.. | .. |
---|
14603 | 14620 | |
---|
14604 | 14621 | //if (drawing) |
---|
14605 | 14622 | //return; |
---|
14606 | | - if ((e.getModifiersEx() & CTRL) != 0 |
---|
14607 | | - || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen()) |
---|
| 14623 | + if ((e.getModifiersEx() & CTRL) != 0 || |
---|
| 14624 | + (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen()) |
---|
14608 | 14625 | { |
---|
14609 | 14626 | //System.out.println("mouseDragged: " + e); |
---|
14610 | 14627 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
.. | .. |
---|
14628 | 14645 | return targetLookAt; |
---|
14629 | 14646 | } |
---|
14630 | 14647 | |
---|
| 14648 | + javax.vecmath.Point3d eye = new javax.vecmath.Point3d(); |
---|
| 14649 | + javax.vecmath.Point3d eye2 = new javax.vecmath.Point3d(); |
---|
| 14650 | + javax.vecmath.Vector3d dir = new javax.vecmath.Vector3d(); |
---|
| 14651 | + |
---|
| 14652 | + |
---|
14631 | 14653 | class PingThread extends Thread |
---|
14632 | 14654 | { |
---|
14633 | 14655 | boolean jump; |
---|
| 14656 | + boolean live; |
---|
14634 | 14657 | |
---|
14635 | 14658 | boolean mute; |
---|
14636 | 14659 | |
---|
.. | .. |
---|
14648 | 14671 | // only one thread!? synchronized |
---|
14649 | 14672 | void StepToTarget(boolean jump) |
---|
14650 | 14673 | { |
---|
| 14674 | + RigidBody.pos.x = 0; |
---|
| 14675 | + RigidBody.pos.y = 0; |
---|
| 14676 | + RigidBody.pos.z = 0; |
---|
| 14677 | + if (RigidBody.justclicked) |
---|
| 14678 | + { |
---|
| 14679 | + RigidBody.pos.x = (float)manipCamera.lookAt.x; |
---|
| 14680 | + RigidBody.pos.y = (float)manipCamera.lookAt.y; |
---|
| 14681 | + RigidBody.pos.z = (float)manipCamera.lookAt.z; |
---|
| 14682 | + RigidBody.wind.set(RigidBody.pos); |
---|
| 14683 | + RigidBody.wind.x -= (float)manipCamera.location.x; |
---|
| 14684 | + RigidBody.wind.y -= (float)manipCamera.location.y; |
---|
| 14685 | + RigidBody.wind.z -= (float)manipCamera.location.z; |
---|
| 14686 | + RigidBody.wind.normalize(); |
---|
| 14687 | + } |
---|
| 14688 | + |
---|
14651 | 14689 | if (mute) |
---|
14652 | 14690 | return; |
---|
| 14691 | + |
---|
| 14692 | + if (capsLocked && manipCamera.viewCode == 0) |
---|
| 14693 | + { |
---|
| 14694 | + eye.x = manipCamera.location.x; |
---|
| 14695 | + eye.y = manipCamera.location.y + 0.25; |
---|
| 14696 | + eye.z = manipCamera.location.z; |
---|
| 14697 | + |
---|
| 14698 | + dir.y = -1; |
---|
| 14699 | + |
---|
| 14700 | + Ray ray = new Ray(eye, dir); |
---|
| 14701 | + |
---|
| 14702 | + IntersectResult res = new IntersectResult(); |
---|
| 14703 | + res.t = Double.POSITIVE_INFINITY; |
---|
| 14704 | + |
---|
| 14705 | + tmp.set(targetLookAt); |
---|
| 14706 | + tmp.sub(manipCamera.location); |
---|
| 14707 | + |
---|
| 14708 | + double dist = tmp.length(); |
---|
| 14709 | + |
---|
| 14710 | + tmp.normalize(); |
---|
| 14711 | + |
---|
| 14712 | + eye2.x = manipCamera.location.x + tmp.x * 0.25; |
---|
| 14713 | + eye2.y = manipCamera.location.y + 0.25; |
---|
| 14714 | + eye2.z = manipCamera.location.z + tmp.z * 0.25; |
---|
| 14715 | + |
---|
| 14716 | + Ray ray2 = new Ray(eye2, dir); |
---|
| 14717 | + |
---|
| 14718 | + IntersectResult res2 = new IntersectResult(); |
---|
| 14719 | + res2.t = Double.POSITIVE_INFINITY; |
---|
| 14720 | + |
---|
| 14721 | + if (object.intersect(ray, res) && object.intersect(ray2, res2) && Math.abs(res.t - res2.t) < 0.25) |
---|
| 14722 | + { |
---|
| 14723 | + //tmp.set(manipCamera.location); |
---|
| 14724 | + |
---|
| 14725 | + manipCamera.location.x = ray.eyePoint.x + ray.viewDirection.x * res.t; |
---|
| 14726 | + manipCamera.location.y = ray.eyePoint.y + ray.viewDirection.y * res.t + 0.5; |
---|
| 14727 | + manipCamera.location.z = ray.eyePoint.z + ray.viewDirection.z * res.t; |
---|
| 14728 | + |
---|
| 14729 | + //tmp.sub(manipCamera.location); |
---|
| 14730 | + |
---|
| 14731 | + targetLookAt.x = ray2.eyePoint.x + ray2.viewDirection.x * res2.t; |
---|
| 14732 | + targetLookAt.y = ray2.eyePoint.y + ray2.viewDirection.y * res2.t + 0.5; |
---|
| 14733 | + targetLookAt.z = ray2.eyePoint.z + ray2.viewDirection.z * res2.t; |
---|
| 14734 | + |
---|
| 14735 | + targetLookAt.sub(manipCamera.location); |
---|
| 14736 | + targetLookAt.normalize(); |
---|
| 14737 | + targetLookAt.mul(dist); |
---|
| 14738 | + targetLookAt.add(manipCamera.location); |
---|
| 14739 | + |
---|
| 14740 | + //if (tmp.dot(tmp) > 0.000001) |
---|
| 14741 | + // System.out.println("INTERSECTION " + manipCamera.location); |
---|
| 14742 | + |
---|
| 14743 | + manipCamera.lookAt.set(targetLookAt); |
---|
| 14744 | + |
---|
| 14745 | + tmp.x = res.n.x; |
---|
| 14746 | + tmp.y = res.n.y; |
---|
| 14747 | + tmp.z = res.n.z; |
---|
| 14748 | + tmp.x += res2.n.x; |
---|
| 14749 | + tmp.y += res2.n.y; |
---|
| 14750 | + tmp.z += res2.n.z; |
---|
| 14751 | + tmp.normalize(); |
---|
| 14752 | + manipCamera.UP.set(tmp); |
---|
| 14753 | + } |
---|
| 14754 | + } |
---|
14653 | 14755 | |
---|
14654 | 14756 | tmp.set(targetLookAt); |
---|
14655 | 14757 | tmp.sub(manipCamera.lookAt); // june 2014 |
---|
.. | .. |
---|
14688 | 14790 | |
---|
14689 | 14791 | if (tmp.dot(tmp) > 1) // may 2014. far away: jump to target |
---|
14690 | 14792 | { |
---|
14691 | | - jump = true; // step = 1; |
---|
| 14793 | + // sep 2019 jump = true; // step = 1; |
---|
14692 | 14794 | } |
---|
14693 | 14795 | |
---|
14694 | 14796 | if (OEILONCE && OEIL) |
---|
.. | .. |
---|
14723 | 14825 | if (tmp.dot(tmp) < 0.00001) |
---|
14724 | 14826 | { |
---|
14725 | 14827 | zoomonce = false; |
---|
| 14828 | + live = false; |
---|
14726 | 14829 | } |
---|
| 14830 | + else |
---|
| 14831 | + live = true; |
---|
14727 | 14832 | |
---|
14728 | 14833 | tmp.mul(step > step2 ? step : step2); |
---|
14729 | 14834 | } |
---|
.. | .. |
---|
14750 | 14855 | { |
---|
14751 | 14856 | if (LOOKAT) |
---|
14752 | 14857 | manipCamera.lookAt.add(tmp); |
---|
14753 | | - if (OEIL) |
---|
| 14858 | + if (OEIL && !capsLocked) |
---|
14754 | 14859 | manipCamera.location.add(tmp); |
---|
14755 | 14860 | |
---|
14756 | 14861 | { |
---|
.. | .. |
---|
14765 | 14870 | lightCamera.computeTransform(); |
---|
14766 | 14871 | } |
---|
14767 | 14872 | } |
---|
14768 | | - manipCamera.computeTransform(); |
---|
| 14873 | + if (tmp.x != 0 || tmp.y != 0 || tmp.z != 0) |
---|
| 14874 | + { |
---|
| 14875 | + manipCamera.computeTransform(); |
---|
| 14876 | + } |
---|
14769 | 14877 | } |
---|
14770 | 14878 | // ?????? mouseDown = true; |
---|
14771 | 14879 | //System.out.println("---------------- ---------- Paint " + tmp.length2()); |
---|
.. | .. |
---|
14862 | 14970 | PingThread pingthread = new PingThread(); |
---|
14863 | 14971 | int delta = 1; |
---|
14864 | 14972 | int speed = 1; |
---|
| 14973 | + int walk = 8; |
---|
14865 | 14974 | boolean autorepeat = false; |
---|
14866 | 14975 | |
---|
| 14976 | + void Walk() |
---|
| 14977 | + { |
---|
| 14978 | + manipCamera.BackForth(0, walk, 1000); |
---|
| 14979 | + |
---|
| 14980 | + targetLookAt.set(manipCamera.lookAt); |
---|
| 14981 | + } |
---|
| 14982 | + |
---|
| 14983 | + void ViewAngle(float dy) |
---|
| 14984 | + { |
---|
| 14985 | + double factor = Math.exp(-dy/300.0); // (1 + dy/100); |
---|
| 14986 | + |
---|
| 14987 | + if (manipCamera.shaper_fovy * factor > 1 && |
---|
| 14988 | + manipCamera.shaper_fovy * factor < 150) |
---|
| 14989 | + { |
---|
| 14990 | + manipCamera.shaper_fovy *= factor; |
---|
| 14991 | + //System.out.println("fovy = " + shaper_fovy); |
---|
| 14992 | + } |
---|
| 14993 | + } |
---|
| 14994 | + |
---|
14867 | 14995 | void GoDown(int mod) |
---|
14868 | 14996 | { |
---|
14869 | 14997 | MODIFIERS |= COMMAND; |
---|
.. | .. |
---|
14874 | 15002 | // if (isVR) |
---|
14875 | 15003 | // manipCamera.RotateInterest(0, speed); |
---|
14876 | 15004 | // else |
---|
| 15005 | + if (isVR) |
---|
| 15006 | + ViewAngle(-speed*delta); |
---|
| 15007 | + else |
---|
14877 | 15008 | manipCamera.Translate(0, -speed*delta, getWidth()); |
---|
14878 | 15009 | } |
---|
14879 | 15010 | else |
---|
.. | .. |
---|
14901 | 15032 | |
---|
14902 | 15033 | void GoUp(int mod) |
---|
14903 | 15034 | { |
---|
| 15035 | + RigidBody.justclicked = true; |
---|
| 15036 | + |
---|
14904 | 15037 | MODIFIERS |= COMMAND; |
---|
14905 | 15038 | /**/ |
---|
14906 | 15039 | boolean isVR = (mouseMode&VR)!=0; |
---|
.. | .. |
---|
14910 | 15043 | // if (isVR) |
---|
14911 | 15044 | // manipCamera.RotateInterest(0, -speed); |
---|
14912 | 15045 | // else |
---|
| 15046 | + if (isVR) |
---|
| 15047 | + ViewAngle(speed*delta); |
---|
| 15048 | + else |
---|
14913 | 15049 | manipCamera.Translate(0, speed*delta, getWidth()); |
---|
14914 | 15050 | } |
---|
14915 | 15051 | else |
---|
.. | .. |
---|
14940 | 15076 | MODIFIERS |= COMMAND; |
---|
14941 | 15077 | /**/ |
---|
14942 | 15078 | if((mod&SHIFT) == SHIFT) |
---|
14943 | | - manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
| 15079 | + manipCamera.Translate(speed, 0, getWidth()); |
---|
14944 | 15080 | else |
---|
14945 | 15081 | { |
---|
14946 | 15082 | if ((mouseMode&VR)!=0) |
---|
14947 | | - manipCamera.RotateInterest(-speed, 0); |
---|
| 15083 | + manipCamera.RotateInterest(-speed*manipCamera.shaper_fovy/90, 0); |
---|
14948 | 15084 | else |
---|
14949 | | - manipCamera.RotatePosition(speed, 0); |
---|
| 15085 | + manipCamera.RotatePosition(speed*manipCamera.shaper_fovy/90, 0); |
---|
14950 | 15086 | } |
---|
14951 | 15087 | |
---|
14952 | 15088 | /**/ |
---|
.. | .. |
---|
14972 | 15108 | MODIFIERS |= COMMAND; |
---|
14973 | 15109 | /**/ |
---|
14974 | 15110 | if((mod&SHIFT) == SHIFT) |
---|
14975 | | - manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
| 15111 | + manipCamera.Translate(-speed, 0, getWidth()); |
---|
14976 | 15112 | else |
---|
14977 | 15113 | { |
---|
14978 | 15114 | if ((mouseMode&VR)!=0) |
---|
14979 | | - manipCamera.RotateInterest(speed, 0); |
---|
| 15115 | + manipCamera.RotateInterest(speed*manipCamera.shaper_fovy/90, 0); |
---|
14980 | 15116 | else |
---|
14981 | | - manipCamera.RotatePosition(-speed, 0); |
---|
| 15117 | + manipCamera.RotatePosition(-speed*manipCamera.shaper_fovy/90, 0); |
---|
14982 | 15118 | } |
---|
14983 | 15119 | |
---|
14984 | 15120 | /**/ |
---|
.. | .. |
---|
15125 | 15261 | if ((mouseMode & ZOOM) != 0) |
---|
15126 | 15262 | { |
---|
15127 | 15263 | //if ((mouseMode & BACKFORTH) != 0) |
---|
| 15264 | + if ((modifiersex & SHIFT) == SHIFT) |
---|
| 15265 | + { |
---|
| 15266 | + ViewAngle(dy); |
---|
| 15267 | + } |
---|
| 15268 | + else |
---|
15128 | 15269 | if ((mouseMode & VR) != 0) |
---|
15129 | 15270 | manipCamera.BackForth(dx, dy, getWidth()); |
---|
15130 | 15271 | else |
---|
.. | .. |
---|
15195 | 15336 | |
---|
15196 | 15337 | public void mouseMoved(MouseEvent e) |
---|
15197 | 15338 | { |
---|
| 15339 | +//object.editWindow.frame. |
---|
| 15340 | + setCursor(Cursor.getDefaultCursor()); |
---|
| 15341 | + |
---|
15198 | 15342 | //System.out.println("mouseMoved: " + e); |
---|
15199 | 15343 | if (isRenderer) |
---|
15200 | 15344 | return; |
---|
.. | .. |
---|
15439 | 15583 | float SATPOW = 1; // 2; // 0.5f; |
---|
15440 | 15584 | float BRIPOW = 1; // 0.5f; // 0.5f; |
---|
15441 | 15585 | |
---|
| 15586 | +static BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); |
---|
| 15587 | + |
---|
| 15588 | +// Create a new blank cursor. |
---|
| 15589 | +static Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor( |
---|
| 15590 | + cursorImg, new Point(0, 0), "blank cursor"); |
---|
| 15591 | + |
---|
15442 | 15592 | public void keyPressed(int key) |
---|
15443 | 15593 | { |
---|
| 15594 | +// Set the blank cursor to the JFrame. |
---|
| 15595 | +//object.editWindow.frame. |
---|
| 15596 | + setCursor(blankCursor); |
---|
| 15597 | + |
---|
15444 | 15598 | if (key >= '0' && key <= '5') |
---|
15445 | 15599 | clampbit = (key-'0'); |
---|
15446 | 15600 | |
---|
.. | .. |
---|
15816 | 15970 | case ENTER: |
---|
15817 | 15971 | // object.editWindow.ScreenFit(); // Edit(); |
---|
15818 | 15972 | ToggleLive(); |
---|
| 15973 | + if (capsLocked) |
---|
| 15974 | + { |
---|
| 15975 | + Globals.WALK ^= true; |
---|
| 15976 | + } |
---|
15819 | 15977 | break; |
---|
15820 | 15978 | case DELETE: |
---|
15821 | 15979 | ClearSelection(); |
---|
.. | .. |
---|
15852 | 16010 | object.GetWindow().refreshContents(true); |
---|
15853 | 16011 | break; |
---|
15854 | 16012 | case '{': |
---|
15855 | | - manipCamera.shaper_fovy /= 1.1; |
---|
| 16013 | + double factor = 1.1; |
---|
| 16014 | + if (manipCamera.shaper_fovy / factor > 0.1) |
---|
| 16015 | + manipCamera.shaper_fovy /= factor; |
---|
15856 | 16016 | System.out.println("FOV = " + manipCamera.shaper_fovy); |
---|
15857 | 16017 | repaint(); |
---|
15858 | 16018 | break; |
---|
15859 | 16019 | case '}': |
---|
15860 | | - manipCamera.shaper_fovy *= 1.1; |
---|
| 16020 | + factor = 1.1; |
---|
| 16021 | + if (manipCamera.shaper_fovy * factor < 150) |
---|
| 16022 | + manipCamera.shaper_fovy *= factor; |
---|
15861 | 16023 | System.out.println("FOV = " + manipCamera.shaper_fovy); |
---|
15862 | 16024 | repaint(); |
---|
15863 | 16025 | break; |
---|
15864 | 16026 | case '[': |
---|
15865 | | - manipCamera.shaper_fovy /= 1.01; |
---|
| 16027 | + factor = 1.01; |
---|
| 16028 | + if (manipCamera.shaper_fovy / factor > 0.1) |
---|
| 16029 | + manipCamera.shaper_fovy /= factor; |
---|
15866 | 16030 | if (false) //manipCamera.hAspect == 0) |
---|
15867 | 16031 | { |
---|
15868 | 16032 | double x = Math.tan(manipCamera.shaper_fovy * Math.PI / 180 / 2); |
---|
.. | .. |
---|
15878 | 16042 | break; |
---|
15879 | 16043 | case ']': |
---|
15880 | 16044 | //manipCamera.shaper_fovy += (180 - manipCamera.shaper_fovy)*0.1; |
---|
15881 | | - manipCamera.shaper_fovy *= 1.01; |
---|
| 16045 | + factor = 1.01; |
---|
| 16046 | + if (manipCamera.shaper_fovy * factor < 150) |
---|
| 16047 | + manipCamera.shaper_fovy *= factor; |
---|
15882 | 16048 | if (false) //manipCamera.hAspect == 0) |
---|
15883 | 16049 | { |
---|
15884 | 16050 | double x = Math.tan(manipCamera.shaper_fovy * Math.PI / 180 / 2); |
---|
.. | .. |
---|
16598 | 16764 | |
---|
16599 | 16765 | public boolean mouseDrag(Event evt, int x, int y) |
---|
16600 | 16766 | { |
---|
16601 | | - //System.out.println("mouseDrag: " + evt); |
---|
| 16767 | + System.out.println("mouseDrag: " + evt); |
---|
| 16768 | + System.exit(0); |
---|
16602 | 16769 | /* |
---|
16603 | 16770 | drag = true; |
---|
16604 | 16771 | //System.out.println("Mouse DRAG"); |
---|
.. | .. |
---|
16717 | 16884 | public boolean mouseUp(Event evt, int x, int y) |
---|
16718 | 16885 | { |
---|
16719 | 16886 | System.out.println("mouseUp: " + evt); |
---|
| 16887 | + System.exit(0); |
---|
16720 | 16888 | /* |
---|
16721 | 16889 | locked = false; |
---|
16722 | 16890 | if (isRenderer) |
---|
.. | .. |
---|
18091 | 18259 | |
---|
18092 | 18260 | private boolean keepshadow; |
---|
18093 | 18261 | |
---|
18094 | | - public boolean capsLocked = false; // VR |
---|
| 18262 | + static public boolean capsLocked = false; // VR |
---|
18095 | 18263 | |
---|
18096 | 18264 | static public int indexcount = 0; |
---|
18097 | 18265 | /*static*/ cColor vertexOcclusion = new cColor(); |
---|