Normand Briere
2019-08-19 22e8ab6479334206f97b0093f6c5ffd14610cce3
CameraPane.java
....@@ -168,7 +168,7 @@
168168
169169
170170 // OPTIONS
171
- boolean Skinshader = true;
171
+ boolean Skinshader = false; // true;
172172 boolean cameraLight = false;
173173 boolean UVdebug = false;
174174 boolean Udebug = false;
....@@ -2052,9 +2052,9 @@
20522052 switch(viewcode)
20532053 {
20542054 case 0: return "main";
2055
- case 1: return "one";
2056
- case 2: return "two";
2057
- case 3: return "three";
2055
+ case 1: return "Red";
2056
+ case 2: return "Green";
2057
+ case 3: return "Blue";
20582058 case 4: return "light";
20592059 }
20602060
....@@ -10690,9 +10690,18 @@
1069010690 static boolean init = false;
1069110691
1069210692 double[][] matrix = LA.newMatrix();
10693
+
10694
+ // This is to refresh the UI of the material panel.
10695
+ ObjEditor patchMaterial;
1069310696
1069410697 public void display(GLAutoDrawable drawable)
1069510698 {
10699
+ if (patchMaterial.patchMaterial)
10700
+ {
10701
+ patchMaterial.patchMaterial = false;
10702
+ patchMaterial.objectPanel.setSelectedIndex(1);
10703
+ }
10704
+
1069610705 if (Grafreed.savesound && Grafreed.hassound)
1069710706 {
1069810707 Grafreed.wav.save();
....@@ -11088,7 +11097,7 @@
1108811097 {
1108911098 if (cubemaprgb == null)
1109011099 {
11091
- cubemaprgb = LoadSkybox("cubemaps/default-skyboxes/rgb" + "/", "jpg", false);
11100
+ cubemaprgb = LoadSkybox("cubemaps/default-skyboxes/rgb2" + "/", "jpg", false);
1109211101 }
1109311102
1109411103 cubemap = cubemaprgb;
....@@ -13419,8 +13428,12 @@
1341913428 program = programmin;
1342013429 }
1342113430
13422
- System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
13423
- System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
13431
+ if (Globals.DEBUG)
13432
+ {
13433
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
13434
+ System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
13435
+ }
13436
+
1342413437 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1342513438
1342613439 //gl.glNewList(displayListID, GL.GL_COMPILE);
....@@ -13467,7 +13480,8 @@
1346713480 "\n" +
1346813481 "END\n";
1346913482
13470
- System.out.println("Program shadow #" + 0 + "; length = " + program.length());
13483
+ if (Globals.DEBUG)
13484
+ System.out.println("Program shadow #" + 0 + "; length = " + program.length());
1347113485 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1347213486
1347313487 //gl.glNewList(displayListID, GL.GL_COMPILE);
....@@ -14666,11 +14680,17 @@
1466614680 void GoDown(int mod)
1466714681 {
1466814682 MODIFIERS |= COMMAND;
14683
+ boolean isVR = (mouseMode&VR)!=0;
1466914684 /**/
1467014685 if((mod&SHIFT) == SHIFT)
14671
- manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14686
+ {
14687
+ if (isVR)
14688
+ manipCamera.RotateInterest(0, -speed);
14689
+ else
14690
+ manipCamera.RotatePosition(0, -speed);
14691
+ }
1467214692 else
14673
- manipCamera.RotatePosition(0, -speed);
14693
+ manipCamera.BackForth(0, -speed*delta, isVR?1000:0); // getWidth());
1467414694 /**/
1467514695 if ((mod & SHIFT) == SHIFT)
1467614696 {
....@@ -14680,6 +14700,8 @@
1468014700 mouseMode |= BACKFORTH;
1468114701 }
1468214702
14703
+ targetLookAt.set(manipCamera.lookAt);
14704
+
1468314705 //prevX = X = anchorX;
1468414706 prevY = Y = anchorY - (int) (renderCamera.Distance());
1468514707 }
....@@ -14688,10 +14710,17 @@
1468814710 {
1468914711 MODIFIERS |= COMMAND;
1469014712 /**/
14713
+ boolean isVR = (mouseMode&VR)!=0;
14714
+
1469114715 if((mod&SHIFT) == SHIFT)
14692
- manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14716
+ {
14717
+ if (isVR)
14718
+ manipCamera.RotateInterest(0, speed);
14719
+ else
14720
+ manipCamera.RotatePosition(0, speed);
14721
+ }
1469314722 else
14694
- manipCamera.RotatePosition(0, speed);
14723
+ manipCamera.BackForth(0, speed*delta, isVR?1000:0); // getWidth());
1469514724 /**/
1469614725 if ((mod & SHIFT) == SHIFT)
1469714726 {
....@@ -14701,6 +14730,8 @@
1470114730 mouseMode |= BACKFORTH;
1470214731 }
1470314732
14733
+ targetLookAt.set(manipCamera.lookAt);
14734
+
1470414735 //prevX = X = anchorX;
1470514736 prevY = Y = anchorY + (int) (renderCamera.Distance());
1470614737 }
....@@ -14710,9 +14741,14 @@
1471014741 MODIFIERS |= COMMAND;
1471114742 /**/
1471214743 if((mod&SHIFT) == SHIFT)
14713
- manipCamera.Translate(speed*delta, 0, getWidth());
14744
+ manipCamera.Translate(speed*delta, 0, getWidth());
1471414745 else
14715
- manipCamera.RotatePosition(speed, 0);
14746
+ {
14747
+ if ((mouseMode&VR)!=0)
14748
+ manipCamera.RotateInterest(-speed, 0);
14749
+ else
14750
+ manipCamera.RotatePosition(speed, 0);
14751
+ }
1471614752 /**/
1471714753 if ((mod & SHIFT) == SHIFT)
1471814754 {
....@@ -14722,6 +14758,8 @@
1472214758 mouseMode |= ROTATE;
1472314759 } // TRANSLATE;
1472414760
14761
+ targetLookAt.set(manipCamera.lookAt);
14762
+
1472514763 prevX = X = anchorX - 10; // (int)(10*renderCamera.Distance());
1472614764 prevY = Y = anchorY;
1472714765 }
....@@ -14731,9 +14769,15 @@
1473114769 MODIFIERS |= COMMAND;
1473214770 /**/
1473314771 if((mod&SHIFT) == SHIFT)
14734
- manipCamera.Translate(-speed*delta, 0, getWidth());
14772
+ manipCamera.Translate(-speed*delta, 0, getWidth());
1473514773 else
14736
- manipCamera.RotatePosition(-speed, 0);
14774
+ {
14775
+ if ((mouseMode&VR)!=0)
14776
+ manipCamera.RotateInterest(speed, 0);
14777
+ else
14778
+ manipCamera.RotatePosition(-speed, 0);
14779
+ }
14780
+
1473714781 /**/
1473814782 if ((mod & SHIFT) == SHIFT)
1473914783 {
....@@ -14743,6 +14787,8 @@
1474314787 mouseMode |= ROTATE;
1474414788 } // TRANSLATE;
1474514789
14790
+ targetLookAt.set(manipCamera.lookAt);
14791
+
1474614792 prevX = X = anchorX + 10; // (int)(10*renderCamera.Distance());
1474714793 prevY = Y = anchorY;
1474814794 }
....@@ -15245,8 +15291,8 @@
1524515291 case 'K':
1524615292 KOMPACTTEXTURE ^= true;
1524715293 //textures.clear();
15248
- break;
15249
- case 'P': // Texture Projection macros
15294
+ // break;
15295
+ //case 'P': // Texture Projection macros
1525015296 // SAVETEXTURE ^= true;
1525115297 macromode = true;
1525215298 Udebug = Vdebug = NORMALdebug = false; programInitialized = false;
....@@ -15367,7 +15413,7 @@
1536715413 targetLookAt.set(manipCamera.lookAt);
1536815414 repaint();
1536915415 break;
15370
- case 'p':
15416
+ case 'P': // p':
1537115417 // c'est quoi ca au juste? spherical ^= true;
1537215418 Skinshader ^= true; programInitialized = false;
1537315419 repaint();
....@@ -16127,7 +16173,7 @@
1612716173 {
1612816174 switch (hitSomething)
1612916175 {
16130
- case Object3D.hitCenter: gr.setColor(Color.pink);
16176
+ case Object3D.hitCenter: gr.setColor(Color.white);
1613116177 gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1613216178 break;
1613316179 case Object3D.hitRotate: gr.setColor(Color.yellow);
....@@ -16153,7 +16199,7 @@
1615316199 if (hasMarquee)
1615416200 {
1615516201 gr.setXORMode(Color.white);
16156
- gr.setColor(Color.red);
16202
+ gr.setColor(Color.white);
1615716203 if (!firstime)
1615816204 {
1615916205 gr.drawRect(prevmarqX, prevmarqY, prevmarqW, prevmarqH);
....@@ -17329,6 +17375,7 @@
1732917375
1733017376 public void init(GLAutoDrawable drawable)
1733117377 {
17378
+ if (Globals.DEBUG)
1733217379 System.out.println("shadow buffer init");
1733317380
1733417381 GL gl = drawable.getGL();