Normand Briere
2019-10-04 57c5b6cd8d12ffdaa3e0b099451e3c031012750a
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.*;
....@@ -123,7 +124,7 @@
123124 static boolean LOCALTRANSFORM = false;
124125 static boolean FULLSCREEN = false;
125126 static boolean SUPPORT = true;
126
-static boolean INERTIA = true;
127
+static boolean INERTIA = false; // true;
127128 static boolean FAST = false;
128129 static boolean SLOWPOSE = false;
129130 static boolean FOOTCONTACT = true;
....@@ -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)));
....@@ -249,7 +250,7 @@
249250
250251 public javax.media.opengl.GL GetGL0()
251252 {
252
- return null;
253
+ return currentGL;
253254 }
254255
255256 public int GenList()
....@@ -1529,7 +1530,7 @@
15291530 }
15301531 }
15311532 float b = 0;
1532
- if (obj.support != null && obj.link2master)
1533
+ if (obj.support != null && obj.Link2Support())
15331534 {
15341535 b = 1;
15351536 }
....@@ -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(),
....@@ -10765,7 +10761,9 @@
1076510761 }
1076610762 /**/
1076710763
10768
- if (selection)
10764
+ boolean control = ((modifiers & CTRL) != 0);
10765
+
10766
+ if (selection && (!Globals.isLIVE() || control))
1076910767 {
1077010768 selectbuffer.display();
1077110769 return;
....@@ -10908,6 +10906,12 @@
1090810906 }
1090910907 else
1091010908 speedkey[RIGHT_ARROW] = 0;
10909
+
10910
+ if (Globals.WALK && capsLocked)
10911
+ {
10912
+ Walk();
10913
+ keyon = true;
10914
+ }
1091110915
1091210916 if (keyon)
1091310917 {
....@@ -11506,7 +11510,8 @@
1150611510 {
1150711511 boolean vr = capsLocked && !lightMode;
1150811512
11509
- glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 2 : 1), ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance());
11513
+ glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 1.2 : 1),
11514
+ ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance());
1151011515 }
1151111516 }
1151211517
....@@ -11862,8 +11867,11 @@
1186211867 repaint();
1186311868 }
1186411869
11865
- if (Globals.isLIVE() && DrawMode() == DEFAULT) // may 2013
11870
+ if (Globals.isLIVE() && DrawMode() == DEFAULT || pingthread.live) // may 2013
11871
+ {
11872
+ renderCamera.computeTransform();
1186611873 repaint();
11874
+ }
1186711875
1186811876 displaydone = true;
1186911877 }
....@@ -11938,9 +11946,23 @@
1193811946 //GL gl = getGL();
1193911947 if ((TRACK || SHADOWTRACK) || zoomonce)
1194011948 {
11949
+ if (TRACK)
11950
+ {
11951
+ if (object.selection != null &&
11952
+ object.selection.size() > 0 &&
11953
+ object.selection.elementAt(0) != null &&
11954
+ !(object.selection.elementAt(0) instanceof Camera) &&
11955
+ !(object.selection.elementAt(0) instanceof ScriptNode))
11956
+ {
11957
+ trackedobject = object.selection.elementAt(0);
11958
+ //repaint();
11959
+ }
11960
+ else
11961
+ trackedobject = null;
11962
+ }
1194111963 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
1194211964 object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11943
- pingthread.StepToTarget(true); // true);
11965
+ pingthread.StepToTarget(); // true);
1194411966 // zoomonce = false;
1194511967 }
1194611968
....@@ -14321,6 +14343,7 @@
1432114343 public void mouseClicked(MouseEvent e)
1432214344 {
1432314345 System.out.println("mouseClicked: " + e);
14346
+ System.exit(0);
1432414347 }
1432514348
1432614349 public void mousePressed(MouseEvent e)
....@@ -14405,7 +14428,7 @@
1440514428 //}
1440614429
1440714430 SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
14408
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
14431
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, e.getModifiers(), e.getModifiersEx());
1440914432 anchorX = ax;
1441014433 anchorY = ay;
1441114434 prevX = px;
....@@ -14500,8 +14523,9 @@
1450014523 // fev 2014???
1450114524 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
1450214525 object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
14503
- pingthread.StepToTarget(true); // true);
14526
+ pingthread.StepToTarget(); // true);
1450414527 }
14528
+
1450514529 // if (!LIVE)
1450614530 super.repaint();
1450714531 }
....@@ -14596,8 +14620,8 @@
1459614620
1459714621 //if (drawing)
1459814622 //return;
14599
- if ((e.getModifiersEx() & CTRL) != 0
14600
- || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
14623
+ if ((e.getModifiersEx() & CTRL) != 0 ||
14624
+ (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1460114625 {
1460214626 //System.out.println("mouseDragged: " + e);
1460314627 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
....@@ -14621,11 +14645,17 @@
1462114645 return targetLookAt;
1462214646 }
1462314647
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
+
1462414653 class PingThread extends Thread
1462514654 {
1462614655 boolean jump;
14656
+ boolean live;
1462714657
14628
- boolean mute;
14658
+ boolean mute = false;
1462914659
1463014660 // void JumpToTarget()
1463114661 // {
....@@ -14641,8 +14671,94 @@
1464114671 // only one thread!? synchronized
1464214672 void StepToTarget(boolean jump)
1464314673 {
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
+ // System.err.println("selected point = " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][1]) + " " + Trunk(selectedpoint.toParent[3][2]));
14683
+ CreateSelectedPoint();
14684
+
14685
+ RigidBody.pos.x = (float)selectedpoint.toParent[3][0];
14686
+ RigidBody.pos.y = (float)selectedpoint.toParent[3][1];
14687
+ RigidBody.pos.z = (float)selectedpoint.toParent[3][2];
14688
+
14689
+ RigidBody.wind.set(RigidBody.pos);
14690
+ RigidBody.wind.x -= (float)manipCamera.location.x;
14691
+ RigidBody.wind.y -= (float)manipCamera.location.y;
14692
+ RigidBody.wind.z -= (float)manipCamera.location.z;
14693
+ RigidBody.wind.normalize();
14694
+ }
14695
+
1464414696 if (mute)
1464514697 return;
14698
+
14699
+ if (capsLocked && manipCamera.viewCode == 0)
14700
+ {
14701
+ eye.x = manipCamera.location.x;
14702
+ eye.y = manipCamera.location.y + 0.25;
14703
+ eye.z = manipCamera.location.z;
14704
+
14705
+ dir.y = -1;
14706
+
14707
+ Ray ray = new Ray(eye, dir);
14708
+
14709
+ IntersectResult res = new IntersectResult();
14710
+ res.t = Double.POSITIVE_INFINITY;
14711
+
14712
+ tmp.set(targetLookAt);
14713
+ tmp.sub(manipCamera.location);
14714
+
14715
+ double dist = tmp.length();
14716
+
14717
+ tmp.normalize();
14718
+
14719
+ eye2.x = manipCamera.location.x + tmp.x * 0.25;
14720
+ eye2.y = manipCamera.location.y + 0.25;
14721
+ eye2.z = manipCamera.location.z + tmp.z * 0.25;
14722
+
14723
+ Ray ray2 = new Ray(eye2, dir);
14724
+
14725
+ IntersectResult res2 = new IntersectResult();
14726
+ res2.t = Double.POSITIVE_INFINITY;
14727
+
14728
+ if (object.intersect(ray, res) && object.intersect(ray2, res2) && Math.abs(res.t - res2.t) < 0.25)
14729
+ {
14730
+ //tmp.set(manipCamera.location);
14731
+
14732
+ manipCamera.location.x = ray.eyePoint.x + ray.viewDirection.x * res.t;
14733
+ manipCamera.location.y = ray.eyePoint.y + ray.viewDirection.y * res.t + 0.5;
14734
+ manipCamera.location.z = ray.eyePoint.z + ray.viewDirection.z * res.t;
14735
+
14736
+ //tmp.sub(manipCamera.location);
14737
+
14738
+ targetLookAt.x = ray2.eyePoint.x + ray2.viewDirection.x * res2.t;
14739
+ targetLookAt.y = ray2.eyePoint.y + ray2.viewDirection.y * res2.t + 0.5;
14740
+ targetLookAt.z = ray2.eyePoint.z + ray2.viewDirection.z * res2.t;
14741
+
14742
+ targetLookAt.sub(manipCamera.location);
14743
+ targetLookAt.normalize();
14744
+ targetLookAt.mul(dist);
14745
+ targetLookAt.add(manipCamera.location);
14746
+
14747
+ //if (tmp.dot(tmp) > 0.000001)
14748
+ // System.out.println("INTERSECTION " + manipCamera.location);
14749
+
14750
+ manipCamera.lookAt.set(targetLookAt);
14751
+
14752
+ tmp.x = res.n.x;
14753
+ tmp.y = res.n.y;
14754
+ tmp.z = res.n.z;
14755
+ tmp.x += res2.n.x;
14756
+ tmp.y += res2.n.y;
14757
+ tmp.z += res2.n.z;
14758
+ tmp.normalize();
14759
+ manipCamera.UP.set(tmp);
14760
+ }
14761
+ }
1464614762
1464714763 tmp.set(targetLookAt);
1464814764 tmp.sub(manipCamera.lookAt); // june 2014
....@@ -14681,7 +14797,7 @@
1468114797
1468214798 if (tmp.dot(tmp) > 1) // may 2014. far away: jump to target
1468314799 {
14684
- jump = true; // step = 1;
14800
+ // sep 2019 jump = true; // step = 1;
1468514801 }
1468614802
1468714803 if (OEILONCE && OEIL)
....@@ -14716,7 +14832,10 @@
1471614832 if (tmp.dot(tmp) < 0.00001)
1471714833 {
1471814834 zoomonce = false;
14835
+ live = false;
1471914836 }
14837
+ else
14838
+ live = true;
1472014839
1472114840 tmp.mul(step > step2 ? step : step2);
1472214841 }
....@@ -14743,7 +14862,7 @@
1474314862 {
1474414863 if (LOOKAT)
1474514864 manipCamera.lookAt.add(tmp);
14746
- if (OEIL)
14865
+ if (OEIL && !capsLocked)
1474714866 manipCamera.location.add(tmp);
1474814867
1474914868 {
....@@ -14758,7 +14877,10 @@
1475814877 lightCamera.computeTransform();
1475914878 }
1476014879 }
14761
- manipCamera.computeTransform();
14880
+ if (tmp.x != 0 || tmp.y != 0 || tmp.z != 0)
14881
+ {
14882
+ manipCamera.computeTransform();
14883
+ }
1476214884 }
1476314885 // ?????? mouseDown = true;
1476414886 //System.out.println("---------------- ---------- Paint " + tmp.length2());
....@@ -14855,8 +14977,28 @@
1485514977 PingThread pingthread = new PingThread();
1485614978 int delta = 1;
1485714979 int speed = 1;
14980
+ int walk = 8;
1485814981 boolean autorepeat = false;
1485914982
14983
+ void Walk()
14984
+ {
14985
+ manipCamera.BackForth(0, walk, 1000);
14986
+
14987
+ targetLookAt.set(manipCamera.lookAt);
14988
+ }
14989
+
14990
+ void ViewAngle(float dy)
14991
+ {
14992
+ double factor = Math.exp(-dy/300.0); // (1 + dy/100);
14993
+
14994
+ if (manipCamera.shaper_fovy * factor > 1 &&
14995
+ manipCamera.shaper_fovy * factor < 150)
14996
+ {
14997
+ manipCamera.shaper_fovy *= factor;
14998
+ //System.out.println("fovy = " + shaper_fovy);
14999
+ }
15000
+ }
15001
+
1486015002 void GoDown(int mod)
1486115003 {
1486215004 MODIFIERS |= COMMAND;
....@@ -14867,6 +15009,9 @@
1486715009 // if (isVR)
1486815010 // manipCamera.RotateInterest(0, speed);
1486915011 // else
15012
+ if (isVR)
15013
+ ViewAngle(-speed*delta);
15014
+ else
1487015015 manipCamera.Translate(0, -speed*delta, getWidth());
1487115016 }
1487215017 else
....@@ -14894,6 +15039,8 @@
1489415039
1489515040 void GoUp(int mod)
1489615041 {
15042
+ RigidBody.justclicked = true;
15043
+
1489715044 MODIFIERS |= COMMAND;
1489815045 /**/
1489915046 boolean isVR = (mouseMode&VR)!=0;
....@@ -14903,6 +15050,9 @@
1490315050 // if (isVR)
1490415051 // manipCamera.RotateInterest(0, -speed);
1490515052 // else
15053
+ if (isVR)
15054
+ ViewAngle(speed*delta);
15055
+ else
1490615056 manipCamera.Translate(0, speed*delta, getWidth());
1490715057 }
1490815058 else
....@@ -14933,13 +15083,13 @@
1493315083 MODIFIERS |= COMMAND;
1493415084 /**/
1493515085 if((mod&SHIFT) == SHIFT)
14936
- manipCamera.Translate(speed*delta, 0, getWidth());
15086
+ manipCamera.Translate(speed, 0, getWidth());
1493715087 else
1493815088 {
1493915089 if ((mouseMode&VR)!=0)
14940
- manipCamera.RotateInterest(-speed, 0);
15090
+ manipCamera.RotateInterest(-speed*manipCamera.shaper_fovy/90, 0);
1494115091 else
14942
- manipCamera.RotatePosition(speed, 0);
15092
+ manipCamera.RotatePosition(speed*manipCamera.shaper_fovy/90, 0);
1494315093 }
1494415094
1494515095 /**/
....@@ -14965,13 +15115,13 @@
1496515115 MODIFIERS |= COMMAND;
1496615116 /**/
1496715117 if((mod&SHIFT) == SHIFT)
14968
- manipCamera.Translate(-speed*delta, 0, getWidth());
15118
+ manipCamera.Translate(-speed, 0, getWidth());
1496915119 else
1497015120 {
1497115121 if ((mouseMode&VR)!=0)
14972
- manipCamera.RotateInterest(speed, 0);
15122
+ manipCamera.RotateInterest(speed*manipCamera.shaper_fovy/90, 0);
1497315123 else
14974
- manipCamera.RotatePosition(-speed, 0);
15124
+ manipCamera.RotatePosition(-speed*manipCamera.shaper_fovy/90, 0);
1497515125 }
1497615126
1497715127 /**/
....@@ -15118,6 +15268,11 @@
1511815268 if ((mouseMode & ZOOM) != 0)
1511915269 {
1512015270 //if ((mouseMode & BACKFORTH) != 0)
15271
+ if ((modifiersex & SHIFT) == SHIFT)
15272
+ {
15273
+ ViewAngle(dy);
15274
+ }
15275
+ else
1512115276 if ((mouseMode & VR) != 0)
1512215277 manipCamera.BackForth(dx, dy, getWidth());
1512315278 else
....@@ -15188,6 +15343,9 @@
1518815343
1518915344 public void mouseMoved(MouseEvent e)
1519015345 {
15346
+//object.editWindow.frame.
15347
+ setCursor(Cursor.getDefaultCursor());
15348
+
1519115349 //System.out.println("mouseMoved: " + e);
1519215350 if (isRenderer)
1519315351 return;
....@@ -15216,6 +15374,12 @@
1521615374
1521715375 public void mouseReleased(MouseEvent e)
1521815376 {
15377
+ if (isRenderer && !movingcamera)
15378
+ {
15379
+ RigidBody.justclicked = true;
15380
+ System.out.println("justclicked: " + e);
15381
+ }
15382
+
1521915383 Globals.MOUSEDRAGGED = false;
1522015384
1522115385 movingcamera = false;
....@@ -15432,8 +15596,18 @@
1543215596 float SATPOW = 1; // 2; // 0.5f;
1543315597 float BRIPOW = 1; // 0.5f; // 0.5f;
1543415598
15599
+static BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
15600
+
15601
+// Create a new blank cursor.
15602
+static Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor(
15603
+ cursorImg, new Point(0, 0), "blank cursor");
15604
+
1543515605 public void keyPressed(int key)
1543615606 {
15607
+// Set the blank cursor to the JFrame.
15608
+//object.editWindow.frame.
15609
+ setCursor(blankCursor);
15610
+
1543715611 if (key >= '0' && key <= '5')
1543815612 clampbit = (key-'0');
1543915613
....@@ -15750,6 +15924,16 @@
1575015924 break;
1575115925 case 'l':
1575215926 lightMode ^= true;
15927
+ if (lightMode)
15928
+ {
15929
+ keepshadow = Globals.RENDERSHADOW;
15930
+ Globals.RENDERSHADOW = false;
15931
+ }
15932
+ else
15933
+ {
15934
+ Globals.RENDERSHADOW = keepshadow;
15935
+ }
15936
+
1575315937 Globals.lighttouched = true;
1575415938 manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
1575515939 targetLookAt.set(manipCamera.lookAt);
....@@ -15799,6 +15983,10 @@
1579915983 case ENTER:
1580015984 // object.editWindow.ScreenFit(); // Edit();
1580115985 ToggleLive();
15986
+ if (capsLocked)
15987
+ {
15988
+ Globals.WALK ^= true;
15989
+ }
1580215990 break;
1580315991 case DELETE:
1580415992 ClearSelection();
....@@ -15835,17 +16023,23 @@
1583516023 object.GetWindow().refreshContents(true);
1583616024 break;
1583716025 case '{':
15838
- manipCamera.shaper_fovy /= 1.1;
16026
+ double factor = 1.1;
16027
+ if (manipCamera.shaper_fovy / factor > 0.1)
16028
+ manipCamera.shaper_fovy /= factor;
1583916029 System.out.println("FOV = " + manipCamera.shaper_fovy);
1584016030 repaint();
1584116031 break;
1584216032 case '}':
15843
- manipCamera.shaper_fovy *= 1.1;
16033
+ factor = 1.1;
16034
+ if (manipCamera.shaper_fovy * factor < 150)
16035
+ manipCamera.shaper_fovy *= factor;
1584416036 System.out.println("FOV = " + manipCamera.shaper_fovy);
1584516037 repaint();
1584616038 break;
1584716039 case '[':
15848
- manipCamera.shaper_fovy /= 1.01;
16040
+ factor = 1.01;
16041
+ if (manipCamera.shaper_fovy / factor > 0.1)
16042
+ manipCamera.shaper_fovy /= factor;
1584916043 if (false) //manipCamera.hAspect == 0)
1585016044 {
1585116045 double x = Math.tan(manipCamera.shaper_fovy * Math.PI / 180 / 2);
....@@ -15861,7 +16055,9 @@
1586116055 break;
1586216056 case ']':
1586316057 //manipCamera.shaper_fovy += (180 - manipCamera.shaper_fovy)*0.1;
15864
- manipCamera.shaper_fovy *= 1.01;
16058
+ factor = 1.01;
16059
+ if (manipCamera.shaper_fovy * factor < 150)
16060
+ manipCamera.shaper_fovy *= factor;
1586516061 if (false) //manipCamera.hAspect == 0)
1586616062 {
1586716063 double x = Math.tan(manipCamera.shaper_fovy * Math.PI / 180 / 2);
....@@ -16581,7 +16777,8 @@
1658116777
1658216778 public boolean mouseDrag(Event evt, int x, int y)
1658316779 {
16584
- //System.out.println("mouseDrag: " + evt);
16780
+ System.out.println("mouseDrag: " + evt);
16781
+ System.exit(0);
1658516782 /*
1658616783 drag = true;
1658716784 //System.out.println("Mouse DRAG");
....@@ -16700,6 +16897,7 @@
1670016897 public boolean mouseUp(Event evt, int x, int y)
1670116898 {
1670216899 System.out.println("mouseUp: " + evt);
16900
+ System.exit(0);
1670316901 /*
1670416902 locked = false;
1670516903 if (isRenderer)
....@@ -16970,7 +17168,7 @@
1697017168 return;
1697117169 }
1697217170
16973
- if (WIREFRAME)
17171
+ //if (WIREFRAME)
1697417172 gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
1697517173
1697617174 gl.glDisable(gl.GL_CULL_FACE);
....@@ -17070,6 +17268,8 @@
1707017268
1707117269 if (WIREFRAME)
1707217270 gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE);
17271
+ else
17272
+ gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
1707317273 }
1707417274
1707517275 private void DrawChecker(GL gl)
....@@ -17407,7 +17607,7 @@
1740717607
1740817608 float depth = depths[y * TEX_SIZE + x];
1740917609
17410
- if (pointselection && mouseMode == SELECT && depth != 0 && depth != 1)
17610
+ if (pointselection && (mouseMode & SELECT) == SELECT && depth != 0 && depth != 1)
1741117611 {
1741217612 pointselection = false;
1741317613
....@@ -18072,7 +18272,9 @@
1807218272 boolean OCCLUSION_CULLING = false; //true;
1807318273 public boolean lightMode = false;
1807418274
18075
- public boolean capsLocked = false; // VR
18275
+ private boolean keepshadow;
18276
+
18277
+ static public boolean capsLocked = false; // VR
1807618278
1807718279 static public int indexcount = 0;
1807818280 /*static*/ cColor vertexOcclusion = new cColor();