Normand Briere
2019-10-04 57c5b6cd8d12ffdaa3e0b099451e3c031012750a
Fix lighttouched
11 files modified
195 ■■■■ changed files
BoundaryRep.java 4 ●●●● patch | view | raw | blame | history
CameraPane.java 2 ●●● patch | view | raw | blame | history
Cone.java 4 ●●●● patch | view | raw | blame | history
Globals.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 13 ●●●●● patch | view | raw | blame | history
Mocap.java 2 ●●●●● patch | view | raw | blame | history
ObjEditor.java 149 ●●●● patch | view | raw | blame | history
Object3D.java 9 ●●●●● patch | view | raw | blame | history
PhysicsNode.java 4 ●●● patch | view | raw | blame | history
SwitchEditor.java 2 ●●●●● patch | view | raw | blame | history
SwitchNode.java 4 ●●●● patch | view | raw | blame | history
BoundaryRep.java
....@@ -2004,8 +2004,8 @@
20042004
20052005 // Warning: faster but dangerous
20062006 if (v.weights != null && v.weights[j]
2007
- == 0)
2008
- //< 0.001 * v.totalweight)
2007
+ == 0)
2008
+ // < 0.001 * v.totalweight)
20092009 {
20102010 //testweight += v.weights[j-1];
20112011 continue;
CameraPane.java
....@@ -124,7 +124,7 @@
124124 static boolean LOCALTRANSFORM = false;
125125 static boolean FULLSCREEN = false;
126126 static boolean SUPPORT = true;
127
-static boolean INERTIA = true;
127
+static boolean INERTIA = false; // true;
128128 static boolean FAST = false;
129129 static boolean SLOWPOSE = false;
130130 static boolean FOOTCONTACT = true;
Cone.java
....@@ -17,7 +17,7 @@
1717 retile();
1818 base = LA.newVector(0, 0, 0); // -1);
1919 apex = LA.newVector(0, 1, 0); // 1);
20
- baseRadius = apexRadius = 0.5; // 0.125;
20
+ baseRadius = apexRadius = 0.6369; // == 0.5 * 4/3.14 // 0.5; // 0.125;
2121 //fromStandard = new double[4][4];
2222 //toStandard = new double[4][4];
2323 //LA.matIdentity(fromStandard);
....@@ -196,7 +196,7 @@
196196
197197 double uStretch()
198198 {
199
- return 3; // Actually 3.14 (I think)
199
+ return 4; // 3; // Actually 3.14 (I think)
200200 }
201201
202202 double vFlip(double v)
Globals.java
....@@ -19,7 +19,7 @@
1919 // Option to set saturation to 1 when choosing a color first
2020 public static boolean AUTOSATURATE = true;
2121 public static boolean MINSHADER = false;
22
- public static boolean COMPUTESHADOWWHENLIVE = true;
22
+ public static boolean COMPUTESHADOWWHENLIVE = false; // true;
2323 public static boolean RENDERSHADOW = true;
2424
2525 public static boolean REPLACEONMAKE = false; // false;
GroupEditor.java
....@@ -1082,7 +1082,7 @@
10821082 // });
10831083
10841084 oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1085
- fullScreenButton.setToolTipText("Full-screen window");
1085
+ fullScreenButton.setToolTipText("Full-screen window (ESC to exit)");
10861086 fullScreenButton.addActionListener(this);
10871087
10881088 oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
....@@ -1411,10 +1411,10 @@
14111411
14121412 panel.Return();
14131413
1414
- if (Globals.ADVANCED)
1414
+ //if (Globals.ADVANCED)
14151415 {
14161416 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1417
- crowdCB.setToolTipText("Used for crowds");
1417
+ crowdCB.setToolTipText("Use for crowds");
14181418 crowdCB.addItemListener(this);
14191419 }
14201420
....@@ -1444,11 +1444,11 @@
14441444 panel.Return();
14451445 }
14461446
1447
+ panel.Return();
1448
+
14471449 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
14481450 smoothfocusCB.addItemListener(this);
14491451
1450
- panel.Return();
1451
-
14521452 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14531453 // debugCB.addItemListener(this);
14541454
....@@ -1460,9 +1460,12 @@
14601460 oeilCB.setToolTipText("Move camera when tracking");
14611461 oeilCB.addItemListener(this);
14621462
1463
+ if (Globals.ADVANCED)
1464
+ {
14631465 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
14641466 shadowCB.setToolTipText("When live compute shadows");
14651467 shadowCB.addItemListener(this);
1468
+ }
14661469
14671470 panel.Return();
14681471 panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
Mocap.java
....@@ -3924,6 +3924,8 @@
39243924 restarted = true;
39253925 //System.err.println("restarted = true");
39263926 Step();
3927
+
3928
+ Globals.lighttouched = true;
39273929 }
39283930 else
39293931 {
ObjEditor.java
....@@ -833,6 +833,11 @@
833833 ScriptNode sn = (ScriptNode) sel;
834834 si.SendInfo(" Script name: " + sn.filename, "regular");
835835 }
836
+ if (sel instanceof SwitchNode)
837
+ {
838
+ SwitchNode sn = (SwitchNode) sel;
839
+ si.SendInfo(" Switch Object: " + sn.switchobject, "regular");
840
+ }
836841
837842 si.SendInfo((debug ? " Path: " : " ") + sel.GetPath(), "regular");
838843
....@@ -1864,6 +1869,52 @@
18641869
18651870 cButton fullsceneButton;
18661871
1872
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/tom.png", !Globals.NIMBUSLAF));
1873
+ fullsceneButton.setToolTipText("Tom!");
1874
+ fullsceneButton.addActionListener(new ActionListener()
1875
+ {
1876
+ @Override
1877
+ public void actionPerformed(ActionEvent e)
1878
+ {
1879
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/tom.gfd", new iCallBack()
1880
+ {
1881
+
1882
+ public void Callback(Object obj)
1883
+ {
1884
+ LoadIt(obj);
1885
+ }
1886
+
1887
+ public void DragGesture()
1888
+ {
1889
+ }
1890
+ });
1891
+ }
1892
+ });
1893
+
1894
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/adameve.png", !Globals.NIMBUSLAF));
1895
+ fullsceneButton.setToolTipText("Adam and Eve!");
1896
+ fullsceneButton.addActionListener(new ActionListener()
1897
+ {
1898
+ @Override
1899
+ public void actionPerformed(ActionEvent e)
1900
+ {
1901
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/adameve.gfd", new iCallBack()
1902
+ {
1903
+
1904
+ public void Callback(Object obj)
1905
+ {
1906
+ LoadIt(obj);
1907
+ }
1908
+
1909
+ public void DragGesture()
1910
+ {
1911
+ }
1912
+ });
1913
+ }
1914
+ });
1915
+
1916
+ fullscenePanel.Return();
1917
+
18671918 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/alsace.png", !Globals.NIMBUSLAF));
18681919 fullsceneButton.setToolTipText("Alsace!");
18691920 fullsceneButton.addActionListener(new ActionListener()
....@@ -2093,86 +2144,17 @@
20932144 });
20942145
20952146 fullscenePanel.Return();
2096
-
2097
- fullscenePanel.add(fullsceneButton = GetButton("fullscenes/tom.png", !Globals.NIMBUSLAF));
2098
- fullsceneButton.setToolTipText("Tom!");
2099
- fullsceneButton.addActionListener(new ActionListener()
2100
- {
2101
- @Override
2102
- public void actionPerformed(ActionEvent e)
2103
- {
2104
- ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/tom.gfd", new iCallBack()
2105
- {
2106
-
2107
- public void Callback(Object obj)
2108
- {
2109
- LoadIt(obj);
2110
- }
2111
-
2112
- public void DragGesture()
2113
- {
2114
- }
2115
- });
2116
- }
2117
- });
2118
-
2119
- fullscenePanel.add(fullsceneButton = GetButton("fullscenes/adameve.png", !Globals.NIMBUSLAF));
2120
- fullsceneButton.setToolTipText("Adam and Eve!");
2121
- fullsceneButton.addActionListener(new ActionListener()
2122
- {
2123
- @Override
2124
- public void actionPerformed(ActionEvent e)
2125
- {
2126
- ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/adameve.gfd", new iCallBack()
2127
- {
2128
-
2129
- public void Callback(Object obj)
2130
- {
2131
- LoadIt(obj);
2132
- }
2133
-
2134
- public void DragGesture()
2135
- {
2136
- }
2137
- });
2138
- }
2139
- });
2140
-
2141
- fullscenePanel.Return();
2142
-
2143
- fullscenePanel.add(new cGridBag());
2144
- fullscenePanel.add(new cGridBag());
2145
-
2147
+
21462148 sceneTabbedPane.add(optionsPanel);
21472149
21482150 scenePanel.add(sceneTabbedPane);
21492151
2152
+ cButton creditButton;
2153
+
21502154 cGridBag creditsPanel = new cGridBag().setVertical(true);
21512155 creditsPanel.setName("Credits");
21522156
2153
- cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
2154
- creditsPanel.add(ogaLabel);
2155
-
2156
- cButton creditButton;
2157
- creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
2158
- creditButton.setToolTipText("https://opengameart.org");
2159
-
2160
- creditButton.addMouseListener(new MouseAdapter()
2161
- {
2162
- public void mouseClicked(MouseEvent e)
2163
- {
2164
- try
2165
- {
2166
- Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
2167
- } catch (Exception e1)
2168
-// } catch (java.io.IOException | java.net.URISyntaxException e1)
2169
- {
2170
- e1.printStackTrace();
2171
- }
2172
- }
2173
- });
2174
-
2175
- ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
2157
+ cLabel ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
21762158 creditsPanel.add(ogaLabel);
21772159
21782160 creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF));
....@@ -2229,6 +2211,27 @@
22292211 }
22302212 });
22312213
2214
+ ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
2215
+ creditsPanel.add(ogaLabel);
2216
+
2217
+ creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
2218
+ creditButton.setToolTipText("https://opengameart.org");
2219
+
2220
+ creditButton.addMouseListener(new MouseAdapter()
2221
+ {
2222
+ public void mouseClicked(MouseEvent e)
2223
+ {
2224
+ try
2225
+ {
2226
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
2227
+ } catch (Exception e1)
2228
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
2229
+ {
2230
+ e1.printStackTrace();
2231
+ }
2232
+ }
2233
+ });
2234
+
22322235 for (int i=6; --i>=0;)
22332236 {
22342237 creditsPanel.add(new cGridBag());
Object3D.java
....@@ -41,7 +41,7 @@
4141
4242 java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
4343
44
- int tabIndex;
44
+ transient int tabIndex; // Tabs can change between sessions.
4545
4646 ScriptNode scriptnode;
4747
....@@ -1142,6 +1142,8 @@
11421142 (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
11431143 currentframe != Globals.framecount)
11441144 {
1145
+ Globals.lighttouched = true;
1146
+
11451147 currentframe = Globals.framecount;
11461148
11471149 // System.err.println("transformcount = " + transformcount);
....@@ -6301,7 +6303,7 @@
63016303
63026304 if (!selectmode && //display.DrawMode() != display.SELECTION &&
63036305 //(touched || (bRep != null && bRep.displaylist <= 0)))
6304
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
6306
+ (Globals.isLIVE() || touched) && Globals.COMPUTESHADOWWHENLIVE) // || (bRep != null && bRep.displaylist <= 0)))
63056307 {
63066308 Globals.lighttouched = true;
63076309 } // all panes...
....@@ -6856,7 +6858,8 @@
68566858
68576859 //javax.media.opengl.GL gl = display.GetGL();
68586860
6859
- if (CameraPane.BOXMODE && !Link2Support()) //selected) // || CameraPane.movingcamera)
6861
+ if (CameraPane.BOXMODE && //!Link2Support()) //
6862
+ !selected) // || CameraPane.movingcamera)
68606863 {
68616864 int fc = bRep.FaceCount();
68626865 int vc = bRep.VertexCount();
PhysicsNode.java
....@@ -113,8 +113,10 @@
113113
114114 void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
115115 {
116
- if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // SHADOW
116
+ if (Globals.isLIVE() && live && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE)) // SHADOW
117117 {
118
+ Globals.lighttouched = true;
119
+
118120 float ms = getDeltaTimeMicroseconds();
119121 float minFPS = 1000000f / 60f;
120122 if (ms > minFPS)
SwitchEditor.java
....@@ -214,6 +214,8 @@
214214 switchnode.speed = speedField.getInteger(); // biparam.minUDivs, 99);
215215 //biparam.name = nameField.getText();
216216
217
+ Globals.lighttouched = true;
218
+
217219 // june 2013 super.applySelf();
218220 if (switchnode.speed != s)
219221 System.out.println("Damp = " + switchnode.speed);
SwitchNode.java
....@@ -57,7 +57,7 @@
5757 parent = super.parent;
5858
5959 }
60
- if (live && Globals.isLIVE() && display.DrawMode() == display.SHADOW)
60
+ if (live && Globals.isLIVE() && (display.DrawMode() == display.SHADOW || !Globals.RENDERSHADOW))
6161 {
6262 if (countspeed <= 0)
6363 {
....@@ -106,7 +106,7 @@
106106 bRep = (BoundaryRep)Grafreed.clone(switchobject.get(0).bRep);
107107 }
108108
109
- if (CameraPane.SUPPORT && display.DrawMode() == display.SHADOW)
109
+ if (CameraPane.SUPPORT && (display.DrawMode() == display.SHADOW || !Globals.RENDERSHADOW))
110110 {
111111 Update();
112112 }