Normand Briere
2019-09-25 51e45bf615e1e2b4aca2edf9f7333b687c7d015e
CameraPane.java
....@@ -1,4 +1,5 @@
11
2
+import com.bulletphysics.dynamics.RigidBody;
23 import java.awt.*;
34 import java.awt.event.*;
45 import java.awt.image.*;
....@@ -134,7 +135,7 @@
134135 static boolean ZOOMBOXMODE = false;
135136 static boolean BOXMODE = false;
136137 static boolean IMAGEFLIP = false;
137
-static boolean SMOOTHFOCUS = false;
138
+static boolean SMOOTHFOCUS = true; // false;
138139 static boolean SPEAKERMOCAP = true; // jan 2014 false;
139140 static boolean SPEAKERCAMERA = false;
140141 static boolean SPEAKERFOCUS = false;
....@@ -221,7 +222,7 @@
221222 cameras = new Camera[2];
222223 targetLookAts = new cVector[2];
223224
224
- SetCamera(cam);
225
+ SetCamera(cam, true);
225226
226227 // Warning: not used.
227228 //SetLight(new Camera(new cVector(15, 10, -20)));
....@@ -2064,7 +2065,7 @@
20642065
20652066 static int camerachangeframe;
20662067
2067
- public boolean SetCamera(Camera cam)
2068
+ public boolean SetCamera(Camera cam, boolean set)
20682069 {
20692070 // may 2014 if (cam == cameras[0] || cam == cameras[1])
20702071 // return false;
....@@ -2092,7 +2093,10 @@
20922093 if (cameras[i] == null)
20932094 {
20942095 cameras[i] = new Camera(cam.viewCode);
2095
-
2096
+ }
2097
+
2098
+ if (set)
2099
+ {
20962100 cameras[i].setAim(cam.location, cam.lookAt);
20972101 cameras[i].shaper_fovy = cam.shaper_fovy;
20982102 cameras[i].UP.set(cam.UP);
....@@ -2106,7 +2110,7 @@
21062110 // Start with free camera
21072111 SwitchCameras(true);
21082112
2109
- pingthread.jump = true; // optional?
2113
+// pingthread.jump = true; // optional?
21102114
21112115 if (TRACKONCE)
21122116 {
....@@ -2293,18 +2297,6 @@
22932297 public void ToggleTrack()
22942298 {
22952299 TRACK ^= true;
2296
- if (TRACK)
2297
- {
2298
- if (object.selection != null &&
2299
- object.selection.size() > 0 &&
2300
- object.selection.elementAt(0) != null &&
2301
- !(object.selection.elementAt(0) instanceof Camera) &&
2302
- !(object.selection.elementAt(0) instanceof ScriptNode))
2303
- {
2304
- trackedobject = object.selection.elementAt(0);
2305
- repaint();
2306
- }
2307
- }
23082300
23092301 repaint();
23102302 }
....@@ -3598,6 +3590,8 @@
35983590 };
35993591 /**/
36003592
3593
+ static Object3D lastObject;
3594
+
36013595 //com.sun.opengl.util.texture.Texture
36023596 TextureData
36033597 GetFileTexture(String name, boolean bump, int resolution)
....@@ -3634,6 +3628,8 @@
36343628 // return null;
36353629 //if (i == 2)
36363630 // return null;
3631
+ // TIFF issue sept 2019
3632
+ System.err.println("lastObject = " + lastObject);
36373633 e.printStackTrace();
36383634 name = name.split("\\.tif")[0] + ".jpg";
36393635 }
....@@ -6966,30 +6962,30 @@
69666962 short residu = 0;
69676963
69686964 // wraparound workarounds
6969
- short fuck = (short) (buffer[i] & 0xFF);
6965
+ short ww = (short) (buffer[i] & 0xFF);
69706966 /*
6971
- residu += (fuck%2);
6972
- if(fuck/2 < 256-residu/2)
6967
+ residu += (ww%2);
6968
+ if(ww/2 < 256-residu/2)
69736969 {
6974
- fuck = (short)((fuck/2) + residu/2);
6970
+ ww = (short)((ww/2) + residu/2);
69756971 if(residu == 2)
69766972 residu = 0;
69776973 }
69786974 else
69796975 {
69806976 residu = 0;
6981
- fuck /= 2;
6977
+ ww /= 2;
69826978 }
69836979 */
6984
- if (i < imglength / 3 || rnd.nextFloat() < 0.5 || fuck >= 254)
6980
+ if (i < imglength / 3 || rnd.nextFloat() < 0.5 || ww >= 254)
69856981 {
6986
- fuck /= 2;
6982
+ ww /= 2;
69876983 } else
69886984 {
6989
- fuck = (short) ((fuck / 2) + fuck % 2);
6985
+ ww = (short) ((ww / 2) + ww % 2);
69906986 }
69916987
6992
- buffer[i] = (byte) fuck;
6988
+ buffer[i] = (byte) ww;
69936989 }
69946990 //System.out.print(bytes[i] + " ");
69956991 //if(buffer[i] >= 0 && buffer[i]<=eps-1) buffer[i] = eps;
....@@ -9847,7 +9843,7 @@
98479843
98489844 boolean vr = capsLocked && !lightMode;
98499845
9850
- accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 2 : 1),
9846
+ accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 1.2 : 1),
98519847 ratio,
98529848 //near_plane, far_plane,
98539849 renderCamera.shaper_zNear * renderCamera.Distance(), renderCamera.shaper_zFar * renderCamera.Distance(),
....@@ -10867,30 +10863,59 @@
1086710863
1086810864 if (keys[DOWN_ARROW])
1086910865 {
10866
+ speed = ++speedkey[DOWN_ARROW];
10867
+ if (speed > 20)
10868
+ speed = 20;
1087010869 GoDown(modifiers);
1087110870 keyon = true;
1087210871 }
10872
+ else
10873
+ speedkey[DOWN_ARROW] = 0;
1087310874
1087410875 if (keys[UP_ARROW])
1087510876 {
10877
+ speed = ++speedkey[UP_ARROW];
10878
+ if (speed > 20)
10879
+ speed = 20;
1087610880 GoUp(modifiers);
1087710881 keyon = true;
1087810882 }
10883
+ else
10884
+ speedkey[UP_ARROW] = 0;
1087910885
1088010886 if (keys[LEFT_ARROW])
1088110887 {
10888
+ speed = ++speedkey[LEFT_ARROW];
10889
+ if (speed > 20)
10890
+ speed = 20;
1088210891 GoLeft(modifiers);
1088310892 keyon = true;
1088410893 }
10894
+ else
10895
+ speedkey[LEFT_ARROW] = 0;
1088510896
1088610897 if (keys[RIGHT_ARROW])
1088710898 {
10899
+ speed = ++speedkey[RIGHT_ARROW];
10900
+ if (speed > 20)
10901
+ speed = 20;
1088810902 GoRight(modifiers);
10903
+ keyon = true;
10904
+ }
10905
+ else
10906
+ speedkey[RIGHT_ARROW] = 0;
10907
+
10908
+ if (Globals.WALK && capsLocked)
10909
+ {
10910
+ Walk();
1088910911 keyon = true;
1089010912 }
1089110913
1089210914 if (keyon)
10915
+ {
1089310916 repaint();
10917
+ }
10918
+
1089410919 //pingthread.mute = false;
1089510920 }
1089610921
....@@ -11483,7 +11508,8 @@
1148311508 {
1148411509 boolean vr = capsLocked && !lightMode;
1148511510
11486
- 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());
1148711513 }
1148811514 }
1148911515
....@@ -11839,8 +11865,11 @@
1183911865 repaint();
1184011866 }
1184111867
11842
- if (Globals.isLIVE() && DrawMode() == DEFAULT) // may 2013
11868
+ if (Globals.isLIVE() && DrawMode() == DEFAULT || pingthread.live) // may 2013
11869
+ {
11870
+ renderCamera.computeTransform();
1184311871 repaint();
11872
+ }
1184411873
1184511874 displaydone = true;
1184611875 }
....@@ -11915,9 +11944,23 @@
1191511944 //GL gl = getGL();
1191611945 if ((TRACK || SHADOWTRACK) || zoomonce)
1191711946 {
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
+ }
1191811961 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
1191911962 object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11920
- pingthread.StepToTarget(true); // true);
11963
+ pingthread.StepToTarget(); // true);
1192111964 // zoomonce = false;
1192211965 }
1192311966
....@@ -14298,10 +14341,13 @@
1429814341 public void mouseClicked(MouseEvent e)
1429914342 {
1430014343 System.out.println("mouseClicked: " + e);
14344
+ System.exit(0);
1430114345 }
1430214346
1430314347 public void mousePressed(MouseEvent e)
1430414348 {
14349
+ RigidBody.justclicked = true;
14350
+ System.out.println("justclicked: " + e);
1430514351 //System.out.println("mousePressed: " + e);
1430614352 clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1430714353 }
....@@ -14382,7 +14428,7 @@
1438214428 //}
1438314429
1438414430 SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
14385
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
14431
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, e.getModifiers(), e.getModifiersEx());
1438614432 anchorX = ax;
1438714433 anchorY = ay;
1438814434 prevX = px;
....@@ -14477,8 +14523,9 @@
1447714523 // fev 2014???
1447814524 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
1447914525 object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
14480
- pingthread.StepToTarget(true); // true);
14526
+ pingthread.StepToTarget(); // true);
1448114527 }
14528
+
1448214529 // if (!LIVE)
1448314530 super.repaint();
1448414531 }
....@@ -14573,8 +14620,8 @@
1457314620
1457414621 //if (drawing)
1457514622 //return;
14576
- if ((e.getModifiersEx() & CTRL) != 0
14577
- || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
14623
+ if ((e.getModifiersEx() & CTRL) != 0 ||
14624
+ (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1457814625 {
1457914626 //System.out.println("mouseDragged: " + e);
1458014627 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
....@@ -14598,9 +14645,15 @@
1459814645 return targetLookAt;
1459914646 }
1460014647
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
+
1460114653 class PingThread extends Thread
1460214654 {
1460314655 boolean jump;
14656
+ boolean live;
1460414657
1460514658 boolean mute;
1460614659
....@@ -14618,8 +14671,87 @@
1461814671 // only one thread!? synchronized
1461914672 void StepToTarget(boolean jump)
1462014673 {
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
+
1462114689 if (mute)
1462214690 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
+ }
1462314755
1462414756 tmp.set(targetLookAt);
1462514757 tmp.sub(manipCamera.lookAt); // june 2014
....@@ -14658,7 +14790,7 @@
1465814790
1465914791 if (tmp.dot(tmp) > 1) // may 2014. far away: jump to target
1466014792 {
14661
- jump = true; // step = 1;
14793
+ // sep 2019 jump = true; // step = 1;
1466214794 }
1466314795
1466414796 if (OEILONCE && OEIL)
....@@ -14693,7 +14825,10 @@
1469314825 if (tmp.dot(tmp) < 0.00001)
1469414826 {
1469514827 zoomonce = false;
14828
+ live = false;
1469614829 }
14830
+ else
14831
+ live = true;
1469714832
1469814833 tmp.mul(step > step2 ? step : step2);
1469914834 }
....@@ -14720,7 +14855,7 @@
1472014855 {
1472114856 if (LOOKAT)
1472214857 manipCamera.lookAt.add(tmp);
14723
- if (OEIL)
14858
+ if (OEIL && !capsLocked)
1472414859 manipCamera.location.add(tmp);
1472514860
1472614861 {
....@@ -14735,7 +14870,10 @@
1473514870 lightCamera.computeTransform();
1473614871 }
1473714872 }
14738
- manipCamera.computeTransform();
14873
+ if (tmp.x != 0 || tmp.y != 0 || tmp.z != 0)
14874
+ {
14875
+ manipCamera.computeTransform();
14876
+ }
1473914877 }
1474014878 // ?????? mouseDown = true;
1474114879 //System.out.println("---------------- ---------- Paint " + tmp.length2());
....@@ -14828,11 +14966,32 @@
1482814966 }
1482914967 }
1483014968 }
14969
+
1483114970 PingThread pingthread = new PingThread();
14832
- int delta = 2;
14833
- int speed = 2;
14971
+ int delta = 1;
14972
+ int speed = 1;
14973
+ int walk = 8;
1483414974 boolean autorepeat = false;
1483514975
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
+
1483614995 void GoDown(int mod)
1483714996 {
1483814997 MODIFIERS |= COMMAND;
....@@ -14840,21 +14999,30 @@
1484014999 /**/
1484115000 if((mod&SHIFT) == SHIFT)
1484215001 {
15002
+// if (isVR)
15003
+// manipCamera.RotateInterest(0, speed);
15004
+// else
1484315005 if (isVR)
14844
- manipCamera.RotateInterest(0, speed);
15006
+ ViewAngle(-speed*delta);
15007
+ else
15008
+ manipCamera.Translate(0, -speed*delta, getWidth());
15009
+ }
15010
+ else
15011
+ {
15012
+ if (isVR)
15013
+ manipCamera.BackForth(0, -speed*delta, isVR?1000:0); // getWidth());
1484515014 else
1484615015 manipCamera.RotatePosition(0, -speed);
1484715016 }
14848
- else
14849
- manipCamera.BackForth(0, -speed*delta, isVR?1000:0); // getWidth());
15017
+
1485015018 /**/
14851
- if ((mod & SHIFT) == SHIFT)
14852
- {
14853
- mouseMode = mouseMode; // VR??
14854
- } else
14855
- {
14856
- mouseMode |= BACKFORTH;
14857
- }
15019
+// if ((mod & SHIFT) == SHIFT)
15020
+// {
15021
+// mouseMode = mouseMode; // VR??
15022
+// } else
15023
+// {
15024
+// mouseMode |= BACKFORTH;
15025
+// }
1485815026
1485915027 targetLookAt.set(manipCamera.lookAt);
1486015028
....@@ -14864,27 +15032,38 @@
1486415032
1486515033 void GoUp(int mod)
1486615034 {
15035
+ RigidBody.justclicked = true;
15036
+
1486715037 MODIFIERS |= COMMAND;
1486815038 /**/
1486915039 boolean isVR = (mouseMode&VR)!=0;
1487015040
1487115041 if((mod&SHIFT) == SHIFT)
1487215042 {
15043
+// if (isVR)
15044
+// manipCamera.RotateInterest(0, -speed);
15045
+// else
1487315046 if (isVR)
14874
- manipCamera.RotateInterest(0, -speed);
15047
+ ViewAngle(speed*delta);
15048
+ else
15049
+ manipCamera.Translate(0, speed*delta, getWidth());
15050
+ }
15051
+ else
15052
+ {
15053
+ if (isVR)
15054
+ manipCamera.BackForth(0, speed*delta, isVR?1000:0); // getWidth());
1487515055 else
1487615056 manipCamera.RotatePosition(0, speed);
1487715057 }
14878
- else
14879
- manipCamera.BackForth(0, speed*delta, isVR?1000:0); // getWidth());
15058
+
1488015059 /**/
14881
- if ((mod & SHIFT) == SHIFT)
14882
- {
14883
- mouseMode = mouseMode;
14884
- } else
14885
- {
14886
- mouseMode |= BACKFORTH;
14887
- }
15060
+// if ((mod & SHIFT) == SHIFT)
15061
+// {
15062
+// mouseMode = mouseMode;
15063
+// } else
15064
+// {
15065
+// mouseMode |= BACKFORTH;
15066
+// }
1488815067
1488915068 targetLookAt.set(manipCamera.lookAt);
1489015069
....@@ -14897,22 +15076,23 @@
1489715076 MODIFIERS |= COMMAND;
1489815077 /**/
1489915078 if((mod&SHIFT) == SHIFT)
14900
- manipCamera.Translate(speed*delta, 0, getWidth());
15079
+ manipCamera.Translate(speed, 0, getWidth());
1490115080 else
1490215081 {
1490315082 if ((mouseMode&VR)!=0)
14904
- manipCamera.RotateInterest(-speed, 0);
15083
+ manipCamera.RotateInterest(-speed*manipCamera.shaper_fovy/90, 0);
1490515084 else
14906
- manipCamera.RotatePosition(speed, 0);
15085
+ manipCamera.RotatePosition(speed*manipCamera.shaper_fovy/90, 0);
1490715086 }
15087
+
1490815088 /**/
14909
- if ((mod & SHIFT) == SHIFT)
14910
- {
14911
- mouseMode = mouseMode;
14912
- } else
14913
- {
14914
- mouseMode |= ROTATE;
14915
- } // TRANSLATE;
15089
+// if ((mod & SHIFT) == SHIFT)
15090
+// {
15091
+// mouseMode = mouseMode;
15092
+// } else
15093
+// {
15094
+// mouseMode |= ROTATE;
15095
+// } // TRANSLATE;
1491615096
1491715097 //System.err.println("lookAt = " + manipCamera.lookAt);
1491815098 //System.err.println("location = " + manipCamera.location);
....@@ -14928,23 +15108,23 @@
1492815108 MODIFIERS |= COMMAND;
1492915109 /**/
1493015110 if((mod&SHIFT) == SHIFT)
14931
- manipCamera.Translate(-speed*delta, 0, getWidth());
15111
+ manipCamera.Translate(-speed, 0, getWidth());
1493215112 else
1493315113 {
1493415114 if ((mouseMode&VR)!=0)
14935
- manipCamera.RotateInterest(speed, 0);
15115
+ manipCamera.RotateInterest(speed*manipCamera.shaper_fovy/90, 0);
1493615116 else
14937
- manipCamera.RotatePosition(-speed, 0);
15117
+ manipCamera.RotatePosition(-speed*manipCamera.shaper_fovy/90, 0);
1493815118 }
1493915119
1494015120 /**/
14941
- if ((mod & SHIFT) == SHIFT)
14942
- {
14943
- mouseMode = mouseMode;
14944
- } else
14945
- {
14946
- mouseMode |= ROTATE;
14947
- } // TRANSLATE;
15121
+// if ((mod & SHIFT) == SHIFT)
15122
+// {
15123
+// mouseMode = mouseMode;
15124
+// } else
15125
+// {
15126
+// mouseMode |= ROTATE;
15127
+// } // TRANSLATE;
1494815128
1494915129 targetLookAt.set(manipCamera.lookAt);
1495015130
....@@ -15081,6 +15261,11 @@
1508115261 if ((mouseMode & ZOOM) != 0)
1508215262 {
1508315263 //if ((mouseMode & BACKFORTH) != 0)
15264
+ if ((modifiersex & SHIFT) == SHIFT)
15265
+ {
15266
+ ViewAngle(dy);
15267
+ }
15268
+ else
1508415269 if ((mouseMode & VR) != 0)
1508515270 manipCamera.BackForth(dx, dy, getWidth());
1508615271 else
....@@ -15151,6 +15336,9 @@
1515115336
1515215337 public void mouseMoved(MouseEvent e)
1515315338 {
15339
+//object.editWindow.frame.
15340
+ setCursor(Cursor.getDefaultCursor());
15341
+
1515415342 //System.out.println("mouseMoved: " + e);
1515515343 if (isRenderer)
1515615344 return;
....@@ -15350,7 +15538,8 @@
1535015538 {
1535115539 mouseMode |= SELECT;
1535215540 }
15353
- if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
15541
+ if (//(modifiersex & SHIFT) == SHIFT ||
15542
+ forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1535415543 {
1535515544 mouseMode &= ~VR;
1535615545 mouseMode |= TRANSLATE;
....@@ -15394,8 +15583,18 @@
1539415583 float SATPOW = 1; // 2; // 0.5f;
1539515584 float BRIPOW = 1; // 0.5f; // 0.5f;
1539615585
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
+
1539715592 public void keyPressed(int key)
1539815593 {
15594
+// Set the blank cursor to the JFrame.
15595
+//object.editWindow.frame.
15596
+ setCursor(blankCursor);
15597
+
1539915598 if (key >= '0' && key <= '5')
1540015599 clampbit = (key-'0');
1540115600
....@@ -15712,6 +15911,16 @@
1571215911 break;
1571315912 case 'l':
1571415913 lightMode ^= true;
15914
+ if (lightMode)
15915
+ {
15916
+ keepshadow = Globals.RENDERSHADOW;
15917
+ Globals.RENDERSHADOW = false;
15918
+ }
15919
+ else
15920
+ {
15921
+ Globals.RENDERSHADOW = keepshadow;
15922
+ }
15923
+
1571515924 Globals.lighttouched = true;
1571615925 manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
1571715926 targetLookAt.set(manipCamera.lookAt);
....@@ -15761,6 +15970,10 @@
1576115970 case ENTER:
1576215971 // object.editWindow.ScreenFit(); // Edit();
1576315972 ToggleLive();
15973
+ if (capsLocked)
15974
+ {
15975
+ Globals.WALK ^= true;
15976
+ }
1576415977 break;
1576515978 case DELETE:
1576615979 ClearSelection();
....@@ -15797,17 +16010,23 @@
1579716010 object.GetWindow().refreshContents(true);
1579816011 break;
1579916012 case '{':
15800
- manipCamera.shaper_fovy /= 1.1;
16013
+ double factor = 1.1;
16014
+ if (manipCamera.shaper_fovy / factor > 0.1)
16015
+ manipCamera.shaper_fovy /= factor;
1580116016 System.out.println("FOV = " + manipCamera.shaper_fovy);
1580216017 repaint();
1580316018 break;
1580416019 case '}':
15805
- manipCamera.shaper_fovy *= 1.1;
16020
+ factor = 1.1;
16021
+ if (manipCamera.shaper_fovy * factor < 150)
16022
+ manipCamera.shaper_fovy *= factor;
1580616023 System.out.println("FOV = " + manipCamera.shaper_fovy);
1580716024 repaint();
1580816025 break;
1580916026 case '[':
15810
- manipCamera.shaper_fovy /= 1.01;
16027
+ factor = 1.01;
16028
+ if (manipCamera.shaper_fovy / factor > 0.1)
16029
+ manipCamera.shaper_fovy /= factor;
1581116030 if (false) //manipCamera.hAspect == 0)
1581216031 {
1581316032 double x = Math.tan(manipCamera.shaper_fovy * Math.PI / 180 / 2);
....@@ -15823,7 +16042,9 @@
1582316042 break;
1582416043 case ']':
1582516044 //manipCamera.shaper_fovy += (180 - manipCamera.shaper_fovy)*0.1;
15826
- manipCamera.shaper_fovy *= 1.01;
16045
+ factor = 1.01;
16046
+ if (manipCamera.shaper_fovy * factor < 150)
16047
+ manipCamera.shaper_fovy *= factor;
1582716048 if (false) //manipCamera.hAspect == 0)
1582816049 {
1582916050 double x = Math.tan(manipCamera.shaper_fovy * Math.PI / 180 / 2);
....@@ -15862,6 +16083,7 @@
1586216083 }
1586316084
1586416085 boolean keys[] = new boolean[256];
16086
+ int speedkey[] = new int[256];
1586516087 int modifiers = 0;
1586616088
1586716089 public void processKeyEvent(KeyEvent e)
....@@ -16542,7 +16764,8 @@
1654216764
1654316765 public boolean mouseDrag(Event evt, int x, int y)
1654416766 {
16545
- //System.out.println("mouseDrag: " + evt);
16767
+ System.out.println("mouseDrag: " + evt);
16768
+ System.exit(0);
1654616769 /*
1654716770 drag = true;
1654816771 //System.out.println("Mouse DRAG");
....@@ -16661,6 +16884,7 @@
1666116884 public boolean mouseUp(Event evt, int x, int y)
1666216885 {
1666316886 System.out.println("mouseUp: " + evt);
16887
+ System.exit(0);
1666416888 /*
1666516889 locked = false;
1666616890 if (isRenderer)
....@@ -17368,7 +17592,7 @@
1736817592
1736917593 float depth = depths[y * TEX_SIZE + x];
1737017594
17371
- if (pointselection && mouseMode == SELECT && depth != 0 && depth != 1)
17595
+ if (pointselection && (mouseMode & SELECT) == SELECT && depth != 0 && depth != 1)
1737217596 {
1737317597 pointselection = false;
1737417598
....@@ -18033,7 +18257,9 @@
1803318257 boolean OCCLUSION_CULLING = false; //true;
1803418258 public boolean lightMode = false;
1803518259
18036
- public boolean capsLocked = false; // VR
18260
+ private boolean keepshadow;
18261
+
18262
+ static public boolean capsLocked = false; // VR
1803718263
1803818264 static public int indexcount = 0;
1803918265 /*static*/ cColor vertexOcclusion = new cColor();