.. | .. |
---|
150 | 150 | defaultcaps.setAccumAlphaBits(16); |
---|
151 | 151 | } |
---|
152 | 152 | |
---|
153 | | - static CameraPane theRenderer; |
---|
154 | | - |
---|
155 | 153 | void SetAsGLRenderer(boolean b) |
---|
156 | 154 | { |
---|
157 | 155 | isRenderer = b; |
---|
158 | | - theRenderer = this; |
---|
| 156 | + Globals.theRenderer = this; |
---|
159 | 157 | } |
---|
160 | 158 | |
---|
161 | 159 | CameraPane(Object3D o, Camera cam, boolean withcontext) |
---|
.. | .. |
---|
192 | 190 | } |
---|
193 | 191 | |
---|
194 | 192 | /// INTERFACE |
---|
| 193 | + |
---|
| 194 | + public javax.media.opengl.GL GetGL0() |
---|
| 195 | + { |
---|
| 196 | + return null; |
---|
| 197 | + } |
---|
| 198 | + |
---|
| 199 | + public int GenList() |
---|
| 200 | + { |
---|
| 201 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 202 | + return gl.glGenLists(1); |
---|
| 203 | + } |
---|
| 204 | + |
---|
| 205 | + public void NewList(int id) |
---|
| 206 | + { |
---|
| 207 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 208 | + gl.glNewList(id, gl.GL_COMPILE); //_AND_EXECUTE); |
---|
| 209 | + } |
---|
| 210 | + |
---|
| 211 | + public void CallList(int id) |
---|
| 212 | + { |
---|
| 213 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 214 | + gl.glCallList(id); |
---|
| 215 | + } |
---|
| 216 | + |
---|
| 217 | + public void EndList() |
---|
| 218 | + { |
---|
| 219 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 220 | + gl.glEndList(); |
---|
| 221 | + } |
---|
195 | 222 | |
---|
196 | 223 | public boolean IsBoxMode() |
---|
197 | 224 | { |
---|
.. | .. |
---|
816 | 843 | |
---|
817 | 844 | if ((i % 100) == 0 && i != 0) |
---|
818 | 845 | { |
---|
819 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 846 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
820 | 847 | //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
821 | 848 | System.out.println((int) (100.0 * i / (br.positions.length / 3)) + "% (" + i + " of " + (br.positions.length / 3) + ")"); |
---|
822 | 849 | } |
---|
.. | .. |
---|
848 | 875 | |
---|
849 | 876 | if ((i % 100) == 0 && i != 0) |
---|
850 | 877 | { |
---|
851 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 878 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
852 | 879 | //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
853 | 880 | System.out.println((int) (100.0 * i / br.VertexCount()) + "% (" + i + " of " + br.VertexCount() + ")"); |
---|
854 | 881 | } |
---|
.. | .. |
---|
1061 | 1088 | gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
1062 | 1089 | } |
---|
1063 | 1090 | |
---|
| 1091 | + public void DrawBox(cVector min, cVector max) |
---|
| 1092 | + { |
---|
| 1093 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 1094 | + gl.glBegin(gl.GL_LINES); |
---|
| 1095 | + |
---|
| 1096 | + gl.glVertex3d(min.x, min.y, min.z); |
---|
| 1097 | + gl.glVertex3d(min.x, min.y, max.z); |
---|
| 1098 | + gl.glVertex3d(min.x, min.y, min.z); |
---|
| 1099 | + gl.glVertex3d(min.x, max.y, min.z); |
---|
| 1100 | + gl.glVertex3d(min.x, min.y, min.z); |
---|
| 1101 | + gl.glVertex3d(max.x, min.y, min.z); |
---|
| 1102 | + |
---|
| 1103 | + gl.glVertex3d(max.x, max.y, max.z); |
---|
| 1104 | + gl.glVertex3d(min.x, max.y, max.z); |
---|
| 1105 | + gl.glVertex3d(max.x, max.y, max.z); |
---|
| 1106 | + gl.glVertex3d(max.x, min.y, max.z); |
---|
| 1107 | + gl.glVertex3d(max.x, max.y, max.z); |
---|
| 1108 | + gl.glVertex3d(max.x, max.y, min.z); |
---|
| 1109 | + |
---|
| 1110 | + gl.glEnd(); |
---|
| 1111 | + } |
---|
| 1112 | + |
---|
| 1113 | + public void DrawGeometry(BoundaryRep bRep, boolean flipV, boolean selectmode) |
---|
| 1114 | + { |
---|
| 1115 | + int[] strips = bRep.getRawIndices(); |
---|
| 1116 | + |
---|
| 1117 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 1118 | + |
---|
| 1119 | + // TRIANGLE STRIP ARRAY |
---|
| 1120 | + if (bRep.trimmed) |
---|
| 1121 | + { |
---|
| 1122 | + float[] v = bRep.getRawVertices(); |
---|
| 1123 | + float[] n = bRep.getRawNormals(); |
---|
| 1124 | + float[] c = bRep.getRawColors(); |
---|
| 1125 | + float[] uv = bRep.getRawUVMap(); |
---|
| 1126 | + |
---|
| 1127 | + int count2 = 0; |
---|
| 1128 | + int count3 = 0; |
---|
| 1129 | + |
---|
| 1130 | + if (n.length > 0) |
---|
| 1131 | + { |
---|
| 1132 | + for (int i = 0; i < strips.length; i++) |
---|
| 1133 | + { |
---|
| 1134 | + gl.glBegin(gl.GL_TRIANGLE_STRIP); |
---|
| 1135 | + |
---|
| 1136 | + /* |
---|
| 1137 | + boolean locked = false; |
---|
| 1138 | + float eps = 0.1f; |
---|
| 1139 | + boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice |
---|
| 1140 | + |
---|
| 1141 | + int dot = 0; |
---|
| 1142 | + |
---|
| 1143 | + if ((dot&1) == 0) |
---|
| 1144 | + dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1; |
---|
| 1145 | + |
---|
| 1146 | + if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) |
---|
| 1147 | + gl.glTexCoord2f((float) qv.s, (float) qv.t); |
---|
| 1148 | + else |
---|
| 1149 | + { |
---|
| 1150 | + locked = true; |
---|
| 1151 | + gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
| 1152 | + } |
---|
| 1153 | + //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z); |
---|
| 1154 | + gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z); |
---|
| 1155 | + if (hasnorm) |
---|
| 1156 | + { |
---|
| 1157 | + //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z); |
---|
| 1158 | + gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z); |
---|
| 1159 | + } |
---|
| 1160 | + |
---|
| 1161 | + if ((dot&4) == 0) |
---|
| 1162 | + dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4; |
---|
| 1163 | + |
---|
| 1164 | + if (wrap || !locked && (dot&8) != 0) |
---|
| 1165 | + gl.glTexCoord2f((float) rv.s, (float) rv.t); |
---|
| 1166 | + else |
---|
| 1167 | + gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
| 1168 | + |
---|
| 1169 | + f.dot = dot; |
---|
| 1170 | + */ |
---|
| 1171 | + |
---|
| 1172 | + if (!selectmode) |
---|
| 1173 | + { |
---|
| 1174 | + if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
| 1175 | + { |
---|
| 1176 | + gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
| 1177 | + } else |
---|
| 1178 | + { |
---|
| 1179 | + gl.glNormal3f(0, 0, 1); |
---|
| 1180 | + } |
---|
| 1181 | + |
---|
| 1182 | + if (c != null) |
---|
| 1183 | + //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]); |
---|
| 1184 | + { |
---|
| 1185 | + gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
| 1186 | + } |
---|
| 1187 | + } |
---|
| 1188 | + if (flipV) |
---|
| 1189 | + gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
| 1190 | + else |
---|
| 1191 | + gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1192 | + //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
| 1193 | + gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 1194 | + |
---|
| 1195 | + count2 += 2; |
---|
| 1196 | + count3 += 3; |
---|
| 1197 | + if (!selectmode) |
---|
| 1198 | + { |
---|
| 1199 | + if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
| 1200 | + { |
---|
| 1201 | + gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
| 1202 | + } else |
---|
| 1203 | + { |
---|
| 1204 | + gl.glNormal3f(0, 0, 1); |
---|
| 1205 | + } |
---|
| 1206 | + if (c != null) |
---|
| 1207 | + { |
---|
| 1208 | + gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
| 1209 | + } |
---|
| 1210 | + } |
---|
| 1211 | + if (flipV) |
---|
| 1212 | + gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
| 1213 | + else |
---|
| 1214 | + gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1215 | + //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
| 1216 | + gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 1217 | + |
---|
| 1218 | + count2 += 2; |
---|
| 1219 | + count3 += 3; |
---|
| 1220 | + for (int j = 0; j < strips[i] - 2; j++) |
---|
| 1221 | + { |
---|
| 1222 | + //gl.glTexCoord2d(...); |
---|
| 1223 | + if (!selectmode) |
---|
| 1224 | + { |
---|
| 1225 | + if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
| 1226 | + { |
---|
| 1227 | + gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
| 1228 | + } else |
---|
| 1229 | + { |
---|
| 1230 | + gl.glNormal3f(0, 0, 1); |
---|
| 1231 | + } |
---|
| 1232 | + if (c != null) |
---|
| 1233 | + { |
---|
| 1234 | + gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
| 1235 | + } |
---|
| 1236 | + } |
---|
| 1237 | + |
---|
| 1238 | + if (flipV) |
---|
| 1239 | + gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
| 1240 | + else |
---|
| 1241 | + gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
| 1242 | + //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]); |
---|
| 1243 | + gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
| 1244 | + count2 += 2; |
---|
| 1245 | + count3 += 3; |
---|
| 1246 | + } |
---|
| 1247 | + |
---|
| 1248 | + gl.glEnd(); |
---|
| 1249 | + } |
---|
| 1250 | + } |
---|
| 1251 | + |
---|
| 1252 | + assert count3 == v.length; |
---|
| 1253 | + } |
---|
| 1254 | + else // !trimmed |
---|
| 1255 | + { |
---|
| 1256 | + int count = 0; |
---|
| 1257 | + for (int i = 0; i < strips.length; i++) |
---|
| 1258 | + { |
---|
| 1259 | + gl.glBegin(gl.GL_TRIANGLE_STRIP); |
---|
| 1260 | + |
---|
| 1261 | + Vertex p = bRep.GetVertex(bRep.indices[count++]); |
---|
| 1262 | + Vertex q = bRep.GetVertex(bRep.indices[count++]); |
---|
| 1263 | + |
---|
| 1264 | + drawVertex(gl, p, flipV, selectmode); |
---|
| 1265 | + drawVertex(gl, q, flipV, selectmode); |
---|
| 1266 | + |
---|
| 1267 | + for (int j = 0; j < strips[i] - 2; j++) |
---|
| 1268 | + { |
---|
| 1269 | + Vertex r = bRep.GetVertex(bRep.indices[count++]); |
---|
| 1270 | + |
---|
| 1271 | + // if (j%2 == 0) |
---|
| 1272 | + // drawFace(p, q, r, display, null); |
---|
| 1273 | + // else |
---|
| 1274 | + // drawFace(p, r, q, display, null); |
---|
| 1275 | + |
---|
| 1276 | + // p = q; |
---|
| 1277 | + // q = r; |
---|
| 1278 | + drawVertex(gl, r, flipV, selectmode); |
---|
| 1279 | + } |
---|
| 1280 | + |
---|
| 1281 | + gl.glEnd(); |
---|
| 1282 | + } |
---|
| 1283 | + } |
---|
| 1284 | + } |
---|
| 1285 | + |
---|
| 1286 | + static cSpring.Point3D temp = new cSpring.Point3D(); |
---|
| 1287 | + static cSpring.Point3D temp2 = new cSpring.Point3D(); |
---|
| 1288 | + static cSpring.Point3D temp3 = new cSpring.Point3D(); |
---|
| 1289 | + |
---|
| 1290 | + public void DrawDynamicMesh(cMesh mesh) |
---|
| 1291 | + { |
---|
| 1292 | + GL gl = GetGL(); // getGL(); |
---|
| 1293 | + |
---|
| 1294 | + cSpring.PhysicsController3D Phys = mesh.Phys; |
---|
| 1295 | + |
---|
| 1296 | + gl.glDisable(gl.GL_LIGHTING); |
---|
| 1297 | + |
---|
| 1298 | + gl.glLineWidth(1); |
---|
| 1299 | + gl.glColor3f(1,1,1); |
---|
| 1300 | + gl.glBegin(gl.GL_LINES); |
---|
| 1301 | + double scale = 0; |
---|
| 1302 | + int count = 0; |
---|
| 1303 | + for (int s=0; s<Phys.allSprings.size(); s++) |
---|
| 1304 | + { |
---|
| 1305 | + cSpring.Spring spring = Phys.allSprings.get(s); |
---|
| 1306 | + if(s == 0) |
---|
| 1307 | + { |
---|
| 1308 | + //System.out.println(" spring : " + spring.a.position + "; " + spring.b.position); |
---|
| 1309 | + } |
---|
| 1310 | + if (mesh.showsprings) |
---|
| 1311 | + { |
---|
| 1312 | + temp.set(spring.a.position); |
---|
| 1313 | + temp.add(spring.b.position); |
---|
| 1314 | + temp.mul(0.5); |
---|
| 1315 | + temp2.set(spring.a.position); |
---|
| 1316 | + temp2.sub(spring.b.position); |
---|
| 1317 | + temp2.mul(spring.restLength/2); |
---|
| 1318 | + temp.sub(temp2); |
---|
| 1319 | + gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z); |
---|
| 1320 | + temp.add(temp2); |
---|
| 1321 | + temp.add(temp2); |
---|
| 1322 | + gl.glVertex3f((float)temp.x, (float)temp.y, (float)temp.z); |
---|
| 1323 | + } |
---|
| 1324 | + |
---|
| 1325 | + if (spring.isHandle) |
---|
| 1326 | + continue; |
---|
| 1327 | + |
---|
| 1328 | + //if (scale < spring.restLength) |
---|
| 1329 | + scale += spring.restLength; |
---|
| 1330 | + count++; |
---|
| 1331 | + } |
---|
| 1332 | + gl.glEnd(); |
---|
| 1333 | + |
---|
| 1334 | + if (count == 0) |
---|
| 1335 | + scale = 0.01; |
---|
| 1336 | + else |
---|
| 1337 | + scale /= count * 3; |
---|
| 1338 | + |
---|
| 1339 | + //scale = 0.25; |
---|
| 1340 | + |
---|
| 1341 | + if (mesh.ShowInfo()) |
---|
| 1342 | + { |
---|
| 1343 | + gl.glLineWidth(4); |
---|
| 1344 | + for (int s=0; s<Phys.allNodes.size(); s++) |
---|
| 1345 | + { |
---|
| 1346 | + cSpring.DynamicNode node = Phys.allNodes.get(s); |
---|
| 1347 | + if (node.mass == 0) |
---|
| 1348 | + continue; |
---|
| 1349 | + |
---|
| 1350 | + int i = node.springs==null?-1:node.springs.size(); |
---|
| 1351 | + gl.glColor3f((i>>2)&1,(i>>1)&1,i&1); |
---|
| 1352 | + //temp.set(node.springForce.x, node.springForce.y, node.springForce.z); |
---|
| 1353 | + //temp.normalize(); |
---|
| 1354 | + //gl.glColor3d((temp.x+1)/2, (temp.y+1)/2, (temp.z+1)/2); |
---|
| 1355 | + gl.glBegin(gl.GL_LINES); |
---|
| 1356 | + gl.glVertex3d(node.position.x, node.position.y, node.position.z); |
---|
| 1357 | + //gl.glVertex3d(node.position.x + node.normal.x*scale, node.position.y + node.normal.y*scale, node.position.z + node.normal.z*scale); |
---|
| 1358 | + gl.glVertex3d(node.position.x + mesh.bRep.GetVertex(s).norm.x*scale, |
---|
| 1359 | + node.position.y + mesh.bRep.GetVertex(s).norm.y*scale, |
---|
| 1360 | + node.position.z + mesh.bRep.GetVertex(s).norm.z*scale); |
---|
| 1361 | + gl.glEnd(); |
---|
| 1362 | + } |
---|
| 1363 | + |
---|
| 1364 | + gl.glLineWidth(8); |
---|
| 1365 | + for (int s=0; s<Phys.allNodes.size(); s++) |
---|
| 1366 | + { |
---|
| 1367 | + cSpring.DynamicNode node = Phys.allNodes.get(s); |
---|
| 1368 | + |
---|
| 1369 | + if (node.springs != null) |
---|
| 1370 | + { |
---|
| 1371 | + for (int i=0; i<node.springs.size(); i+=1) |
---|
| 1372 | + { |
---|
| 1373 | + cSpring.DynamicNode f = node.springs.get(i).GetOther(node); |
---|
| 1374 | + |
---|
| 1375 | + int c = i+1; |
---|
| 1376 | + // c = node.springs.get(i).nbcopies; |
---|
| 1377 | + |
---|
| 1378 | + gl.glColor3f((c>>2)&1,(c>>1)&1,c&1); |
---|
| 1379 | + gl.glBegin(gl.GL_LINES); |
---|
| 1380 | + gl.glVertex3d(node.position.x, node.position.y, node.position.z); |
---|
| 1381 | + 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); |
---|
| 1382 | + gl.glEnd(); |
---|
| 1383 | + } |
---|
| 1384 | + } |
---|
| 1385 | + } |
---|
| 1386 | + |
---|
| 1387 | + gl.glLineWidth(1); |
---|
| 1388 | + } |
---|
| 1389 | + |
---|
| 1390 | + gl.glEnable(gl.GL_LIGHTING); |
---|
| 1391 | + } |
---|
| 1392 | + |
---|
1064 | 1393 | /// INTERFACE |
---|
| 1394 | + |
---|
| 1395 | + public void StartTriangles() |
---|
| 1396 | + { |
---|
| 1397 | + javax.media.opengl.GL gl = GetGL(); |
---|
| 1398 | + gl.glBegin(gl.GL_TRIANGLES); |
---|
| 1399 | + } |
---|
| 1400 | + |
---|
| 1401 | + public void EndTriangles() |
---|
| 1402 | + { |
---|
| 1403 | + GetGL().glEnd(); |
---|
| 1404 | + } |
---|
| 1405 | + |
---|
| 1406 | + void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean flipV, boolean selectmode) |
---|
| 1407 | + { |
---|
| 1408 | + if (!selectmode) |
---|
| 1409 | + { |
---|
| 1410 | + gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z); |
---|
| 1411 | + gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
| 1412 | + |
---|
| 1413 | + if (flipV) |
---|
| 1414 | + gl.glTexCoord2f((float) pv.s, 1-(float) pv.t); |
---|
| 1415 | + else |
---|
| 1416 | + gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
| 1417 | + } |
---|
| 1418 | + |
---|
| 1419 | + gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z); |
---|
| 1420 | + } |
---|
1065 | 1421 | |
---|
1066 | 1422 | void SetColor(Object3D obj, Vertex p0) |
---|
1067 | 1423 | { |
---|
.. | .. |
---|
1624 | 1980 | |
---|
1625 | 1981 | static int camerachangeframe; |
---|
1626 | 1982 | |
---|
1627 | | - boolean SetCamera(Camera cam) |
---|
| 1983 | + public boolean SetCamera(Camera cam) |
---|
1628 | 1984 | { |
---|
1629 | 1985 | // may 2014 if (cam == cameras[0] || cam == cameras[1]) |
---|
1630 | 1986 | // return false; |
---|
.. | .. |
---|
1752 | 2108 | mainDL ^= true; |
---|
1753 | 2109 | } |
---|
1754 | 2110 | |
---|
1755 | | - void ToggleTexture() |
---|
| 2111 | + void ToggleFullScreen() |
---|
| 2112 | + { |
---|
| 2113 | + FULLSCREEN ^= true; |
---|
| 2114 | + } |
---|
| 2115 | + |
---|
| 2116 | + void ToggleCrowd() |
---|
| 2117 | + { |
---|
| 2118 | + Globals.CROWD ^= true; |
---|
| 2119 | + } |
---|
| 2120 | + |
---|
| 2121 | + void ToggleLocal() |
---|
| 2122 | + { |
---|
| 2123 | + LOCALTRANSFORM ^= true; |
---|
| 2124 | + } |
---|
| 2125 | + |
---|
| 2126 | + public void ToggleTexture() |
---|
1756 | 2127 | { |
---|
1757 | 2128 | textureon ^= true; |
---|
1758 | 2129 | } |
---|
1759 | 2130 | |
---|
1760 | | - void ToggleLive() |
---|
| 2131 | + public void ToggleLive() |
---|
1761 | 2132 | { |
---|
1762 | 2133 | Globals.setLIVE(Globals.isLIVE() ^ true); |
---|
1763 | 2134 | |
---|
.. | .. |
---|
1769 | 2140 | repaint(); // start loop // may 2013 |
---|
1770 | 2141 | } |
---|
1771 | 2142 | |
---|
1772 | | - void ToggleSupport() |
---|
| 2143 | + public void ToggleSupport() |
---|
1773 | 2144 | { |
---|
1774 | 2145 | SUPPORT ^= true; |
---|
1775 | 2146 | } |
---|
1776 | 2147 | |
---|
1777 | | - void ToggleAbort() |
---|
| 2148 | + public void ToggleAbort() |
---|
1778 | 2149 | { |
---|
1779 | 2150 | ABORTMODE ^= true; |
---|
1780 | 2151 | } |
---|
1781 | 2152 | |
---|
1782 | | - void ToggleFullScreen() |
---|
1783 | | - { |
---|
1784 | | - FULLSCREEN ^= true; |
---|
1785 | | - } |
---|
1786 | | - |
---|
1787 | | - void ToggleCrowd() |
---|
1788 | | - { |
---|
1789 | | - Globals.CROWD ^= true; |
---|
1790 | | - } |
---|
1791 | | - |
---|
1792 | | - void ToggleInertia() |
---|
| 2153 | + public void ToggleInertia() |
---|
1793 | 2154 | { |
---|
1794 | 2155 | INERTIA ^= true; |
---|
1795 | 2156 | } |
---|
1796 | 2157 | |
---|
1797 | | - void ToggleLocal() |
---|
1798 | | - { |
---|
1799 | | - LOCALTRANSFORM ^= true; |
---|
1800 | | - } |
---|
1801 | | - |
---|
1802 | | - void ToggleFast() |
---|
| 2158 | + public void ToggleFast() |
---|
1803 | 2159 | { |
---|
1804 | 2160 | FAST ^= true; |
---|
1805 | 2161 | } |
---|
1806 | 2162 | |
---|
1807 | | - void ToggleSlowPose() |
---|
| 2163 | + public void ToggleSlowPose() |
---|
1808 | 2164 | { |
---|
1809 | 2165 | SLOWPOSE ^= true; |
---|
1810 | 2166 | } |
---|
1811 | 2167 | |
---|
1812 | | - void ToggleFootContact() |
---|
1813 | | - { |
---|
1814 | | - FOOTCONTACT ^= true; |
---|
1815 | | - } |
---|
1816 | | - |
---|
1817 | | - void ToggleBoxMode() |
---|
| 2168 | + public void ToggleBoxMode() |
---|
1818 | 2169 | { |
---|
1819 | 2170 | BOXMODE ^= true; |
---|
1820 | 2171 | } |
---|
1821 | 2172 | |
---|
1822 | | - void ToggleSmoothFocus() |
---|
| 2173 | + public void ToggleSmoothFocus() |
---|
1823 | 2174 | { |
---|
1824 | 2175 | SMOOTHFOCUS ^= true; |
---|
1825 | 2176 | } |
---|
1826 | 2177 | |
---|
1827 | | - void ToggleImageFlip() |
---|
| 2178 | + public void ToggleImageFlip() |
---|
1828 | 2179 | { |
---|
1829 | 2180 | IMAGEFLIP ^= true; |
---|
1830 | 2181 | } |
---|
1831 | 2182 | |
---|
1832 | | - void ToggleSpeakerMocap() |
---|
| 2183 | + public void ToggleSpeakerMocap() |
---|
1833 | 2184 | { |
---|
1834 | 2185 | SPEAKERMOCAP ^= true; |
---|
1835 | 2186 | } |
---|
1836 | 2187 | |
---|
1837 | | - void ToggleSpeakerCamera() |
---|
| 2188 | + public void ToggleSpeakerCamera() |
---|
1838 | 2189 | { |
---|
1839 | 2190 | SPEAKERCAMERA ^= true; |
---|
1840 | 2191 | } |
---|
1841 | 2192 | |
---|
1842 | | - void ToggleSpeakerFocus() |
---|
| 2193 | + public void ToggleSpeakerFocus() |
---|
1843 | 2194 | { |
---|
1844 | 2195 | SPEAKERFOCUS ^= true; |
---|
1845 | 2196 | } |
---|
1846 | 2197 | |
---|
1847 | | - void ToggleDebug() |
---|
1848 | | - { |
---|
1849 | | - DEBUG ^= true; |
---|
1850 | | - } |
---|
1851 | | - |
---|
1852 | | - void ToggleFrustum() |
---|
| 2198 | + public void ToggleFrustum() |
---|
1853 | 2199 | { |
---|
1854 | 2200 | FRUSTUM ^= true; |
---|
1855 | 2201 | } |
---|
1856 | 2202 | |
---|
1857 | | - void ToggleTrack() |
---|
| 2203 | + public void ToggleTrack() |
---|
1858 | 2204 | { |
---|
1859 | 2205 | TRACK ^= true; |
---|
1860 | 2206 | if (TRACK) |
---|
.. | .. |
---|
1873 | 2219 | repaint(); |
---|
1874 | 2220 | } |
---|
1875 | 2221 | |
---|
1876 | | - void ToggleTrackOnce() |
---|
| 2222 | + public void ToggleTrackOnce() |
---|
1877 | 2223 | { |
---|
1878 | 2224 | TRACKONCE ^= true; |
---|
1879 | 2225 | } |
---|
1880 | 2226 | |
---|
1881 | | - void ToggleShadowTrack() |
---|
| 2227 | + public void ToggleShadowTrack() |
---|
1882 | 2228 | { |
---|
1883 | 2229 | SHADOWTRACK ^= true; |
---|
1884 | 2230 | repaint(); |
---|
1885 | 2231 | } |
---|
1886 | 2232 | |
---|
1887 | | - void ToggleOeil() |
---|
| 2233 | + public void ToggleOeil() |
---|
1888 | 2234 | { |
---|
1889 | 2235 | OEIL ^= true; |
---|
1890 | 2236 | } |
---|
1891 | 2237 | |
---|
1892 | | - void ToggleOeilOnce() |
---|
| 2238 | + public void ToggleOeilOnce() |
---|
1893 | 2239 | { |
---|
1894 | 2240 | OEILONCE ^= true; |
---|
| 2241 | + } |
---|
| 2242 | + |
---|
| 2243 | + void ToggleFootContact() |
---|
| 2244 | + { |
---|
| 2245 | + FOOTCONTACT ^= true; |
---|
| 2246 | + } |
---|
| 2247 | + |
---|
| 2248 | + void ToggleDebug() |
---|
| 2249 | + { |
---|
| 2250 | + DEBUG ^= true; |
---|
1895 | 2251 | } |
---|
1896 | 2252 | |
---|
1897 | 2253 | void ToggleLookAt() |
---|
.. | .. |
---|
7953 | 8309 | return texture!=null?texture.texture:null; |
---|
7954 | 8310 | } |
---|
7955 | 8311 | |
---|
7956 | | - com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
| 8312 | + public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
7957 | 8313 | { |
---|
7958 | 8314 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
7959 | 8315 | |
---|
.. | .. |
---|
14153 | 14509 | SetMouseMode(modifiers); |
---|
14154 | 14510 | } |
---|
14155 | 14511 | |
---|
14156 | | - theRenderer.keyPressed(key); |
---|
| 14512 | + Globals.theRenderer.keyPressed(key); |
---|
14157 | 14513 | } |
---|
14158 | 14514 | |
---|
14159 | 14515 | int kompactbit = 4; // power bit |
---|
.. | .. |
---|
14165 | 14521 | float SATPOW = 1; // 2; // 0.5f; |
---|
14166 | 14522 | float BRIPOW = 1; // 0.5f; // 0.5f; |
---|
14167 | 14523 | |
---|
14168 | | - void keyPressed(int key) |
---|
| 14524 | + public void keyPressed(int key) |
---|
14169 | 14525 | { |
---|
14170 | 14526 | if (key >= '0' && key <= '5') |
---|
14171 | 14527 | clampbit = (key-'0'); |
---|
.. | .. |
---|
14602 | 14958 | } |
---|
14603 | 14959 | //System.out.println("shaper_fovy = " + manipCamera.shaper_fovy); |
---|
14604 | 14960 | } |
---|
| 14961 | + |
---|
14605 | 14962 | static double OCCLUSIONBOOST = 1; // 0.5; |
---|
14606 | 14963 | |
---|
14607 | 14964 | void keyReleased(int key, int modifiers) |
---|
.. | .. |
---|
14613 | 14970 | } |
---|
14614 | 14971 | } |
---|
14615 | 14972 | |
---|
14616 | | - protected void processKeyEvent(KeyEvent e) |
---|
| 14973 | + public void processKeyEvent(KeyEvent e) |
---|
14617 | 14974 | { |
---|
14618 | 14975 | switch (e.getID()) |
---|
14619 | 14976 | { |
---|
.. | .. |
---|
16696 | 17053 | static IntBuffer textbuffer = null; // IntBuffer.allocate(TEXT_WIDTH*8*8 * TEXT_HEIGHT); |
---|
16697 | 17054 | // Depth buffer format |
---|
16698 | 17055 | //private int depth_format; |
---|
16699 | | - static public void NextIndex(Object3D o, GL gl) |
---|
| 17056 | + |
---|
| 17057 | + public void NextIndex() |
---|
16700 | 17058 | { |
---|
16701 | 17059 | indexcount+=16; |
---|
16702 | | - gl.glColor3d(((indexcount >>> 16) & 255) / 255.0, ((indexcount >>> 8) & 255) / 255.0, ((indexcount) & 255) / 255.0); |
---|
| 17060 | + GetGL().glColor3d(((indexcount >>> 16) & 255) / 255.0, ((indexcount >>> 8) & 255) / 255.0, ((indexcount) & 255) / 255.0); |
---|
16703 | 17061 | //objects[indexcount] = o; |
---|
16704 | 17062 | //System.out.println("indexcount = " + indexcount); |
---|
16705 | 17063 | } |
---|