.. | .. |
---|
149 | 149 | defaultcaps.setAccumBlueBits(16); |
---|
150 | 150 | defaultcaps.setAccumAlphaBits(16); |
---|
151 | 151 | } |
---|
152 | | - static CameraPane theRenderer; |
---|
153 | | - |
---|
| 152 | + |
---|
154 | 153 | void SetAsGLRenderer(boolean b) |
---|
155 | 154 | { |
---|
156 | 155 | isRenderer = b; |
---|
157 | | - theRenderer = this; |
---|
| 156 | + Globals.theRenderer = this; |
---|
158 | 157 | } |
---|
159 | 158 | |
---|
160 | 159 | CameraPane(Object3D o, Camera cam, boolean withcontext) |
---|
.. | .. |
---|
236 | 235 | return this.ambientOcclusion; |
---|
237 | 236 | } |
---|
238 | 237 | |
---|
| 238 | + public boolean IsDebugSelection() |
---|
| 239 | + { |
---|
| 240 | + return DEBUG_SELECTION; |
---|
| 241 | + } |
---|
| 242 | + |
---|
239 | 243 | public boolean IsFrozen() |
---|
240 | 244 | { |
---|
241 | | - boolean selectmode = this.DrawMode() == SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 245 | + boolean selectmode = this.DrawMode() == SELECTION || this.IsDebugSelection(); |
---|
242 | 246 | |
---|
243 | 247 | return !selectmode && cameracount == 0; // != 0; |
---|
244 | 248 | } |
---|
.. | .. |
---|
259 | 263 | return lightCamera; |
---|
260 | 264 | } |
---|
261 | 265 | |
---|
| 266 | + public Camera ManipCamera() |
---|
| 267 | + { |
---|
| 268 | + return manipCamera; |
---|
| 269 | + } |
---|
| 270 | + |
---|
262 | 271 | public Camera RenderCamera() |
---|
263 | 272 | { |
---|
264 | 273 | return renderCamera; |
---|
| 274 | + } |
---|
| 275 | + |
---|
| 276 | + public Camera[] Cameras() |
---|
| 277 | + { |
---|
| 278 | + return cameras; |
---|
265 | 279 | } |
---|
266 | 280 | |
---|
267 | 281 | public void PushMaterial(Object3D obj, boolean selected) |
---|
.. | .. |
---|
408 | 422 | |
---|
409 | 423 | javax.media.opengl.GL gl = display.GetGL(); |
---|
410 | 424 | |
---|
411 | | - boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 425 | + boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
412 | 426 | |
---|
413 | 427 | //System.out.println("p = " + pv + "; q = " + qv + "; r = " + rv); |
---|
414 | 428 | if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
.. | .. |
---|
760 | 774 | //// tris.postdraw(this); |
---|
761 | 775 | } |
---|
762 | 776 | |
---|
| 777 | + static Camera localcamera = new Camera(); |
---|
| 778 | + static cVector from = new cVector(); |
---|
| 779 | + static cVector to = new cVector(); |
---|
| 780 | + |
---|
| 781 | + public void PrepOcclusion(BoundaryRep br, double[][] transform) |
---|
| 782 | + { |
---|
| 783 | + CameraPane cp = this; |
---|
| 784 | + |
---|
| 785 | + Camera keep = cp.RenderCamera(); |
---|
| 786 | + cp.renderCamera = localcamera; |
---|
| 787 | + |
---|
| 788 | + if (br.trimmed) |
---|
| 789 | + { |
---|
| 790 | + float[] colors = new float[br.positions.length / 3]; |
---|
| 791 | + |
---|
| 792 | + int i3 = 0; |
---|
| 793 | + for (int i = 0; i < br.positions.length / 3; i++, i3 += 3) |
---|
| 794 | + { |
---|
| 795 | + if (br.normals[i3] == 0 && br.normals[i3+1] == 0 && br.normals[i3+2] == 0) |
---|
| 796 | + continue; |
---|
| 797 | + |
---|
| 798 | + from.set(br.positions[i3], br.positions[i3 + 1], br.positions[i3 + 2]); |
---|
| 799 | + to.set(br.positions[i3] + br.normals[i3], |
---|
| 800 | + br.positions[i3 + 1] + br.normals[i3 + 1], |
---|
| 801 | + br.positions[i3 + 2] + br.normals[i3 + 2]); |
---|
| 802 | + LA.xformPos(from, transform, from); |
---|
| 803 | + LA.xformPos(to, transform, to); // RIGID ONLY |
---|
| 804 | + localcamera.setAim(from, to); |
---|
| 805 | + |
---|
| 806 | + CameraPane.occlusionbuffer.display(); |
---|
| 807 | + |
---|
| 808 | + if (CameraPane.DEBUG_OCCLUSION) |
---|
| 809 | + cp.display(); // debug |
---|
| 810 | + |
---|
| 811 | + colors[i] = cp.vertexOcclusion.r; |
---|
| 812 | + //colors[i3 + 1] = cp.vertexOcclusion.g; |
---|
| 813 | + //colors[i3 + 2] = cp.vertexOcclusion.b; |
---|
| 814 | + |
---|
| 815 | + if ((i % 100) == 0 && i != 0) |
---|
| 816 | + { |
---|
| 817 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 818 | + //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
| 819 | + System.out.println((int) (100.0 * i / (br.positions.length / 3)) + "% (" + i + " of " + (br.positions.length / 3) + ")"); |
---|
| 820 | + } |
---|
| 821 | + } |
---|
| 822 | + |
---|
| 823 | + br.colors = colors; |
---|
| 824 | + } |
---|
| 825 | + else |
---|
| 826 | + { |
---|
| 827 | + for (int i = 0; i < br.VertexCount(); i++) |
---|
| 828 | + { |
---|
| 829 | + Vertex v = br.GetVertex(i); |
---|
| 830 | + |
---|
| 831 | + if (v.norm == null || v.norm.x == 0 && v.norm.y == 0 && v.norm.z == 0) |
---|
| 832 | + continue; |
---|
| 833 | + |
---|
| 834 | + from.set(v.x, v.y, v.z); |
---|
| 835 | + to.set(v.x+v.norm.x, v.y+v.norm.y, v.z+v.norm.z); |
---|
| 836 | + LA.xformPos(from, transform, from); |
---|
| 837 | + LA.xformPos(to, transform, to); // RIGID ONLY |
---|
| 838 | + localcamera.setAim(from, to); |
---|
| 839 | + |
---|
| 840 | + CameraPane.occlusionbuffer.display(); |
---|
| 841 | + |
---|
| 842 | + if (CameraPane.DEBUG_OCCLUSION) |
---|
| 843 | + cp.display(); // debug |
---|
| 844 | + |
---|
| 845 | + v.AO = cp.vertexOcclusion.r; |
---|
| 846 | + |
---|
| 847 | + if ((i % 100) == 0 && i != 0) |
---|
| 848 | + { |
---|
| 849 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 850 | + //System.out.println("Color = " + cp.vertexOcclusion.r + ", " + cp.vertexOcclusion.g + ", " + cp.vertexOcclusion.b + "; " + (int)(100.0*i/(positions.length/3)) + "% done"); |
---|
| 851 | + System.out.println((int) (100.0 * i / br.VertexCount()) + "% (" + i + " of " + br.VertexCount() + ")"); |
---|
| 852 | + } |
---|
| 853 | + } |
---|
| 854 | + } |
---|
| 855 | + |
---|
| 856 | + //System.out.println("done."); |
---|
| 857 | + |
---|
| 858 | + cp.renderCamera = keep; |
---|
| 859 | + } |
---|
| 860 | + |
---|
| 861 | + void DrawPointFLow(PointFlow pointFlow, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 862 | + { |
---|
| 863 | + CameraPane display = this; |
---|
| 864 | + pointFlow.CreateHT(); |
---|
| 865 | + |
---|
| 866 | + float r = display.modelParams0[0]; |
---|
| 867 | + float g = display.modelParams0[1]; |
---|
| 868 | + float b = display.modelParams0[2]; |
---|
| 869 | + float opacity = display.modelParams5[1]; |
---|
| 870 | + |
---|
| 871 | + //final GL gl = GLU.getCurrentGL(); |
---|
| 872 | + GL gl = display.GetGL(); // getGL(); |
---|
| 873 | + |
---|
| 874 | + int s = pointFlow.points.size(); |
---|
| 875 | + |
---|
| 876 | + boolean cf = gl.glIsEnabled(gl.GL_CULL_FACE); |
---|
| 877 | + gl.glEnable(gl.GL_CULL_FACE); |
---|
| 878 | + |
---|
| 879 | + for (int i=s; --i>=0;) |
---|
| 880 | + //for (int i=0; i<s; i++) |
---|
| 881 | + { |
---|
| 882 | + cVector v = pointFlow.points.get(i); |
---|
| 883 | + |
---|
| 884 | + double mindist = Double.MAX_VALUE; |
---|
| 885 | + |
---|
| 886 | + double size = pointFlow.minimumSize; |
---|
| 887 | + |
---|
| 888 | + double distancenext = 0; |
---|
| 889 | + |
---|
| 890 | + if (i > 0) |
---|
| 891 | + { |
---|
| 892 | + cVector w = pointFlow.points.get(i-1); |
---|
| 893 | + |
---|
| 894 | + double dist = w.distance(v); |
---|
| 895 | + |
---|
| 896 | + distancenext = dist; |
---|
| 897 | + |
---|
| 898 | + if (mindist > dist) |
---|
| 899 | + { |
---|
| 900 | + mindist = dist; |
---|
| 901 | + size = mindist*pointFlow.resizefactor; |
---|
| 902 | + } |
---|
| 903 | + } |
---|
| 904 | + |
---|
| 905 | + if (i < s-1) |
---|
| 906 | + { |
---|
| 907 | + cVector w = pointFlow.points.get(i+1); |
---|
| 908 | + |
---|
| 909 | + double dist = w.distance(v); |
---|
| 910 | + |
---|
| 911 | + if (mindist > dist) |
---|
| 912 | + { |
---|
| 913 | + mindist = dist; |
---|
| 914 | + size = mindist*pointFlow.resizefactor; |
---|
| 915 | + } |
---|
| 916 | + } |
---|
| 917 | + |
---|
| 918 | + if (size < pointFlow.minimumSize) |
---|
| 919 | + size = pointFlow.minimumSize; |
---|
| 920 | + if (size > pointFlow.maximumSize) |
---|
| 921 | + size = pointFlow.maximumSize; |
---|
| 922 | + |
---|
| 923 | + double tx = v.x; |
---|
| 924 | + double ty = v.y; |
---|
| 925 | + double tz = v.z; |
---|
| 926 | + |
---|
| 927 | + // if (tx == 0 && ty == 0 && tz == 0) |
---|
| 928 | + // continue; |
---|
| 929 | + |
---|
| 930 | + gl.glMatrixMode(gl.GL_TEXTURE); |
---|
| 931 | + gl.glPushMatrix(); |
---|
| 932 | + pointFlow.texmat[12] = pointFlow.texmat[13] = pointFlow.texmat[14] = i; |
---|
| 933 | + |
---|
| 934 | + gl.glMultMatrixf(pointFlow.texmat, 0); |
---|
| 935 | + |
---|
| 936 | + gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
| 937 | + gl.glPushMatrix(); |
---|
| 938 | + |
---|
| 939 | + gl.glTranslated(tx,ty,tz); |
---|
| 940 | + |
---|
| 941 | + gl.glScaled(size,size,size); |
---|
| 942 | + |
---|
| 943 | +// float cr = colorBuf.get(index4); |
---|
| 944 | +// float cg = colorBuf.get(index4+1); |
---|
| 945 | +// float cb = colorBuf.get(index4+2); |
---|
| 946 | +// float ca = colorBuf.get(index4+3); |
---|
| 947 | +// |
---|
| 948 | +// display.modelParams0[0] = r * cr; |
---|
| 949 | +// display.modelParams0[1] = g * cg; |
---|
| 950 | +// display.modelParams0[2] = b * cb; |
---|
| 951 | +// |
---|
| 952 | +// display.modelParams5[1] = opacity * ca; |
---|
| 953 | +// |
---|
| 954 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 955 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 956 | +// |
---|
| 957 | +// RandomNode.globalseed = (int)sizeBuf.get(index3+2); // i; |
---|
| 958 | +// RandomNode.globalseed2 = RandomNode.globalseed; |
---|
| 959 | +// |
---|
| 960 | +//// gl.glColor4f(cr,cg,cb,ca); |
---|
| 961 | +// // gl.glScalef(1024/16,1024/16,1024/16); |
---|
| 962 | + pointFlow.geo.Draw/*Node*/(display,null,selected, blocked); |
---|
| 963 | + |
---|
| 964 | + gl.glPopMatrix(); |
---|
| 965 | + |
---|
| 966 | + double step = size/4; // |
---|
| 967 | + |
---|
| 968 | + if (i == 0 || size == 0 || distancenext > 8*size || distancenext < step) |
---|
| 969 | + continue; |
---|
| 970 | + |
---|
| 971 | + int nbsteps = (int)(distancenext/step); |
---|
| 972 | + |
---|
| 973 | + step = distancenext/nbsteps; |
---|
| 974 | + |
---|
| 975 | + cVector next = pointFlow.points.get(i-1); |
---|
| 976 | + |
---|
| 977 | + tmp.set(next); |
---|
| 978 | + tmp.sub(v); |
---|
| 979 | + tmp.normalize(); |
---|
| 980 | + tmp.mul(step); |
---|
| 981 | + |
---|
| 982 | + // calculate next size |
---|
| 983 | + mindist = Double.MAX_VALUE; |
---|
| 984 | + |
---|
| 985 | + double nextsize = pointFlow.minimumSize; |
---|
| 986 | + |
---|
| 987 | + if (i > 1) |
---|
| 988 | + { |
---|
| 989 | + cVector w = pointFlow.points.get(i-2); |
---|
| 990 | + |
---|
| 991 | + double dist = w.distance(next); |
---|
| 992 | + |
---|
| 993 | + if (mindist > dist) |
---|
| 994 | + { |
---|
| 995 | + mindist = dist; |
---|
| 996 | + nextsize = mindist*pointFlow.resizefactor; |
---|
| 997 | + } |
---|
| 998 | + } |
---|
| 999 | + |
---|
| 1000 | + double dist = v.distance(next); |
---|
| 1001 | + |
---|
| 1002 | + if (mindist > dist) |
---|
| 1003 | + { |
---|
| 1004 | + mindist = dist; |
---|
| 1005 | + nextsize = mindist*pointFlow.resizefactor; |
---|
| 1006 | + } |
---|
| 1007 | + |
---|
| 1008 | + if (nextsize < pointFlow.minimumSize) |
---|
| 1009 | + nextsize = pointFlow.minimumSize; |
---|
| 1010 | + if (nextsize > pointFlow.maximumSize) |
---|
| 1011 | + nextsize = pointFlow.maximumSize; |
---|
| 1012 | + // |
---|
| 1013 | + |
---|
| 1014 | + double count = 0; |
---|
| 1015 | + |
---|
| 1016 | + while (distancenext > 0.000000001) // step |
---|
| 1017 | + { |
---|
| 1018 | + gl.glPushMatrix(); |
---|
| 1019 | + |
---|
| 1020 | + gl.glTranslated(tx + tmp.x*count, ty + tmp.y*count, tz + tmp.z*count); |
---|
| 1021 | + |
---|
| 1022 | + double K = count/nbsteps; |
---|
| 1023 | + |
---|
| 1024 | + double intersize = K*nextsize + (1-K)*size; |
---|
| 1025 | + |
---|
| 1026 | + gl.glScaled(intersize,intersize,intersize); |
---|
| 1027 | + |
---|
| 1028 | + pointFlow.geo.Draw/*Node*/(display,null,selected,blocked); |
---|
| 1029 | + |
---|
| 1030 | + count++; |
---|
| 1031 | + |
---|
| 1032 | + distancenext -= step; |
---|
| 1033 | + |
---|
| 1034 | + gl.glPopMatrix(); |
---|
| 1035 | + } |
---|
| 1036 | + |
---|
| 1037 | + if (count != nbsteps) |
---|
| 1038 | + assert(count == nbsteps); |
---|
| 1039 | + |
---|
| 1040 | + // gl.glScalef(16.0f/1024,16.0f/1024,16.0f/1024); |
---|
| 1041 | + //gl.glTranslatef(-tx,-ty,-tz); |
---|
| 1042 | + |
---|
| 1043 | + gl.glMatrixMode(gl.GL_TEXTURE); |
---|
| 1044 | + gl.glPopMatrix(); |
---|
| 1045 | + } |
---|
| 1046 | + |
---|
| 1047 | + if (!cf) |
---|
| 1048 | + gl.glDisable(gl.GL_CULL_FACE); |
---|
| 1049 | + |
---|
| 1050 | +// display.modelParams0[0] = r; |
---|
| 1051 | +// display.modelParams0[1] = g; |
---|
| 1052 | +// display.modelParams0[2] = b; |
---|
| 1053 | +// |
---|
| 1054 | +// display.modelParams5[1] = opacity; |
---|
| 1055 | +// |
---|
| 1056 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0); |
---|
| 1057 | +// gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0); |
---|
| 1058 | + |
---|
| 1059 | + gl.glMatrixMode(gl.GL_MODELVIEW); |
---|
| 1060 | + } |
---|
| 1061 | + |
---|
763 | 1062 | /// INTERFACE |
---|
764 | 1063 | |
---|
765 | 1064 | void SetColor(Object3D obj, Vertex p0) |
---|
.. | .. |
---|
1323 | 1622 | |
---|
1324 | 1623 | static int camerachangeframe; |
---|
1325 | 1624 | |
---|
1326 | | - boolean SetCamera(Camera cam) |
---|
| 1625 | + public boolean SetCamera(Camera cam) |
---|
1327 | 1626 | { |
---|
1328 | 1627 | // may 2014 if (cam == cameras[0] || cam == cameras[1]) |
---|
1329 | 1628 | // return false; |
---|
.. | .. |
---|
1451 | 1750 | mainDL ^= true; |
---|
1452 | 1751 | } |
---|
1453 | 1752 | |
---|
1454 | | - void ToggleTexture() |
---|
| 1753 | + void ToggleFullScreen() |
---|
| 1754 | + { |
---|
| 1755 | + FULLSCREEN ^= true; |
---|
| 1756 | + } |
---|
| 1757 | + |
---|
| 1758 | + void ToggleCrowd() |
---|
| 1759 | + { |
---|
| 1760 | + Globals.CROWD ^= true; |
---|
| 1761 | + } |
---|
| 1762 | + |
---|
| 1763 | + void ToggleLocal() |
---|
| 1764 | + { |
---|
| 1765 | + LOCALTRANSFORM ^= true; |
---|
| 1766 | + } |
---|
| 1767 | + |
---|
| 1768 | + public void ToggleTexture() |
---|
1455 | 1769 | { |
---|
1456 | 1770 | textureon ^= true; |
---|
1457 | 1771 | } |
---|
1458 | 1772 | |
---|
1459 | | - void ToggleLive() |
---|
| 1773 | + public void ToggleLive() |
---|
1460 | 1774 | { |
---|
1461 | 1775 | Globals.setLIVE(Globals.isLIVE() ^ true); |
---|
1462 | 1776 | |
---|
.. | .. |
---|
1468 | 1782 | repaint(); // start loop // may 2013 |
---|
1469 | 1783 | } |
---|
1470 | 1784 | |
---|
1471 | | - void ToggleSupport() |
---|
| 1785 | + public void ToggleSupport() |
---|
1472 | 1786 | { |
---|
1473 | 1787 | SUPPORT ^= true; |
---|
1474 | 1788 | } |
---|
1475 | 1789 | |
---|
1476 | | - void ToggleAbort() |
---|
| 1790 | + public void ToggleAbort() |
---|
1477 | 1791 | { |
---|
1478 | 1792 | ABORTMODE ^= true; |
---|
1479 | 1793 | } |
---|
1480 | 1794 | |
---|
1481 | | - void ToggleFullScreen() |
---|
1482 | | - { |
---|
1483 | | - FULLSCREEN ^= true; |
---|
1484 | | - } |
---|
1485 | | - |
---|
1486 | | - void ToggleCrowd() |
---|
1487 | | - { |
---|
1488 | | - Globals.CROWD ^= true; |
---|
1489 | | - } |
---|
1490 | | - |
---|
1491 | | - void ToggleInertia() |
---|
| 1795 | + public void ToggleInertia() |
---|
1492 | 1796 | { |
---|
1493 | 1797 | INERTIA ^= true; |
---|
1494 | 1798 | } |
---|
1495 | 1799 | |
---|
1496 | | - void ToggleLocal() |
---|
1497 | | - { |
---|
1498 | | - LOCALTRANSFORM ^= true; |
---|
1499 | | - } |
---|
1500 | | - |
---|
1501 | | - void ToggleFast() |
---|
| 1800 | + public void ToggleFast() |
---|
1502 | 1801 | { |
---|
1503 | 1802 | FAST ^= true; |
---|
1504 | 1803 | } |
---|
1505 | 1804 | |
---|
1506 | | - void ToggleSlowPose() |
---|
| 1805 | + public void ToggleSlowPose() |
---|
1507 | 1806 | { |
---|
1508 | 1807 | SLOWPOSE ^= true; |
---|
1509 | 1808 | } |
---|
1510 | 1809 | |
---|
1511 | | - void ToggleFootContact() |
---|
1512 | | - { |
---|
1513 | | - FOOTCONTACT ^= true; |
---|
1514 | | - } |
---|
1515 | | - |
---|
1516 | | - void ToggleBoxMode() |
---|
| 1810 | + public void ToggleBoxMode() |
---|
1517 | 1811 | { |
---|
1518 | 1812 | BOXMODE ^= true; |
---|
1519 | 1813 | } |
---|
1520 | 1814 | |
---|
1521 | | - void ToggleSmoothFocus() |
---|
| 1815 | + public void ToggleSmoothFocus() |
---|
1522 | 1816 | { |
---|
1523 | 1817 | SMOOTHFOCUS ^= true; |
---|
1524 | 1818 | } |
---|
1525 | 1819 | |
---|
1526 | | - void ToggleImageFlip() |
---|
| 1820 | + public void ToggleImageFlip() |
---|
1527 | 1821 | { |
---|
1528 | 1822 | IMAGEFLIP ^= true; |
---|
1529 | 1823 | } |
---|
1530 | 1824 | |
---|
1531 | | - void ToggleSpeakerMocap() |
---|
| 1825 | + public void ToggleSpeakerMocap() |
---|
1532 | 1826 | { |
---|
1533 | 1827 | SPEAKERMOCAP ^= true; |
---|
1534 | 1828 | } |
---|
1535 | 1829 | |
---|
1536 | | - void ToggleSpeakerCamera() |
---|
| 1830 | + public void ToggleSpeakerCamera() |
---|
1537 | 1831 | { |
---|
1538 | 1832 | SPEAKERCAMERA ^= true; |
---|
1539 | 1833 | } |
---|
1540 | 1834 | |
---|
1541 | | - void ToggleSpeakerFocus() |
---|
| 1835 | + public void ToggleSpeakerFocus() |
---|
1542 | 1836 | { |
---|
1543 | 1837 | SPEAKERFOCUS ^= true; |
---|
1544 | 1838 | } |
---|
1545 | 1839 | |
---|
1546 | | - void ToggleDebug() |
---|
1547 | | - { |
---|
1548 | | - DEBUG ^= true; |
---|
1549 | | - } |
---|
1550 | | - |
---|
1551 | | - void ToggleFrustum() |
---|
| 1840 | + public void ToggleFrustum() |
---|
1552 | 1841 | { |
---|
1553 | 1842 | FRUSTUM ^= true; |
---|
1554 | 1843 | } |
---|
1555 | 1844 | |
---|
1556 | | - void ToggleTrack() |
---|
| 1845 | + public void ToggleTrack() |
---|
1557 | 1846 | { |
---|
1558 | 1847 | TRACK ^= true; |
---|
1559 | 1848 | if (TRACK) |
---|
.. | .. |
---|
1572 | 1861 | repaint(); |
---|
1573 | 1862 | } |
---|
1574 | 1863 | |
---|
1575 | | - void ToggleTrackOnce() |
---|
| 1864 | + public void ToggleTrackOnce() |
---|
1576 | 1865 | { |
---|
1577 | 1866 | TRACKONCE ^= true; |
---|
1578 | 1867 | } |
---|
1579 | 1868 | |
---|
1580 | | - void ToggleShadowTrack() |
---|
| 1869 | + public void ToggleShadowTrack() |
---|
1581 | 1870 | { |
---|
1582 | 1871 | SHADOWTRACK ^= true; |
---|
1583 | 1872 | repaint(); |
---|
1584 | 1873 | } |
---|
1585 | 1874 | |
---|
1586 | | - void ToggleOeil() |
---|
| 1875 | + public void ToggleOeil() |
---|
1587 | 1876 | { |
---|
1588 | 1877 | OEIL ^= true; |
---|
1589 | 1878 | } |
---|
1590 | 1879 | |
---|
1591 | | - void ToggleOeilOnce() |
---|
| 1880 | + public void ToggleOeilOnce() |
---|
1592 | 1881 | { |
---|
1593 | 1882 | OEILONCE ^= true; |
---|
| 1883 | + } |
---|
| 1884 | + |
---|
| 1885 | + void ToggleFootContact() |
---|
| 1886 | + { |
---|
| 1887 | + FOOTCONTACT ^= true; |
---|
| 1888 | + } |
---|
| 1889 | + |
---|
| 1890 | + void ToggleDebug() |
---|
| 1891 | + { |
---|
| 1892 | + DEBUG ^= true; |
---|
1594 | 1893 | } |
---|
1595 | 1894 | |
---|
1596 | 1895 | void ToggleLookAt() |
---|
.. | .. |
---|
7652 | 7951 | return texture!=null?texture.texture:null; |
---|
7653 | 7952 | } |
---|
7654 | 7953 | |
---|
7655 | | - com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
| 7954 | + public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) |
---|
7656 | 7955 | { |
---|
7657 | 7956 | CacheTexture texture = GetCacheTexture(tex, bump, resolution); |
---|
7658 | 7957 | |
---|
.. | .. |
---|
10340 | 10639 | fragmentMode |= (lightslot - 64) << 2; // 1; // first bit is available for aniso |
---|
10341 | 10640 | //System.out.println("fragmentMode = " + fragmentMode); |
---|
10342 | 10641 | |
---|
10343 | | - if (DrawMode() == DEFAULT || DrawMode() == SELECTION || DEBUG_SELECTION) |
---|
| 10642 | + if (DrawMode() == DEFAULT || DrawMode() == SELECTION || IsDebugSelection()) |
---|
10344 | 10643 | { |
---|
10345 | 10644 | /* |
---|
10346 | 10645 | if (CULLFACE || (ambientOcclusion && OCCLUSION_CULLING)) |
---|
.. | .. |
---|
10641 | 10940 | callist = gl.glGenLists(1); |
---|
10642 | 10941 | } |
---|
10643 | 10942 | |
---|
10644 | | - boolean selectmode = DrawMode() == SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 10943 | + boolean selectmode = DrawMode() == SELECTION || IsDebugSelection(); |
---|
10645 | 10944 | |
---|
10646 | 10945 | boolean active = !selectmode; // DrawMode() != SELECTION; // mouseDown; |
---|
10647 | 10946 | |
---|
.. | .. |
---|
13116 | 13415 | cVector tmp2 = new cVector(); |
---|
13117 | 13416 | boolean isMoving; |
---|
13118 | 13417 | |
---|
| 13418 | + public cVector TargetLookAt() |
---|
| 13419 | + { |
---|
| 13420 | + return targetLookAt; |
---|
| 13421 | + } |
---|
| 13422 | + |
---|
13119 | 13423 | class PingThread extends Thread |
---|
13120 | 13424 | { |
---|
13121 | 13425 | boolean jump; |
---|
.. | .. |
---|
13847 | 14151 | SetMouseMode(modifiers); |
---|
13848 | 14152 | } |
---|
13849 | 14153 | |
---|
13850 | | - theRenderer.keyPressed(key); |
---|
| 14154 | + Globals.theRenderer.keyPressed(key); |
---|
13851 | 14155 | } |
---|
13852 | 14156 | |
---|
13853 | 14157 | int kompactbit = 4; // power bit |
---|
.. | .. |
---|
13859 | 14163 | float SATPOW = 1; // 2; // 0.5f; |
---|
13860 | 14164 | float BRIPOW = 1; // 0.5f; // 0.5f; |
---|
13861 | 14165 | |
---|
13862 | | - void keyPressed(int key) |
---|
| 14166 | + public void keyPressed(int key) |
---|
13863 | 14167 | { |
---|
13864 | 14168 | if (key >= '0' && key <= '5') |
---|
13865 | 14169 | clampbit = (key-'0'); |
---|
.. | .. |
---|
14296 | 14600 | } |
---|
14297 | 14601 | //System.out.println("shaper_fovy = " + manipCamera.shaper_fovy); |
---|
14298 | 14602 | } |
---|
| 14603 | + |
---|
14299 | 14604 | static double OCCLUSIONBOOST = 1; // 0.5; |
---|
14300 | 14605 | |
---|
14301 | 14606 | void keyReleased(int key, int modifiers) |
---|
.. | .. |
---|
14307 | 14612 | } |
---|
14308 | 14613 | } |
---|
14309 | 14614 | |
---|
14310 | | - protected void processKeyEvent(KeyEvent e) |
---|
| 14615 | + public void processKeyEvent(KeyEvent e) |
---|
14311 | 14616 | { |
---|
14312 | 14617 | switch (e.getID()) |
---|
14313 | 14618 | { |
---|
.. | .. |
---|
15966 | 16271 | |
---|
15967 | 16272 | class AntialiasBuffer implements GLEventListener |
---|
15968 | 16273 | { |
---|
15969 | | - |
---|
15970 | 16274 | CameraPane parent = null; |
---|
15971 | 16275 | |
---|
15972 | 16276 | AntialiasBuffer(CameraPane p) |
---|
.. | .. |
---|
16359 | 16663 | } |
---|
16360 | 16664 | } |
---|
16361 | 16665 | |
---|
16362 | | - static void DrawPoints(CameraPane cpane) |
---|
| 16666 | + static void DrawPoints(iCameraPane cpane) |
---|
16363 | 16667 | { |
---|
16364 | 16668 | for (int i=0; i<8; i++) // first and last are red |
---|
16365 | 16669 | { |
---|