Normand Briere
2019-09-25 51e45bf615e1e2b4aca2edf9f7333b687c7d015e
CameraPane.java
....@@ -1,4 +1,5 @@
11
2
+import com.bulletphysics.dynamics.RigidBody;
23 import java.awt.*;
34 import java.awt.event.*;
45 import java.awt.image.*;
....@@ -6961,30 +6962,30 @@
69616962 short residu = 0;
69626963
69636964 // wraparound workarounds
6964
- short fuck = (short) (buffer[i] & 0xFF);
6965
+ short ww = (short) (buffer[i] & 0xFF);
69656966 /*
6966
- residu += (fuck%2);
6967
- if(fuck/2 < 256-residu/2)
6967
+ residu += (ww%2);
6968
+ if(ww/2 < 256-residu/2)
69686969 {
6969
- fuck = (short)((fuck/2) + residu/2);
6970
+ ww = (short)((ww/2) + residu/2);
69706971 if(residu == 2)
69716972 residu = 0;
69726973 }
69736974 else
69746975 {
69756976 residu = 0;
6976
- fuck /= 2;
6977
+ ww /= 2;
69776978 }
69786979 */
6979
- if (i < imglength / 3 || rnd.nextFloat() < 0.5 || fuck >= 254)
6980
+ if (i < imglength / 3 || rnd.nextFloat() < 0.5 || ww >= 254)
69806981 {
6981
- fuck /= 2;
6982
+ ww /= 2;
69826983 } else
69836984 {
6984
- fuck = (short) ((fuck / 2) + fuck % 2);
6985
+ ww = (short) ((ww / 2) + ww % 2);
69856986 }
69866987
6987
- buffer[i] = (byte) fuck;
6988
+ buffer[i] = (byte) ww;
69886989 }
69896990 //System.out.print(bytes[i] + " ");
69906991 //if(buffer[i] >= 0 && buffer[i]<=eps-1) buffer[i] = eps;
....@@ -14340,10 +14341,13 @@
1434014341 public void mouseClicked(MouseEvent e)
1434114342 {
1434214343 System.out.println("mouseClicked: " + e);
14344
+ System.exit(0);
1434314345 }
1434414346
1434514347 public void mousePressed(MouseEvent e)
1434614348 {
14349
+ RigidBody.justclicked = true;
14350
+ System.out.println("justclicked: " + e);
1434714351 //System.out.println("mousePressed: " + e);
1434814352 clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1434914353 }
....@@ -14667,6 +14671,21 @@
1466714671 // only one thread!? synchronized
1466814672 void StepToTarget(boolean jump)
1466914673 {
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
+ RigidBody.wind.set(RigidBody.pos);
14683
+ RigidBody.wind.x -= (float)manipCamera.location.x;
14684
+ RigidBody.wind.y -= (float)manipCamera.location.y;
14685
+ RigidBody.wind.z -= (float)manipCamera.location.z;
14686
+ RigidBody.wind.normalize();
14687
+ }
14688
+
1467014689 if (mute)
1467114690 return;
1467214691
....@@ -15013,6 +15032,8 @@
1501315032
1501415033 void GoUp(int mod)
1501515034 {
15035
+ RigidBody.justclicked = true;
15036
+
1501615037 MODIFIERS |= COMMAND;
1501715038 /**/
1501815039 boolean isVR = (mouseMode&VR)!=0;
....@@ -16743,7 +16764,8 @@
1674316764
1674416765 public boolean mouseDrag(Event evt, int x, int y)
1674516766 {
16746
- //System.out.println("mouseDrag: " + evt);
16767
+ System.out.println("mouseDrag: " + evt);
16768
+ System.exit(0);
1674716769 /*
1674816770 drag = true;
1674916771 //System.out.println("Mouse DRAG");
....@@ -16862,6 +16884,7 @@
1686216884 public boolean mouseUp(Event evt, int x, int y)
1686316885 {
1686416886 System.out.println("mouseUp: " + evt);
16887
+ System.exit(0);
1686516888 /*
1686616889 locked = false;
1686716890 if (isRenderer)