Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
CameraPane.java
....@@ -86,12 +86,14 @@
8686 static boolean FULLSCREEN = false;
8787 static boolean SUPPORT = true;
8888 static boolean INERTIA = true;
89
-static boolean FAST = false;
89
+static boolean FAST = true; // false;
9090 static boolean SLOWPOSE = false;
9191 static boolean FOOTCONTACT = true;
9292
9393 static int tickcount = 0; // slow pose issue
9494
95
+static boolean BUTTONLESSWHEEL = false;
96
+static boolean ZOOMBOXMODE = false;
9597 static boolean BOXMODE = false;
9698 static boolean IMAGEFLIP = false;
9799 static boolean SMOOTHFOCUS = false;
....@@ -150,12 +152,10 @@
150152 defaultcaps.setAccumAlphaBits(16);
151153 }
152154
153
- static CameraPane theRenderer;
154
-
155155 void SetAsGLRenderer(boolean b)
156156 {
157157 isRenderer = b;
158
- theRenderer = this;
158
+ Globals.theRenderer = this;
159159 }
160160
161161 CameraPane(Object3D o, Camera cam, boolean withcontext)
....@@ -193,9 +193,43 @@
193193
194194 /// INTERFACE
195195
196
+ public javax.media.opengl.GL GetGL0()
197
+ {
198
+ return null;
199
+ }
200
+
201
+ public int GenList()
202
+ {
203
+ javax.media.opengl.GL gl = GetGL();
204
+ return gl.glGenLists(1);
205
+ }
206
+
207
+ public void NewList(int id)
208
+ {
209
+ javax.media.opengl.GL gl = GetGL();
210
+ gl.glNewList(id, gl.GL_COMPILE); //_AND_EXECUTE);
211
+ }
212
+
213
+ public void CallList(int id)
214
+ {
215
+ javax.media.opengl.GL gl = GetGL();
216
+ gl.glCallList(id);
217
+ }
218
+
219
+ public void EndList()
220
+ {
221
+ javax.media.opengl.GL gl = GetGL();
222
+ gl.glEndList();
223
+ }
224
+
196225 public boolean IsBoxMode()
197226 {
198227 return BOXMODE;
228
+ }
229
+
230
+ public boolean IsZoomBoxMode()
231
+ {
232
+ return ZOOMBOXMODE;
199233 }
200234
201235 public void ClearDepth()
....@@ -816,7 +850,7 @@
816850
817851 if ((i % 100) == 0 && i != 0)
818852 {
819
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
853
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
820854 //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done");
821855 System.out.println((int) (100.0 * i / (br.positions.length / 3)) + "% (" + i + " of " + (br.positions.length / 3) + ")");
822856 }
....@@ -848,7 +882,7 @@
848882
849883 if ((i % 100) == 0 && i != 0)
850884 {
851
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
885
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
852886 //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done");
853887 System.out.println((int) (100.0 * i / br.VertexCount()) + "% (" + i + " of " + br.VertexCount() + ")");
854888 }
....@@ -1061,7 +1095,336 @@
10611095 gl.glMatrixMode(gl.GL_MODELVIEW);
10621096 }
10631097
1098
+ public void DrawBox(cVector min, cVector max)
1099
+ {
1100
+ javax.media.opengl.GL gl = GetGL();
1101
+ gl.glBegin(gl.GL_LINES);
1102
+
1103
+ gl.glVertex3d(min.x, min.y, min.z);
1104
+ gl.glVertex3d(min.x, min.y, max.z);
1105
+ gl.glVertex3d(min.x, min.y, min.z);
1106
+ gl.glVertex3d(min.x, max.y, min.z);
1107
+ gl.glVertex3d(min.x, min.y, min.z);
1108
+ gl.glVertex3d(max.x, min.y, min.z);
1109
+
1110
+ gl.glVertex3d(max.x, max.y, max.z);
1111
+ gl.glVertex3d(min.x, max.y, max.z);
1112
+ gl.glVertex3d(max.x, max.y, max.z);
1113
+ gl.glVertex3d(max.x, min.y, max.z);
1114
+ gl.glVertex3d(max.x, max.y, max.z);
1115
+ gl.glVertex3d(max.x, max.y, min.z);
1116
+
1117
+ gl.glEnd();
1118
+ }
1119
+
1120
+ public void DrawGeometry(BoundaryRep bRep, boolean flipV, boolean selectmode)
1121
+ {
1122
+ int[] strips = bRep.getRawIndices();
1123
+
1124
+ javax.media.opengl.GL gl = GetGL();
1125
+
1126
+ // TRIANGLE STRIP ARRAY
1127
+ if (bRep.trimmed)
1128
+ {
1129
+ float[] v = bRep.getRawVertices();
1130
+ float[] n = bRep.getRawNormals();
1131
+ float[] c = bRep.getRawColors();
1132
+ float[] uv = bRep.getRawUVMap();
1133
+
1134
+ int count2 = 0;
1135
+ int count3 = 0;
1136
+
1137
+ if (n.length > 0)
1138
+ {
1139
+ for (int i = 0; i < strips.length; i++)
1140
+ {
1141
+ gl.glBegin(gl.GL_TRIANGLE_STRIP);
1142
+
1143
+ /*
1144
+ boolean locked = false;
1145
+ float eps = 0.1f;
1146
+ boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
1147
+
1148
+ int dot = 0;
1149
+
1150
+ if ((dot&1) == 0)
1151
+ dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
1152
+
1153
+ if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
1154
+ gl.glTexCoord2f((float) qv.s, (float) qv.t);
1155
+ else
1156
+ {
1157
+ locked = true;
1158
+ gl.glTexCoord2f((float) pv.s, (float) pv.t);
1159
+ }
1160
+ //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
1161
+ gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
1162
+ if (hasnorm)
1163
+ {
1164
+ //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
1165
+ gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
1166
+ }
1167
+
1168
+ if ((dot&4) == 0)
1169
+ dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
1170
+
1171
+ if (wrap || !locked && (dot&8) != 0)
1172
+ gl.glTexCoord2f((float) rv.s, (float) rv.t);
1173
+ else
1174
+ gl.glTexCoord2f((float) pv.s, (float) pv.t);
1175
+
1176
+ f.dot = dot;
1177
+ */
1178
+
1179
+ if (!selectmode)
1180
+ {
1181
+ if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
1182
+ {
1183
+ gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
1184
+ } else
1185
+ {
1186
+ gl.glNormal3f(0, 0, 1);
1187
+ }
1188
+
1189
+ if (c != null)
1190
+ //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
1191
+ {
1192
+ gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
1193
+ }
1194
+ }
1195
+ if (flipV)
1196
+ gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
1197
+ else
1198
+ gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1199
+ //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
1200
+ gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1201
+
1202
+ count2 += 2;
1203
+ count3 += 3;
1204
+ if (!selectmode)
1205
+ {
1206
+ if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
1207
+ {
1208
+ gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
1209
+ } else
1210
+ {
1211
+ gl.glNormal3f(0, 0, 1);
1212
+ }
1213
+ if (c != null)
1214
+ {
1215
+ gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
1216
+ }
1217
+ }
1218
+ if (flipV)
1219
+ gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
1220
+ else
1221
+ gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1222
+ //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
1223
+ gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1224
+
1225
+ count2 += 2;
1226
+ count3 += 3;
1227
+ for (int j = 0; j < strips[i] - 2; j++)
1228
+ {
1229
+ //gl.glTexCoord2d(...);
1230
+ if (!selectmode)
1231
+ {
1232
+ if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
1233
+ {
1234
+ gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
1235
+ } else
1236
+ {
1237
+ gl.glNormal3f(0, 0, 1);
1238
+ }
1239
+ if (c != null)
1240
+ {
1241
+ gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
1242
+ }
1243
+ }
1244
+
1245
+ if (flipV)
1246
+ gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
1247
+ else
1248
+ gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1249
+ //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
1250
+ gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1251
+ count2 += 2;
1252
+ count3 += 3;
1253
+ }
1254
+
1255
+ gl.glEnd();
1256
+ }
1257
+ }
1258
+
1259
+ assert count3 == v.length;
1260
+ }
1261
+ else // !trimmed
1262
+ {
1263
+ int count = 0;
1264
+ for (int i = 0; i < strips.length; i++)
1265
+ {
1266
+ gl.glBegin(gl.GL_TRIANGLE_STRIP);
1267
+
1268
+ Vertex p = bRep.GetVertex(bRep.indices[count++]);
1269
+ Vertex q = bRep.GetVertex(bRep.indices[count++]);
1270
+
1271
+ drawVertex(gl, p, flipV, selectmode);
1272
+ drawVertex(gl, q, flipV, selectmode);
1273
+
1274
+ for (int j = 0; j < strips[i] - 2; j++)
1275
+ {
1276
+ Vertex r = bRep.GetVertex(bRep.indices[count++]);
1277
+
1278
+ // if (j%2 == 0)
1279
+ // drawFace(p, q, r, display, null);
1280
+ // else
1281
+ // drawFace(p, r, q, display, null);
1282
+
1283
+ // p = q;
1284
+ // q = r;
1285
+ drawVertex(gl, r, flipV, selectmode);
1286
+ }
1287
+
1288
+ gl.glEnd();
1289
+ }
1290
+ }
1291
+ }
1292
+
1293
+ static cSpring.Point3D temp = new cSpring.Point3D();
1294
+ static cSpring.Point3D temp2 = new cSpring.Point3D();
1295
+ static cSpring.Point3D temp3 = new cSpring.Point3D();
1296
+
1297
+ public void DrawDynamicMesh(cMesh mesh)
1298
+ {
1299
+ GL gl = GetGL(); // getGL();
1300
+
1301
+ cSpring.PhysicsController3D Phys = mesh.Phys;
1302
+
1303
+ gl.glDisable(gl.GL_LIGHTING);
1304
+
1305
+ gl.glLineWidth(1);
1306
+ gl.glColor3f(1,1,1);
1307
+ gl.glBegin(gl.GL_LINES);
1308
+ double scale = 0;
1309
+ int count = 0;
1310
+ for (int s=0; s<Phys.allSprings.size(); s++)
1311
+ {
1312
+ cSpring.Spring spring = Phys.allSprings.get(s);
1313
+ if(s == 0)
1314
+ {
1315
+ //System.out.println(" spring : " + spring.a.position + "; " + spring.b.position);
1316
+ }
1317
+ if (mesh.showsprings)
1318
+ {
1319
+ temp.set(spring.a.position);
1320
+ temp.add(spring.b.position);
1321
+ temp.mul(0.5);
1322
+ temp2.set(spring.a.position);
1323
+ temp2.sub(spring.b.position);
1324
+ temp2.mul(spring.restLength/2);
1325
+ temp.sub(temp2);
1326
+ gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z);
1327
+ temp.add(temp2);
1328
+ temp.add(temp2);
1329
+ gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z);
1330
+ }
1331
+
1332
+ if (spring.isHandle)
1333
+ continue;
1334
+
1335
+ //if (scale < spring.restLength)
1336
+ scale += spring.restLength;
1337
+ count++;
1338
+ }
1339
+ gl.glEnd();
1340
+
1341
+ if (count == 0)
1342
+ scale = 0.01;
1343
+ else
1344
+ scale /= count * 3;
1345
+
1346
+ //scale = 0.25;
1347
+
1348
+ if (mesh.ShowInfo())
1349
+ {
1350
+ gl.glLineWidth(4);
1351
+ for (int s=0; s<Phys.allNodes.size(); s++)
1352
+ {
1353
+ cSpring.DynamicNode node = Phys.allNodes.get(s);
1354
+ if (node.mass == 0)
1355
+ continue;
1356
+
1357
+ int i = node.springs==null?-1:node.springs.size();
1358
+ gl.glColor3f((i>>2)&1,(i>>1)&1,i&1);
1359
+ //temp.set(node.springForce.x, node.springForce.y, node.springForce.z);
1360
+ //temp.normalize();
1361
+ //gl.glColor3d((temp.x+1)/2, (temp.y+1)/2, (temp.z+1)/2);
1362
+ gl.glBegin(gl.GL_LINES);
1363
+ gl.glVertex3d(node.position.x, node.position.y, node.position.z);
1364
+ //gl.glVertex3d(node.position.x + node.normal.x*scale, node.position.y + node.normal.y*scale, node.position.z + node.normal.z*scale);
1365
+ gl.glVertex3d(node.position.x + mesh.bRep.GetVertex(s).norm.x*scale,
1366
+ node.position.y + mesh.bRep.GetVertex(s).norm.y*scale,
1367
+ node.position.z + mesh.bRep.GetVertex(s).norm.z*scale);
1368
+ gl.glEnd();
1369
+ }
1370
+
1371
+ gl.glLineWidth(8);
1372
+ for (int s=0; s<Phys.allNodes.size(); s++)
1373
+ {
1374
+ cSpring.DynamicNode node = Phys.allNodes.get(s);
1375
+
1376
+ if (node.springs != null)
1377
+ {
1378
+ for (int i=0; i<node.springs.size(); i+=1)
1379
+ {
1380
+ cSpring.DynamicNode f = node.springs.get(i).GetOther(node);
1381
+
1382
+ int c = i+1;
1383
+ // c = node.springs.get(i).nbcopies;
1384
+
1385
+ gl.glColor3f((c>>2)&1,(c>>1)&1,c&1);
1386
+ gl.glBegin(gl.GL_LINES);
1387
+ gl.glVertex3d(node.position.x, node.position.y, node.position.z);
1388
+ gl.glVertex3d(f.position.x/3+node.position.x*2/3, f.position.y/3+node.position.y*2/3, f.position.z/3+node.position.z*2/3);
1389
+ gl.glEnd();
1390
+ }
1391
+ }
1392
+ }
1393
+
1394
+ gl.glLineWidth(1);
1395
+ }
1396
+
1397
+ gl.glEnable(gl.GL_LIGHTING);
1398
+ }
1399
+
10641400 /// INTERFACE
1401
+
1402
+ public void StartTriangles()
1403
+ {
1404
+ javax.media.opengl.GL gl = GetGL();
1405
+ gl.glBegin(gl.GL_TRIANGLES);
1406
+ }
1407
+
1408
+ public void EndTriangles()
1409
+ {
1410
+ GetGL().glEnd();
1411
+ }
1412
+
1413
+ void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean flipV, boolean selectmode)
1414
+ {
1415
+ if (!selectmode)
1416
+ {
1417
+ gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
1418
+ gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
1419
+
1420
+ if (flipV)
1421
+ gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
1422
+ else
1423
+ gl.glTexCoord2f((float) pv.s, (float) pv.t);
1424
+ }
1425
+
1426
+ gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
1427
+ }
10651428
10661429 void SetColor(Object3D obj, Vertex p0)
10671430 {
....@@ -1256,12 +1619,12 @@
12561619 //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
12571620 if (!material.multiply)
12581621 {
1259
- display.color = color;
1622
+ display.color = material.color;
12601623 display.saturation = material.modulation;
12611624 }
12621625 else
12631626 {
1264
- display.color *= color*2;
1627
+ display.color *= material.color*2;
12651628 display.saturation *= material.modulation*2;
12661629 }
12671630
....@@ -1624,7 +1987,7 @@
16241987
16251988 static int camerachangeframe;
16261989
1627
- boolean SetCamera(Camera cam)
1990
+ public boolean SetCamera(Camera cam)
16281991 {
16291992 // may 2014 if (cam == cameras[0] || cam == cameras[1])
16301993 // return false;
....@@ -1752,12 +2115,27 @@
17522115 mainDL ^= true;
17532116 }
17542117
1755
- void ToggleTexture()
2118
+ void ToggleFullScreen()
2119
+ {
2120
+ FULLSCREEN ^= true;
2121
+ }
2122
+
2123
+ void ToggleCrowd()
2124
+ {
2125
+ Globals.CROWD ^= true;
2126
+ }
2127
+
2128
+ void ToggleLocal()
2129
+ {
2130
+ LOCALTRANSFORM ^= true;
2131
+ }
2132
+
2133
+ public void ToggleTexture()
17562134 {
17572135 textureon ^= true;
17582136 }
17592137
1760
- void ToggleLive()
2138
+ public void ToggleLive()
17612139 {
17622140 Globals.setLIVE(Globals.isLIVE() ^ true);
17632141
....@@ -1769,92 +2147,72 @@
17692147 repaint(); // start loop // may 2013
17702148 }
17712149
1772
- void ToggleSupport()
2150
+ public void ToggleSupport()
17732151 {
17742152 SUPPORT ^= true;
17752153 }
17762154
1777
- void ToggleAbort()
2155
+ public void ToggleAbort()
17782156 {
17792157 ABORTMODE ^= true;
17802158 }
17812159
1782
- void ToggleFullScreen()
1783
- {
1784
- FULLSCREEN ^= true;
1785
- }
1786
-
1787
- void ToggleCrowd()
1788
- {
1789
- Globals.CROWD ^= true;
1790
- }
1791
-
1792
- void ToggleInertia()
2160
+ public void ToggleInertia()
17932161 {
17942162 INERTIA ^= true;
17952163 }
17962164
1797
- void ToggleLocal()
1798
- {
1799
- LOCALTRANSFORM ^= true;
1800
- }
1801
-
1802
- void ToggleFast()
2165
+ public void ToggleFast()
18032166 {
18042167 FAST ^= true;
18052168 }
18062169
1807
- void ToggleSlowPose()
2170
+ public void ToggleSlowPose()
18082171 {
18092172 SLOWPOSE ^= true;
18102173 }
18112174
1812
- void ToggleFootContact()
1813
- {
1814
- FOOTCONTACT ^= true;
1815
- }
1816
-
1817
- void ToggleBoxMode()
2175
+ public void ToggleBoxMode()
18182176 {
18192177 BOXMODE ^= true;
18202178 }
18212179
1822
- void ToggleSmoothFocus()
2180
+ public void ToggleZoomBoxMode()
2181
+ {
2182
+ ZOOMBOXMODE ^= true;
2183
+ }
2184
+
2185
+ public void ToggleSmoothFocus()
18232186 {
18242187 SMOOTHFOCUS ^= true;
18252188 }
18262189
1827
- void ToggleImageFlip()
2190
+ public void ToggleImageFlip()
18282191 {
18292192 IMAGEFLIP ^= true;
18302193 }
18312194
1832
- void ToggleSpeakerMocap()
2195
+ public void ToggleSpeakerMocap()
18332196 {
18342197 SPEAKERMOCAP ^= true;
18352198 }
18362199
1837
- void ToggleSpeakerCamera()
2200
+ public void ToggleSpeakerCamera()
18382201 {
18392202 SPEAKERCAMERA ^= true;
18402203 }
18412204
1842
- void ToggleSpeakerFocus()
2205
+ public void ToggleSpeakerFocus()
18432206 {
18442207 SPEAKERFOCUS ^= true;
18452208 }
18462209
1847
- void ToggleDebug()
1848
- {
1849
- DEBUG ^= true;
1850
- }
1851
-
1852
- void ToggleFrustum()
2210
+ public void ToggleFrustum()
18532211 {
18542212 FRUSTUM ^= true;
18552213 }
18562214
1857
- void ToggleTrack()
2215
+ public void ToggleTrack()
18582216 {
18592217 TRACK ^= true;
18602218 if (TRACK)
....@@ -1873,25 +2231,35 @@
18732231 repaint();
18742232 }
18752233
1876
- void ToggleTrackOnce()
2234
+ public void ToggleTrackOnce()
18772235 {
18782236 TRACKONCE ^= true;
18792237 }
18802238
1881
- void ToggleShadowTrack()
2239
+ public void ToggleShadowTrack()
18822240 {
18832241 SHADOWTRACK ^= true;
18842242 repaint();
18852243 }
18862244
1887
- void ToggleOeil()
2245
+ public void ToggleOeil()
18882246 {
18892247 OEIL ^= true;
18902248 }
18912249
1892
- void ToggleOeilOnce()
2250
+ public void ToggleOeilOnce()
18932251 {
18942252 OEILONCE ^= true;
2253
+ }
2254
+
2255
+ void ToggleFootContact()
2256
+ {
2257
+ FOOTCONTACT ^= true;
2258
+ }
2259
+
2260
+ void ToggleDebug()
2261
+ {
2262
+ DEBUG ^= true;
18952263 }
18962264
18972265 void ToggleLookAt()
....@@ -3840,6 +4208,7 @@
38404208
38414209 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
38424210 {
4211
+ new Exception().printStackTrace();
38434212 System.exit(0);
38444213 com.sun.opengl.util.texture.Texture texture = null;
38454214
....@@ -7953,7 +8322,7 @@
79538322 return texture!=null?texture.texture:null;
79548323 }
79558324
7956
- com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution)
8325
+ public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution)
79578326 {
79588327 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
79598328
....@@ -12379,7 +12748,7 @@
1237912748 "MUL final.y, fragment.texcoord[0].x, c256;" +
1238012749 "FLR final.x, final.y;" +
1238112750 "SUB final.y, final.y, final.x;" +
12382
- "MUL final.x, final.x, c256i;" +
12751
+ //"MUL final.x, final.x, c256i;" +
1238312752 "MOV final.z, zero.x;" +
1238412753 "MOV final.a, one.w;":""
1238512754 ) +
....@@ -12387,7 +12756,7 @@
1238712756 "MUL final.y, fragment.texcoord[0].y, c256;" +
1238812757 "FLR final.x, final.y;" +
1238912758 "SUB final.y, final.y, final.x;" +
12390
- "MUL final.x, final.x, c256i;" +
12759
+ //"MUL final.x, final.x, c256i;" +
1239112760 "MOV final.z, zero.x;" +
1239212761 "MOV final.a, one.w;":""
1239312762 ) +
....@@ -13167,6 +13536,7 @@
1316713536
1316813537 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1316913538
13539
+ if (BUTTONLESSWHEEL)
1317013540 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1317113541 {
1317213542 return;
....@@ -13175,7 +13545,7 @@
1317513545 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1317613546
1317713547 // TIMER
13178
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13548
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1317913549 {
1318013550 keepboxmode = BOXMODE;
1318113551 keepsupport = SUPPORT;
....@@ -13392,11 +13762,11 @@
1339213762
1339313763 public void mouseDragged(MouseEvent e)
1339413764 {
13765
+ //System.out.println("mouseDragged: " + e);
1339513766 if (isRenderer)
1339613767 movingcamera = true;
1339713768 //if (drawing)
1339813769 //return;
13399
- //System.out.println("mouseDragged: " + e);
1340013770 if ((e.getModifiersEx() & CTRL) != 0
1340113771 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1340213772 {
....@@ -13577,6 +13947,7 @@
1357713947
1357813948 public void run()
1357913949 {
13950
+ new Exception().printStackTrace();
1358013951 System.exit(0);
1358113952 for (;;)
1358213953 {
....@@ -13931,7 +14302,6 @@
1393114302 public void mouseMoved(MouseEvent e)
1393214303 {
1393314304 //System.out.println("mouseMoved: " + e);
13934
-
1393514305 if (isRenderer)
1393614306 return;
1393714307
....@@ -14153,7 +14523,7 @@
1415314523 SetMouseMode(modifiers);
1415414524 }
1415514525
14156
- theRenderer.keyPressed(key);
14526
+ Globals.theRenderer.keyPressed(key);
1415714527 }
1415814528
1415914529 int kompactbit = 4; // power bit
....@@ -14165,7 +14535,7 @@
1416514535 float SATPOW = 1; // 2; // 0.5f;
1416614536 float BRIPOW = 1; // 0.5f; // 0.5f;
1416714537
14168
- void keyPressed(int key)
14538
+ public void keyPressed(int key)
1416914539 {
1417014540 if (key >= '0' && key <= '5')
1417114541 clampbit = (key-'0');
....@@ -14602,6 +14972,7 @@
1460214972 }
1460314973 //System.out.println("shaper_fovy = " + manipCamera.shaper_fovy);
1460414974 }
14975
+
1460514976 static double OCCLUSIONBOOST = 1; // 0.5;
1460614977
1460714978 void keyReleased(int key, int modifiers)
....@@ -14613,7 +14984,7 @@
1461314984 }
1461414985 }
1461514986
14616
- protected void processKeyEvent(KeyEvent e)
14987
+ public void processKeyEvent(KeyEvent e)
1461714988 {
1461814989 switch (e.getID())
1461914990 {
....@@ -14743,8 +15114,9 @@
1474315114
1474415115 protected void processMouseMotionEvent(MouseEvent e)
1474515116 {
14746
- //System.out.println("processMouseMotionEvent: " + mouseMode);
14747
- if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15117
+ //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
15118
+ //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15119
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
1474815120 {
1474915121 mouseMoved(e);
1475015122 } else
....@@ -14774,6 +15146,7 @@
1477415146
1477515147 void SelectParent()
1477615148 {
15149
+ new Exception().printStackTrace();
1477715150 System.exit(0);
1477815151 Composite group = (Composite) object;
1477915152 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -14797,6 +15170,7 @@
1479715170
1479815171 void SelectChildren()
1479915172 {
15173
+ new Exception().printStackTrace();
1480015174 System.exit(0);
1480115175 /*
1480215176 Composite group = (Composite) object;
....@@ -15910,6 +16284,7 @@
1591016284 {
1591116285 if (!selection)
1591216286 {
16287
+ new Exception().printStackTrace();
1591316288 System.exit(0);
1591416289 return;
1591516290 }
....@@ -16696,10 +17071,11 @@
1669617071 static IntBuffer textbuffer = null; // IntBuffer.allocate(TEXT_WIDTH*8*8 * TEXT_HEIGHT);
1669717072 // Depth buffer format
1669817073 //private int depth_format;
16699
- static public void NextIndex(Object3D o, GL gl)
17074
+
17075
+ public void NextIndex()
1670017076 {
1670117077 indexcount+=16;
16702
- gl.glColor3d(((indexcount >>> 16) & 255) / 255.0, ((indexcount >>> 8) & 255) / 255.0, ((indexcount) & 255) / 255.0);
17078
+ GetGL().glColor3d(((indexcount >>> 16) & 255) / 255.0, ((indexcount >>> 8) & 255) / 255.0, ((indexcount) & 255) / 255.0);
1670317079 //objects[indexcount] = o;
1670417080 //System.out.println("indexcount = " + indexcount);
1670517081 }