Normand Briere
2019-10-04 57c5b6cd8d12ffdaa3e0b099451e3c031012750a
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;
....@@ -250,7 +250,7 @@
250250
251251 public javax.media.opengl.GL GetGL0()
252252 {
253
- return null;
253
+ return currentGL;
254254 }
255255
256256 public int GenList()
....@@ -1530,7 +1530,7 @@
15301530 }
15311531 }
15321532 float b = 0;
1533
- if (obj.support != null && obj.link2master)
1533
+ if (obj.support != null && obj.Link2Support())
15341534 {
15351535 b = 1;
15361536 }
....@@ -6962,30 +6962,30 @@
69626962 short residu = 0;
69636963
69646964 // wraparound workarounds
6965
- short fuck = (short) (buffer[i] & 0xFF);
6965
+ short ww = (short) (buffer[i] & 0xFF);
69666966 /*
6967
- residu += (fuck%2);
6968
- if(fuck/2 < 256-residu/2)
6967
+ residu += (ww%2);
6968
+ if(ww/2 < 256-residu/2)
69696969 {
6970
- fuck = (short)((fuck/2) + residu/2);
6970
+ ww = (short)((ww/2) + residu/2);
69716971 if(residu == 2)
69726972 residu = 0;
69736973 }
69746974 else
69756975 {
69766976 residu = 0;
6977
- fuck /= 2;
6977
+ ww /= 2;
69786978 }
69796979 */
6980
- if (i < imglength / 3 || rnd.nextFloat() < 0.5 || fuck >= 254)
6980
+ if (i < imglength / 3 || rnd.nextFloat() < 0.5 || ww >= 254)
69816981 {
6982
- fuck /= 2;
6982
+ ww /= 2;
69836983 } else
69846984 {
6985
- fuck = (short) ((fuck / 2) + fuck % 2);
6985
+ ww = (short) ((ww / 2) + ww % 2);
69866986 }
69876987
6988
- buffer[i] = (byte) fuck;
6988
+ buffer[i] = (byte) ww;
69896989 }
69906990 //System.out.print(bytes[i] + " ");
69916991 //if(buffer[i] >= 0 && buffer[i]<=eps-1) buffer[i] = eps;
....@@ -10761,7 +10761,9 @@
1076110761 }
1076210762 /**/
1076310763
10764
- if (selection)
10764
+ boolean control = ((modifiers & CTRL) != 0);
10765
+
10766
+ if (selection && (!Globals.isLIVE() || control))
1076510767 {
1076610768 selectbuffer.display();
1076710769 return;
....@@ -14341,6 +14343,7 @@
1434114343 public void mouseClicked(MouseEvent e)
1434214344 {
1434314345 System.out.println("mouseClicked: " + e);
14346
+ System.exit(0);
1434414347 }
1434514348
1434614349 public void mousePressed(MouseEvent e)
....@@ -14652,7 +14655,7 @@
1465214655 boolean jump;
1465314656 boolean live;
1465414657
14655
- boolean mute;
14658
+ boolean mute = false;
1465614659
1465714660 // void JumpToTarget()
1465814661 // {
....@@ -14668,13 +14671,27 @@
1466814671 // only one thread!? synchronized
1466914672 void StepToTarget(boolean jump)
1467014673 {
14671
- RigidBody.pos.x = (float)manipCamera.lookAt.x;
14672
- RigidBody.pos.y = (float)manipCamera.lookAt.y;
14673
- RigidBody.pos.z = (float)manipCamera.lookAt.z;
14674
-// RigidBody.wind.x = (float)manipCamera.right.x;
14675
-// RigidBody.wind.y = (float)manipCamera.right.y;
14676
-// RigidBody.wind.z = (float)manipCamera.right.z;
14677
- //RigidBody.wind.normalize();
14674
+ RigidBody.pos.x = 0;
14675
+ RigidBody.pos.y = 0;
14676
+ RigidBody.pos.z = 0;
14677
+ if (RigidBody.justclicked)
14678
+ {
14679
+// RigidBody.pos.x = (float)manipCamera.lookAt.x;
14680
+// RigidBody.pos.y = (float)manipCamera.lookAt.y;
14681
+// RigidBody.pos.z = (float)manipCamera.lookAt.z;
14682
+ // System.err.println("selected point = " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][1]) + " " + Trunk(selectedpoint.toParent[3][2]));
14683
+ CreateSelectedPoint();
14684
+
14685
+ RigidBody.pos.x = (float)selectedpoint.toParent[3][0];
14686
+ RigidBody.pos.y = (float)selectedpoint.toParent[3][1];
14687
+ RigidBody.pos.z = (float)selectedpoint.toParent[3][2];
14688
+
14689
+ RigidBody.wind.set(RigidBody.pos);
14690
+ RigidBody.wind.x -= (float)manipCamera.location.x;
14691
+ RigidBody.wind.y -= (float)manipCamera.location.y;
14692
+ RigidBody.wind.z -= (float)manipCamera.location.z;
14693
+ RigidBody.wind.normalize();
14694
+ }
1467814695
1467914696 if (mute)
1468014697 return;
....@@ -15022,6 +15039,8 @@
1502215039
1502315040 void GoUp(int mod)
1502415041 {
15042
+ RigidBody.justclicked = true;
15043
+
1502515044 MODIFIERS |= COMMAND;
1502615045 /**/
1502715046 boolean isVR = (mouseMode&VR)!=0;
....@@ -15355,6 +15374,12 @@
1535515374
1535615375 public void mouseReleased(MouseEvent e)
1535715376 {
15377
+ if (isRenderer && !movingcamera)
15378
+ {
15379
+ RigidBody.justclicked = true;
15380
+ System.out.println("justclicked: " + e);
15381
+ }
15382
+
1535815383 Globals.MOUSEDRAGGED = false;
1535915384
1536015385 movingcamera = false;
....@@ -16752,7 +16777,8 @@
1675216777
1675316778 public boolean mouseDrag(Event evt, int x, int y)
1675416779 {
16755
- //System.out.println("mouseDrag: " + evt);
16780
+ System.out.println("mouseDrag: " + evt);
16781
+ System.exit(0);
1675616782 /*
1675716783 drag = true;
1675816784 //System.out.println("Mouse DRAG");
....@@ -16871,6 +16897,7 @@
1687116897 public boolean mouseUp(Event evt, int x, int y)
1687216898 {
1687316899 System.out.println("mouseUp: " + evt);
16900
+ System.exit(0);
1687416901 /*
1687516902 locked = false;
1687616903 if (isRenderer)
....@@ -17141,7 +17168,7 @@
1714117168 return;
1714217169 }
1714317170
17144
- if (WIREFRAME)
17171
+ //if (WIREFRAME)
1714517172 gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
1714617173
1714717174 gl.glDisable(gl.GL_CULL_FACE);
....@@ -17241,6 +17268,8 @@
1724117268
1724217269 if (WIREFRAME)
1724317270 gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE);
17271
+ else
17272
+ gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
1724417273 }
1724517274
1724617275 private void DrawChecker(GL gl)