Normand Briere
2019-09-15 d5fac992bb6a91e52a90e8318060f5f26ddab982
Fix navigation and hide cursor.
4 files modified
2 files added
158 ■■■■ changed files
Camera.java 28 ●●●●● patch | view | raw | blame | history
CameraPane.java 29 ●●●● patch | view | raw | blame | history
ObjEditor.java 97 ●●●● patch | view | raw | blame | history
RandomEditor.java 4 ●●● patch | view | raw | blame | history
fullscenes/desertmotel.png patch | view | raw | blame | history
fullscenes/tuscany.png patch | view | raw | blame | history
Camera.java
....@@ -286,24 +286,34 @@
286286 if (scale == 0)
287287 {
288288 // Zoom
289
- LA.vecSub(location, lookAt, location);
290
-
291
- cVector p = location;
292
-
293289 double factor = Math.exp(-dy/300.0); // (1 + dy/100);
294290
295
- p.x *= factor;
296
- p.y *= factor;
297
- p.z *= factor;
291
+ if (viewCode != 0)
292
+ {
293
+ LA.vecSub(location, lookAt, location);
298294
299
- LA.vecAdd(location, lookAt, location);
295
+ cVector p = location;
296
+
297
+ p.x *= factor;
298
+ p.y *= factor;
299
+ p.z *= factor;
300
+
301
+ LA.vecAdd(location, lookAt, location);
302
+ }
303
+ else
304
+ if (//shaper_fovy < 180 && factor > 1 ||
305
+ shaper_fovy * factor < 180)
306
+ {
307
+ shaper_fovy *= factor;
308
+ //System.out.println("fovy = " + shaper_fovy);
309
+ }
300310 }
301311 else
302312 {
303313 LA.vecSub(location, lookAt, direction);
304314
305315 //scale /= Distance();
306
- scale /= shaper_fovy/20;
316
+ // scale /= shaper_fovy/20;
307317
308318 location.x -= dy * direction.x / scale;
309319 //location.y -= dy * direction.y / scale;
CameraPane.java
....@@ -9854,7 +9854,7 @@
98549854
98559855 boolean vr = capsLocked && !lightMode;
98569856
9857
- accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 2 : 1),
9857
+ accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 1.2 : 1),
98589858 ratio,
98599859 //near_plane, far_plane,
98609860 renderCamera.shaper_zNear * renderCamera.Distance(), renderCamera.shaper_zFar * renderCamera.Distance(),
....@@ -11513,7 +11513,8 @@
1151311513 {
1151411514 boolean vr = capsLocked && !lightMode;
1151511515
11516
- glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 2 : 1), ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance());
11516
+ glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 1.2 : 1),
11517
+ ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance());
1151711518 }
1151811519 }
1151911520
....@@ -14603,8 +14604,8 @@
1460314604
1460414605 //if (drawing)
1460514606 //return;
14606
- if ((e.getModifiersEx() & CTRL) != 0
14607
- || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
14607
+ if ((e.getModifiersEx() & CTRL) != 0 ||
14608
+ (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1460814609 {
1460914610 //System.out.println("mouseDragged: " + e);
1461014611 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
....@@ -14750,7 +14751,7 @@
1475014751 {
1475114752 if (LOOKAT)
1475214753 manipCamera.lookAt.add(tmp);
14753
- if (OEIL)
14754
+ if (OEIL && !capsLocked)
1475414755 manipCamera.location.add(tmp);
1475514756
1475614757 {
....@@ -14765,7 +14766,10 @@
1476514766 lightCamera.computeTransform();
1476614767 }
1476714768 }
14768
- manipCamera.computeTransform();
14769
+ if (tmp.x != 0 || tmp.y != 0 || tmp.z != 0)
14770
+ {
14771
+ manipCamera.computeTransform();
14772
+ }
1476914773 }
1477014774 // ?????? mouseDown = true;
1477114775 //System.out.println("---------------- ---------- Paint " + tmp.length2());
....@@ -15195,6 +15199,9 @@
1519515199
1519615200 public void mouseMoved(MouseEvent e)
1519715201 {
15202
+//object.editWindow.frame.
15203
+ setCursor(Cursor.getDefaultCursor());
15204
+
1519815205 //System.out.println("mouseMoved: " + e);
1519915206 if (isRenderer)
1520015207 return;
....@@ -15439,8 +15446,18 @@
1543915446 float SATPOW = 1; // 2; // 0.5f;
1544015447 float BRIPOW = 1; // 0.5f; // 0.5f;
1544115448
15449
+static BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
15450
+
15451
+// Create a new blank cursor.
15452
+static Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor(
15453
+ cursorImg, new Point(0, 0), "blank cursor");
15454
+
1544215455 public void keyPressed(int key)
1544315456 {
15457
+// Set the blank cursor to the JFrame.
15458
+//object.editWindow.frame.
15459
+ setCursor(blankCursor);
15460
+
1544415461 if (key >= '0' && key <= '5')
1544515462 clampbit = (key-'0');
1544615463
ObjEditor.java
....@@ -1875,6 +1875,30 @@
18751875 }
18761876 });
18771877
1878
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/desertmotel.png", !Globals.NIMBUSLAF));
1879
+ fullsceneButton.setToolTipText("Desert Motel!");
1880
+ fullsceneButton.addActionListener(new ActionListener()
1881
+ {
1882
+ @Override
1883
+ public void actionPerformed(ActionEvent e)
1884
+ {
1885
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/DesertMotel.gfd", new iCallBack()
1886
+ {
1887
+
1888
+ public void Callback(Object obj)
1889
+ {
1890
+ LoadIt(obj);
1891
+ }
1892
+
1893
+ public void DragGesture()
1894
+ {
1895
+ }
1896
+ });
1897
+ }
1898
+ });
1899
+
1900
+ fullscenePanel.Return();
1901
+
18781902 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/london.png", !Globals.NIMBUSLAF));
18791903 fullsceneButton.setToolTipText("Old London!");
18801904 fullsceneButton.addActionListener(new ActionListener()
....@@ -1897,8 +1921,52 @@
18971921 }
18981922 });
18991923
1924
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/skullcove.png", !Globals.NIMBUSLAF));
1925
+ fullsceneButton.setToolTipText("Skull Cove Island!");
1926
+ fullsceneButton.addActionListener(new ActionListener()
1927
+ {
1928
+ @Override
1929
+ public void actionPerformed(ActionEvent e)
1930
+ {
1931
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/SkullCoveIsland.gfd", new iCallBack()
1932
+ {
1933
+
1934
+ public void Callback(Object obj)
1935
+ {
1936
+ LoadIt(obj);
1937
+ }
1938
+
1939
+ public void DragGesture()
1940
+ {
1941
+ }
1942
+ });
1943
+ }
1944
+ });
1945
+
19001946 fullscenePanel.Return();
19011947
1948
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/tuscany.png", !Globals.NIMBUSLAF));
1949
+ fullsceneButton.setToolTipText("Tuscany!");
1950
+ fullsceneButton.addActionListener(new ActionListener()
1951
+ {
1952
+ @Override
1953
+ public void actionPerformed(ActionEvent e)
1954
+ {
1955
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/Tuscany.gfd", new iCallBack()
1956
+ {
1957
+
1958
+ public void Callback(Object obj)
1959
+ {
1960
+ LoadIt(obj);
1961
+ }
1962
+
1963
+ public void DragGesture()
1964
+ {
1965
+ }
1966
+ });
1967
+ }
1968
+ });
1969
+
19021970 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/venice.png", !Globals.NIMBUSLAF));
19031971 fullsceneButton.setToolTipText("Venice!");
19041972 fullsceneButton.addActionListener(new ActionListener()
....@@ -1921,6 +1989,8 @@
19211989 }
19221990 });
19231991
1992
+ fullscenePanel.Return();
1993
+
19241994 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/viking.png", !Globals.NIMBUSLAF));
19251995 fullsceneButton.setToolTipText("Viking Village!");
19261996 fullsceneButton.addActionListener(new ActionListener()
....@@ -1943,8 +2013,6 @@
19432013 }
19442014 });
19452015
1946
- fullscenePanel.Return();
1947
-
19482016 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/yvoire.png", !Globals.NIMBUSLAF));
19492017 fullsceneButton.setToolTipText("Yvoire!");
19502018 fullsceneButton.addActionListener(new ActionListener()
....@@ -1967,33 +2035,8 @@
19672035 }
19682036 });
19692037
1970
- fullscenePanel.add(fullsceneButton = GetButton("fullscenes/skullcove.png", !Globals.NIMBUSLAF));
1971
- fullsceneButton.setToolTipText("Skull Cove Island!");
1972
- fullsceneButton.addActionListener(new ActionListener()
1973
- {
1974
- @Override
1975
- public void actionPerformed(ActionEvent e)
1976
- {
1977
- ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/SkullCoveIsland.gfd", new iCallBack()
1978
- {
1979
-
1980
- public void Callback(Object obj)
1981
- {
1982
- LoadIt(obj);
1983
- }
1984
-
1985
- public void DragGesture()
1986
- {
1987
- }
1988
- });
1989
- }
1990
- });
1991
-
19922038 fullscenePanel.Return();
19932039
1994
- fullscenePanel.add(new cGridBag());
1995
- fullscenePanel.add(new cGridBag());
1996
- fullscenePanel.Return();
19972040 fullscenePanel.add(new cGridBag());
19982041 fullscenePanel.add(new cGridBag());
19992042 fullscenePanel.Return();
RandomEditor.java
....@@ -98,7 +98,9 @@
9898 //System.out.println(e);
9999 applySelf();
100100 //super.applySelf();
101
- objEditor.refreshContents();
101
+
102
+ Globals.lighttouched = true;
103
+ objEditor.refreshContents();
102104 //Refresh();
103105 }
104106 else
fullscenes/desertmotel.png
Binary files differ
fullscenes/tuscany.png
Binary files differ