CameraPane.java | ●●●●● patch | view | raw | blame | history | |
Globals.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history | |
cMaterial.java | ●●●●● patch | view | raw | blame | history |
CameraPane.java
.. .. @@ -9840,7 +9840,10 @@ 9840 9840 DrawSkyBox(gl, (float)rati); 9841 9841 gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB); 9842 9842 gl.glEnable(GL.GL_VERTEX_PROGRAM_ARB); 9843 - accPerspective(gl, renderCamera.shaper_fovy / ratio,9843 +9844 + boolean vr = capsLocked && !lightMode;9845 +9846 + accPerspective(gl, renderCamera.shaper_fovy / ratio * (vr ? 2 : 1),9844 9847 ratio, 9845 9848 //near_plane, far_plane, 9846 9849 renderCamera.shaper_zNear * renderCamera.Distance(), renderCamera.shaper_zFar * renderCamera.Distance(), .. .. @@ -11397,7 +11400,9 @@ 11397 11400 //gl.glOrtho(-BOOST, BOOST, -BOOST, BOOST, 0.001, 1000); 11398 11401 } else 11399 11402 { 11400 - glu.gluPerspective(cam.shaper_fovy / ratio, ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance());11403 + boolean vr = capsLocked && !lightMode;11404 +11405 + glu.gluPerspective(cam.shaper_fovy / ratio * (vr ? 2 : 1), ratio, cam.shaper_zNear * cam.Distance(), cam.shaper_zFar * cam.Distance());11401 11406 } 11402 11407 } 11403 11408 .. .. @@ -14250,10 +14255,12 @@ 14250 14255 return; 14251 14256 } 14252 14257 14253 - boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);14258 + //boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);14259 +14260 + boolean vr = capsLocked && !lightMode;14254 14261 14255 14262 // TIMER 14256 - if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR14263 + if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !vr) // VR14257 14264 { 14258 14265 keepboxmode = BOXMODE; 14259 14266 keepsupport = SUPPORT; .. .. @@ -15239,8 +15246,10 @@ 15239 15246 mouseMode |= ZOOM; 15240 15247 } 15241 15248 15242 - boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);15243 - if (capsLocked) // || (modifiers & META) == META)15249 + //boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);15250 + boolean vr = capsLocked && !lightMode;15251 +15252 + if (vr) // || (modifiers & META) == META)15244 15253 { 15245 15254 mouseMode |= VR; // BACKFORTH; 15246 15255 } .. .. @@ -15456,8 +15465,8 @@ 15456 15465 RevertCamera(); 15457 15466 repaint(); 15458 15467 break; 15459 - case 'l':15460 - //case 'L':15468 + //case 'l':15469 + case 'L':15461 15470 if (lightMode) 15462 15471 { 15463 15472 lightMode = false; .. .. @@ -15515,8 +15524,8 @@ 15515 15524 break; 15516 15525 case 'O': 15517 15526 // Too dangerous. Use menu. Globals.drawMode = OCCLUSION; // WARNING 15518 - repaint();15519 - break;15527 + //repaint();15528 + //break;15520 15529 case 'o': 15521 15530 OCCLUSION_CULLING ^= true; 15522 15531 System.out.println("OCCLUSION CULLING = " + OCCLUSION_CULLING); .. .. @@ -15608,6 +15617,10 @@ 15608 15617 // kompactbit = 6; 15609 15618 // break; 15610 15619 case ' ': 15620 + capsLocked ^= true;15621 + repaint();15622 + break;15623 + case 'l':15611 15624 lightMode ^= true; 15612 15625 Globals.lighttouched = true; 15613 15626 manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; .. .. @@ -17911,6 +17924,9 @@ 17911 17924 static boolean DEBUG_SELECTION = false; 17912 17925 boolean OCCLUSION_CULLING = false; //true; 17913 17926 public boolean lightMode = false; 17927 +17928 + public boolean capsLocked = false; // VR17929 +17914 17930 static public int indexcount = 0; 17915 17931 /*static*/ cColor vertexOcclusion = new cColor(); 17916 17932 //private int selection_view = -1; Globals.java
.. .. @@ -1,6 +1,8 @@ 1 1 2 2 public class Globals 3 3 { 4 + static boolean SHOWINFO = true;5 +4 6 static boolean ADVANCED = false; // false; 5 7 6 8 static boolean NIMBUSLAF = false; // false; GroupEditor.java
.. .. @@ -5374,7 +5374,7 @@ 5374 5374 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) 5375 5375 // a camera 5376 5376 { 5377 - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace5377 + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace5378 5378 { 5379 5379 CameraPane.camerachangeframe = 0; // don't refuse it 5380 5380 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); .. .. @@ -5426,7 +5426,7 @@ 5426 5426 5427 5427 void refreshContents(boolean cp) 5428 5428 { 5429 - if (Globals.ADVANCED)5429 + if (Globals.SHOWINFO)5430 5430 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) 5431 5431 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) 5432 5432 { ObjEditor.java
.. .. @@ -1882,7 +1882,7 @@ 1882 1882 tabbedPane.add(creditsPanel); 1883 1883 tabbedPane.setToolTipTextAt(3, "Credits"); 1884 1884 1885 - if (Globals.ADVANCED)1885 + if (Globals.SHOWINFO)1886 1886 { 1887 1887 objectPanel.add(infoPanel); 1888 1888 objectPanel.setIconAt(5, GetIcon("icons/info.png")); .. .. @@ -4469,6 +4469,8 @@ 4469 4469 CopyChanged(copy); 4470 4470 4471 4471 SetVersionStates(); 4472 +4473 + SetCameras();4472 4474 } 4473 4475 4474 4476 public boolean Save(boolean user) .. .. @@ -4547,6 +4549,11 @@ 4547 4549 void RefreshSelection() 4548 4550 { 4549 4551 Object3D selection = new Object3D(); 4552 +4553 + if (objEditor.copy.selection == null)4554 + {4555 + objEditor.copy.selection = new Object3D();4556 + }4550 4557 4551 4558 for (int i = 0; i < objEditor.copy.selection.size(); i++) 4552 4559 { .. .. @@ -4682,7 +4689,7 @@ 4682 4689 // Option? 4683 4690 Replace(); 4684 4691 4685 - System.err.println("Undo");4692 + //System.err.println("Previous");4686 4693 4687 4694 //cRadio tab = GetCurrentTab(); 4688 4695 .. .. @@ -4711,6 +4718,8 @@ 4711 4718 4712 4719 SetVersionStates(); 4713 4720 4721 + SetCameras();4722 +4714 4723 return true; 4715 4724 } 4716 4725 .. .. @@ -4730,6 +4739,8 @@ 4730 4739 CopyChanged(copy); 4731 4740 4732 4741 SetVersionStates(); 4742 +4743 + SetCameras();4733 4744 4734 4745 return true; 4735 4746 } .. .. @@ -4771,9 +4782,20 @@ 4771 4782 //if (!tab.user[tab.versionindex]) 4772 4783 // tab.graphs[tab.versionindex] = null; 4773 4784 4774 - SetVersionStates();4785 + SetVersionStates();4786 +4787 + SetCameras();4775 4788 } 4776 4789 4790 + void SetCameras()4791 + {4792 + Camera neweye = (Camera)copy.GetObject(cameraView.cameras[0].GetUUID());4793 + Camera newlight = (Camera)copy.GetObject(cameraView.LightCamera().GetUUID());4794 +4795 + cameraView.SetCamera(neweye);4796 + cameraView.SetLight(newlight);4797 + }4798 +4777 4799 void ImportGFD() 4778 4800 { 4779 4801 FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); .. .. @@ -5119,6 +5141,7 @@ 5119 5141 copy.versionindex = version; 5120 5142 CopyChanged(copy); 5121 5143 SetVersionStates(); 5144 + SetCameras();5122 5145 } 5123 5146 5124 5147 return; Object3D.java
.. .. @@ -194,6 +194,8 @@ 194 194 { 195 195 Object3D o; 196 196 197 + boolean isnew = false;198 +197 199 if (hashtable.containsKey(GetUUID())) 198 200 { 199 201 o = hashtable.get(GetUUID()); .. .. @@ -206,6 +208,8 @@ 206 208 } 207 209 else 208 210 { 211 + isnew = true;212 +209 213 o = new Object3D("copy of " + this.name); 210 214 211 215 hashtable.put(GetUUID(), o); .. .. @@ -222,12 +226,15 @@ 222 226 223 227 blockloop = false; 224 228 } 225 -226 - ExtractBigData(o);229 +230 + if (isnew)231 + ExtractBigData(o);227 232 } 228 233 229 234 void ExtractBigData(Object3D o) 230 235 { 236 + //System.err.println("ExtractBigData : " + this + " --> " + o);237 +231 238 if (o.bRep != null) 232 239 Grafreed.Assert(o.bRep == this.bRep); 233 240 .. .. @@ -238,8 +245,8 @@ 238 245 // o.bRep.support = null; 239 246 // } 240 247 o.selection = this.selection; 241 - o.versionlist = this.versionlist;242 - o.versionindex = this.versionindex;248 + //o.versionlist = this.versionlist;249 + //o.versionindex = this.versionindex;243 250 244 251 if (this.support != null) 245 252 { .. .. @@ -355,6 +362,8 @@ 355 362 356 363 void RestoreBigData(Object3D o) 357 364 { 365 + //System.err.println("RestoreBigData : " + this + " <-- " + o);366 +358 367 this.bRep = o.bRep; 359 368 if (this.support != null && o.transientrep != null) 360 369 { .. .. @@ -363,8 +372,8 @@ 363 372 364 373 this.selection = o.selection; 365 374 366 - this.versionlist = o.versionlist;367 - this.versionindex = o.versionindex;375 + //this.versionlist = o.versionlist;376 + //this.versionindex = o.versionindex;368 377 // July 2019 if (this.bRep != null) 369 378 // this.bRep.support = o.transientrep; 370 379 // this.support = o.support; cMaterial.java
.. .. @@ -41,7 +41,6 @@ 41 41 42 42 public cMaterial(cMaterial mat) 43 43 { 44 - this();45 44 if (mat != null) 46 45 { 47 46 Set(mat);