Normand Briere
2019-07-19 e79247ef52a0bbb3864d46bb1e2c716005b3ecf3
CameraPane.java
....@@ -11028,9 +11028,9 @@
1102811028
1102911029 gl.glMatrixMode(GL.GL_MODELVIEW);
1103011030
11031
-//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
11032
-//gl.glEnable(gl.GL_POLYGON_SMOOTH);
11033
-//gl.glEnable(gl.GL_MULTISAMPLE);
11031
+gl.glEnable(gl.GL_POLYGON_SMOOTH);
11032
+gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
11033
+gl.glEnable(gl.GL_MULTISAMPLE);
1103411034 } else
1103511035 {
1103611036 //gl.glDisable(GL.GL_TEXTURE_2D);
....@@ -11041,7 +11041,7 @@
1104111041 //System.out.println("BLENDING ON");
1104211042 gl.glEnable(GL.GL_BLEND);
1104311043 gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
11044
-
11044
+// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE);
1104511045 gl.glMatrixMode(gl.GL_PROJECTION);
1104611046 gl.glLoadIdentity();
1104711047
....@@ -14297,12 +14297,12 @@
1429714297 void GoDown(int mod)
1429814298 {
1429914299 MODIFIERS |= COMMAND;
14300
- /*
14300
+ /**/
1430114301 if((mod&SHIFT) == SHIFT)
1430214302 manipCamera.RotatePosition(0, -speed);
1430314303 else
14304
- manipCamera.BackForth(0, -speed*delta, getWidth());
14305
- */
14304
+ manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14305
+ /**/
1430614306 if ((mod & SHIFT) == SHIFT)
1430714307 {
1430814308 mouseMode = mouseMode; // VR??
....@@ -14318,12 +14318,12 @@
1431814318 void GoUp(int mod)
1431914319 {
1432014320 MODIFIERS |= COMMAND;
14321
- /*
14321
+ /**/
1432214322 if((mod&SHIFT) == SHIFT)
1432314323 manipCamera.RotatePosition(0, speed);
1432414324 else
14325
- manipCamera.BackForth(0, speed*delta, getWidth());
14326
- */
14325
+ manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14326
+ /**/
1432714327 if ((mod & SHIFT) == SHIFT)
1432814328 {
1432914329 mouseMode = mouseMode;
....@@ -14339,12 +14339,12 @@
1433914339 void GoLeft(int mod)
1434014340 {
1434114341 MODIFIERS |= COMMAND;
14342
- /*
14342
+ /**/
1434314343 if((mod&SHIFT) == SHIFT)
14344
- manipCamera.RotatePosition(speed, 0);
14345
- else
1434614344 manipCamera.Translate(speed*delta, 0, getWidth());
14347
- */
14345
+ else
14346
+ manipCamera.RotatePosition(speed, 0);
14347
+ /**/
1434814348 if ((mod & SHIFT) == SHIFT)
1434914349 {
1435014350 mouseMode = mouseMode;
....@@ -14360,12 +14360,12 @@
1436014360 void GoRight(int mod)
1436114361 {
1436214362 MODIFIERS |= COMMAND;
14363
- /*
14363
+ /**/
1436414364 if((mod&SHIFT) == SHIFT)
14365
- manipCamera.RotatePosition(-speed, 0);
14366
- else
1436714365 manipCamera.Translate(-speed*delta, 0, getWidth());
14368
- */
14366
+ else
14367
+ manipCamera.RotatePosition(-speed, 0);
14368
+ /**/
1436914369 if ((mod & SHIFT) == SHIFT)
1437014370 {
1437114371 mouseMode = mouseMode;
....@@ -14604,7 +14604,8 @@
1460414604 Globals.MOUSEDRAGGED = false;
1460514605
1460614606 movingcamera = false;
14607
- X = Y = 0;
14607
+ X = 0; // getBounds().width/2;
14608
+ Y = 0; // getBounds().height/2;
1460814609 //System.out.println("mouseReleased: " + e);
1460914610 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1461014611 }
....@@ -14945,7 +14946,9 @@
1494514946 case 'E' : COMPACT ^= true;
1494614947 repaint();
1494714948 break;
14948
- case 'W' : DEBUGHSB ^= true;
14949
+ case 'W' : // Wide Window (fullscreen)
14950
+ //DEBUGHSB ^= true;
14951
+ ObjEditor.theFrame.ToggleFullScreen();
1494914952 repaint();
1495014953 break;
1495114954 case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break;
....@@ -14971,13 +14974,7 @@
1497114974 repaint();
1497214975 break;
1497314976 case 'l':
14974
- lightMode ^= true;
14975
- Globals.lighttouched = true;
14976
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14977
- targetLookAt.set(manipCamera.lookAt);
14978
- repaint();
14979
- break;
14980
- case 'L':
14977
+ //case 'L':
1498114978 if (lightMode)
1498214979 {
1498314980 lightMode = false;
....@@ -15124,7 +15121,10 @@
1512415121 // kompactbit = 6;
1512515122 // break;
1512615123 case ' ':
15127
- ObjEditor.theFrame.ToggleFullScreen();
15124
+ lightMode ^= true;
15125
+ Globals.lighttouched = true;
15126
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15127
+ targetLookAt.set(manipCamera.lookAt);
1512815128 repaint();
1512915129 break;
1513015130 //case '`' :
....@@ -15708,6 +15708,7 @@
1570815708 info.bounds.y += (height - desired) / 2;
1570915709 }
1571015710 }
15711
+
1571115712 info.g = gr;
1571215713 info.camera = renderCamera;
1571315714 /*
....@@ -15717,23 +15718,44 @@
1571715718 */
1571815719 if (!isRenderer)
1571915720 {
15720
- object.drawEditHandles(info, 0);
15721
-
15722
- if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15721
+ Grafreed.Assert(object != null);
15722
+ Grafreed.Assert(object.selection != null);
15723
+ if (object.selection.Size() > 0)
1572315724 {
15724
- switch (object.selection.get(0).hitSomething)
15725
+ int hitSomething = object.selection.get(0).hitSomething;
15726
+
15727
+ info.DX = 0;
15728
+ info.DY = 0;
15729
+ info.W = 1;
15730
+ if (hitSomething == Object3D.hitCenter)
1572515731 {
15726
- case Object3D.hitCenter: gr.setColor(Color.pink);
15727
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15728
- break;
15729
- case Object3D.hitRotate: gr.setColor(Color.yellow);
15730
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15731
- break;
15732
- case Object3D.hitScale: gr.setColor(Color.cyan);
15733
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15734
- break;
15732
+ info.DX = X;
15733
+ if (X != 0)
15734
+ info.DX -= info.bounds.width/2;
15735
+
15736
+ info.DY = Y;
15737
+ if (Y != 0)
15738
+ info.DY -= info.bounds.height/2;
1573515739 }
15736
-
15740
+
15741
+ object.drawEditHandles(info, 0);
15742
+
15743
+ if (drag && (X != 0 || Y != 0))
15744
+ {
15745
+ switch (hitSomething)
15746
+ {
15747
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15748
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15749
+ break;
15750
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15751
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15752
+ break;
15753
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15754
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15755
+ break;
15756
+ }
15757
+
15758
+ }
1573715759 }
1573815760 }
1573915761 }