Normand Briere
2019-08-22 6a823ffbfcda4c843f46e02e83c869d5bc323e25
ObjEditor.java
....@@ -72,6 +72,21 @@
7272 }
7373 }
7474
75
+ public Composite CreateCameras()
76
+ {
77
+ Composite cams = new cTemplate();
78
+ cams.name = "Cameras";
79
+ copy.insertElementAt(cams, 0);
80
+
81
+ cams.addChild(new Camera());
82
+ cams.addChild(new Camera(1));
83
+ cams.addChild(new Camera(2));
84
+ cams.addChild(new Camera(3));
85
+ cams.addChild(new Camera(4));
86
+
87
+ return cams;
88
+ }
89
+
7590 public cGridBag GetSeparator()
7691 {
7792 cGridBag separator = new cGridBag();
....@@ -83,7 +98,7 @@
8398 cButton GetButton(String name, boolean border)
8499 {
85100 ImageIcon icon = GetIcon(name);
86
- if (icon != null)
101
+ if (icon != null || name.contains("/"))
87102 return new cButton(icon, border);
88103 else
89104 return new cButton(name, border);
....@@ -119,8 +134,14 @@
119134
120135 try
121136 {
122
- BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
123
-
137
+ BufferedImage image;
138
+
139
+ if (name.endsWith("jpg"))
140
+ // Much faster!
141
+ image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage();
142
+ else
143
+ image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
144
+
124145 // if (image.getWidth() > 48 && image.getHeight() > 48)
125146 // {
126147 // BufferedImage resized = new BufferedImage(48, 48, image.getType());
....@@ -445,8 +466,11 @@
445466 importOBJItem.addActionListener(this);
446467 import3DSItem = menu.add(new MenuItem("3DS file..."));
447468 import3DSItem.addActionListener(this);
469
+ if (Globals.ADVANCED)
470
+ {
448471 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449472 importVRMLX3DItem.addActionListener(this);
473
+ }
450474 menu.add("-");
451475 importGFDItem = menu.add(new MenuItem("Grafreed file..."));
452476 importGFDItem.addActionListener(this);
....@@ -1318,7 +1342,7 @@
13181342
13191343 //if (copy.pinned)
13201344 {
1321
- pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1345
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
13221346 pinButton.setSelected(copy.pinned);
13231347 cGridBag t = new cGridBag();
13241348 t.preferredWidth = 2;
....@@ -1550,23 +1574,9 @@
15501574
15511575 if (cam == null || !(copy.get(0) instanceof cGroup))
15521576 {
1553
- if (Globals.DEBUG)
1554
- System.out.println("CREATE CAMERAS");
1555
- cams = new cTemplate();
1556
- cams.name = "Cameras";
1557
- copy.insertElementAt(cams, 0);
1558
- //cams.parent = copy;
1559
-
1560
- cam = new Camera(); // LA.newVector(3, 2, 1));
1561
- cams.addChild(cam);
1562
- cam = new Camera(1);
1563
- cams.addChild(cam);
1564
- cam = new Camera(2);
1565
- cams.addChild(cam);
1566
- cam = new Camera(3);
1567
- cams.addChild(cam);
1568
- cam = new Camera(4); // Light
1569
- cams.addChild(cam);
1577
+ if (Globals.DEBUG)
1578
+ System.out.println("CREATE CAMERAS");
1579
+ cams = CreateCameras();
15701580 } else
15711581 {
15721582 cams = (cGroup) copy.get(0);
....@@ -1638,7 +1648,8 @@
16381648
16391649 resetTransformPanel.preferredHeight = 2;
16401650
1641
- cButton resetTransform = GetButton("Reset all", !Grafreed.NIMBUSLAF);
1651
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1652
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
16421653 resetTransform.addMouseListener(new MouseAdapter()
16431654 {
16441655 public void mouseClicked(MouseEvent e)
....@@ -1648,7 +1659,8 @@
16481659 });
16491660 resetTransformPanel.add(resetTransform);
16501661
1651
- resetTransform = GetButton("T only", !Grafreed.NIMBUSLAF);
1662
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1663
+ resetTransform.setToolTipText("Reset Translation only");
16521664 resetTransform.addMouseListener(new MouseAdapter()
16531665 {
16541666 public void mouseClicked(MouseEvent e)
....@@ -1658,7 +1670,8 @@
16581670 });
16591671 resetTransformPanel.add(resetTransform);
16601672
1661
- resetTransform = GetButton("RS only", !Grafreed.NIMBUSLAF);
1673
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1674
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
16621675 resetTransform.addMouseListener(new MouseAdapter()
16631676 {
16641677 public void mouseClicked(MouseEvent e)
....@@ -1715,24 +1728,24 @@
17151728
17161729 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
17171730 //tmp.setName("Edit");
1731
+ objectPanel.add(skyboxPanel);
1732
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1733
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1734
+
17181735 objectPanel.add(toolboxPanel);
1719
- objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
1720
- objectPanel.setToolTipTextAt(0, "Objects & textures");
1736
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1737
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
17211738
17221739 objectPanel.add(materialPanel);
1723
- objectPanel.setIconAt(1, GetIcon("icons/material.png"));
1724
- objectPanel.setToolTipTextAt(1, "Material");
1740
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1741
+ objectPanel.setToolTipTextAt(2, "Material");
17251742
1726
- objectPanel.add(skyboxPanel);
1727
- objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1728
- objectPanel.setToolTipTextAt(2, "Backgrounds");
1729
-
17301743 // JPanel north = new JPanel(new BorderLayout());
17311744 // north.setName("Edit");
17321745 // north.add(ctrlPanel, BorderLayout.NORTH);
17331746 // objectPanel.add(north);
17341747 objectPanel.add(editPanel);
1735
- objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1748
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
17361749 objectPanel.setToolTipTextAt(3, "Edit controls");
17371750
17381751 objectPanel.add(transformPanel);
....@@ -1741,7 +1754,7 @@
17411754
17421755 patchMaterial = true;
17431756 cameraView.patchMaterial = this;
1744
- objectPanel.setSelectedIndex(1);
1757
+ objectPanel.setSelectedIndex(2);
17451758
17461759 /*
17471760 aConstraints.gridx = 0;
....@@ -1773,17 +1786,109 @@
17731786
17741787 AddOptions(optionsPanel); //, aConstraints);
17751788
1776
- tabbedPane.add(optionsPanel);
1777
-
17781789 tabbedPane.add(FSPane = new cFileSystemPane(this));
17791790
1791
+ tabbedPane.add(optionsPanel);
1792
+
17801793 scenePanel.add(tabbedPane);
17811794
1782
- //if (Globals.ADVANCED)
1783
-// tabbedPane.add(infoPanel);
1784
-// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1785
-// tabbedPane.setToolTipTextAt(3, "Information");
1795
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1796
+ creditsPanel.setName("Credits");
17861797
1798
+ cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1799
+ creditsPanel.add(ogaLabel);
1800
+
1801
+ cButton creditButton;
1802
+ creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1803
+ creditButton.setToolTipText("https://opengameart.org");
1804
+
1805
+ creditButton.addMouseListener(new MouseAdapter()
1806
+ {
1807
+ public void mouseClicked(MouseEvent e)
1808
+ {
1809
+ try
1810
+ {
1811
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1812
+ } catch (Exception e1)
1813
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1814
+ {
1815
+ e1.printStackTrace();
1816
+ }
1817
+ }
1818
+ });
1819
+
1820
+ ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
1821
+ creditsPanel.add(ogaLabel);
1822
+
1823
+ creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF));
1824
+ creditButton.setToolTipText("https://3delicious.net");
1825
+
1826
+ creditButton.addMouseListener(new MouseAdapter()
1827
+ {
1828
+ public void mouseClicked(MouseEvent e)
1829
+ {
1830
+ try
1831
+ {
1832
+ Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net"));
1833
+ } catch (Exception e1)
1834
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1835
+ {
1836
+ e1.printStackTrace();
1837
+ }
1838
+ }
1839
+ });
1840
+
1841
+ creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF));
1842
+ creditButton.setToolTipText("https://archive3d.net");
1843
+
1844
+ creditButton.addMouseListener(new MouseAdapter()
1845
+ {
1846
+ public void mouseClicked(MouseEvent e)
1847
+ {
1848
+ try
1849
+ {
1850
+ Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net"));
1851
+ } catch (Exception e1)
1852
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1853
+ {
1854
+ e1.printStackTrace();
1855
+ }
1856
+ }
1857
+ });
1858
+
1859
+ creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF));
1860
+ creditButton.setToolTipText("https://turbosquid.com");
1861
+
1862
+ creditButton.addMouseListener(new MouseAdapter()
1863
+ {
1864
+ public void mouseClicked(MouseEvent e)
1865
+ {
1866
+ try
1867
+ {
1868
+ Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free"));
1869
+ } catch (Exception e1)
1870
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1871
+ {
1872
+ e1.printStackTrace();
1873
+ }
1874
+ }
1875
+ });
1876
+
1877
+ for (int i=6; --i>=0;)
1878
+ {
1879
+ creditsPanel.add(new cGridBag());
1880
+ }
1881
+
1882
+ tabbedPane.add(creditsPanel);
1883
+ tabbedPane.setToolTipTextAt(3, "Credits");
1884
+
1885
+ if (Globals.ADVANCED)
1886
+ {
1887
+ tabbedPane.add(infoPanel);
1888
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1889
+ tabbedPane.setToolTipTextAt(4, "Information");
1890
+ }
1891
+
17871892 /*
17881893 cTree jTree = new cTree(null);
17891894 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1929,7 +2034,7 @@
19292034 {
19302035 cGridBag presetpanel = new cGridBag().setVertical(true);
19312036
1932
- cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
2037
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
19332038 skin.setToolTipText("Skin");
19342039 skin.addMouseListener(new MouseAdapter()
19352040 {
....@@ -1967,7 +2072,7 @@
19672072 });
19682073 presetpanel.add(skin);
19692074
1970
- cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
2075
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
19712076 lambert.setToolTipText("Diffuse");
19722077 lambert.addMouseListener(new MouseAdapter()
19732078 {
....@@ -1985,7 +2090,7 @@
19852090 });
19862091 presetpanel.add(lambert);
19872092
1988
- cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
2093
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
19892094 diffuse2.setToolTipText("Diffuse2");
19902095 diffuse2.addMouseListener(new MouseAdapter()
19912096 {
....@@ -2003,7 +2108,7 @@
20032108 });
20042109 presetpanel.add(diffuse2);
20052110
2006
- cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
2111
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
20072112 diffusemoon.setToolTipText("Moon");
20082113 diffusemoon.addMouseListener(new MouseAdapter()
20092114 {
....@@ -2021,7 +2126,7 @@
20212126 });
20222127 presetpanel.add(diffusemoon);
20232128
2024
- cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
2129
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
20252130 diffusemoon2.setToolTipText("Moon2");
20262131 diffusemoon2.addMouseListener(new MouseAdapter()
20272132 {
....@@ -2039,7 +2144,7 @@
20392144 });
20402145 presetpanel.add(diffusemoon2);
20412146
2042
- cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
2147
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
20432148 diffusemoon3.setToolTipText("Moon3");
20442149 diffusemoon3.addMouseListener(new MouseAdapter()
20452150 {
....@@ -2057,7 +2162,7 @@
20572162 });
20582163 presetpanel.add(diffusemoon3);
20592164
2060
- cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
2165
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
20612166 diffusesheen.setToolTipText("Sheen");
20622167 diffusesheen.addMouseListener(new MouseAdapter()
20632168 {
....@@ -2074,7 +2179,7 @@
20742179 });
20752180 presetpanel.add(diffusesheen);
20762181
2077
- cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2182
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
20782183 rough.setToolTipText("Rough metal");
20792184 rough.addMouseListener(new MouseAdapter()
20802185 {
....@@ -2092,7 +2197,7 @@
20922197 });
20932198 presetpanel.add(rough);
20942199
2095
- cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2200
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
20962201 rough2.setToolTipText("Medium metal");
20972202 rough2.addMouseListener(new MouseAdapter()
20982203 {
....@@ -2110,7 +2215,7 @@
21102215 });
21112216 presetpanel.add(rough2);
21122217
2113
- cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2218
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
21142219 shini0.setToolTipText("Shiny");
21152220 shini0.addMouseListener(new MouseAdapter()
21162221 {
....@@ -2128,7 +2233,7 @@
21282233 });
21292234 presetpanel.add(shini0);
21302235
2131
- cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2236
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
21322237 shini1.setToolTipText("Shiny2");
21332238 shini1.addMouseListener(new MouseAdapter()
21342239 {
....@@ -2146,7 +2251,7 @@
21462251 });
21472252 presetpanel.add(shini1);
21482253
2149
- cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2254
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
21502255 shini2.setToolTipText("Shiny3");
21512256 shini2.addMouseListener(new MouseAdapter()
21522257 {
....@@ -2164,7 +2269,7 @@
21642269 });
21652270 presetpanel.add(shini2);
21662271
2167
- cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2272
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
21682273 aniso.setToolTipText("AnisoU");
21692274 aniso.addMouseListener(new MouseAdapter()
21702275 {
....@@ -2182,7 +2287,7 @@
21822287 });
21832288 presetpanel.add(aniso);
21842289
2185
- cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2290
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
21862291 aniso2.setToolTipText("AnisoV");
21872292 aniso2.addMouseListener(new MouseAdapter()
21882293 {
....@@ -2200,7 +2305,7 @@
22002305 });
22012306 presetpanel.add(aniso2);
22022307
2203
- cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2308
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
22042309 aniso3.setToolTipText("AnisoUV");
22052310 aniso3.addMouseListener(new MouseAdapter()
22062311 {
....@@ -2218,7 +2323,7 @@
22182323 });
22192324 presetpanel.add(aniso3);
22202325
2221
- cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2326
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
22222327 velvet0.setToolTipText("Velvet");
22232328 velvet0.addMouseListener(new MouseAdapter()
22242329 {
....@@ -2240,7 +2345,7 @@
22402345 });
22412346 presetpanel.add(velvet0);
22422347
2243
- cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2348
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
22442349 bump0.setToolTipText("Bump texture");
22452350 bump0.addMouseListener(new MouseAdapter()
22462351 {
....@@ -2259,7 +2364,7 @@
22592364 });
22602365 presetpanel.add(bump0);
22612366
2262
- cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF);
2367
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
22632368 borderShader.setToolTipText("Border fade");
22642369 borderShader.addMouseListener(new MouseAdapter()
22652370 {
....@@ -2274,7 +2379,7 @@
22742379 });
22752380 presetpanel.add(borderShader);
22762381
2277
- cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2382
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
22782383 halo.setToolTipText("Halo");
22792384 halo.addMouseListener(new MouseAdapter()
22802385 {
....@@ -2291,7 +2396,7 @@
22912396 });
22922397 presetpanel.add(halo);
22932398
2294
- cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2399
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
22952400 candle.setToolTipText("Candle");
22962401 candle.addMouseListener(new MouseAdapter()
22972402 {
....@@ -2313,7 +2418,7 @@
23132418 });
23142419 presetpanel.add(candle);
23152420
2316
- cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2421
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
23172422 shadowShader.setToolTipText("Shadow");
23182423 shadowShader.addMouseListener(new MouseAdapter()
23192424 {
....@@ -2332,6 +2437,48 @@
23322437 });
23332438 presetpanel.add(shadowShader);
23342439
2440
+ cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF);
2441
+ para0.setToolTipText("No parallax");
2442
+ para0.addMouseListener(new MouseAdapter()
2443
+ {
2444
+ public void mouseClicked(MouseEvent e)
2445
+ {
2446
+ parallaxField.setFloat(0.25);
2447
+
2448
+ materialtouched = true;
2449
+ applySelf();
2450
+ }
2451
+ });
2452
+ presetpanel.add(para0);
2453
+
2454
+ cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF);
2455
+ para1.setToolTipText("With parallax");
2456
+ para1.addMouseListener(new MouseAdapter()
2457
+ {
2458
+ public void mouseClicked(MouseEvent e)
2459
+ {
2460
+ parallaxField.setFloat(0.255);
2461
+
2462
+ materialtouched = true;
2463
+ applySelf();
2464
+ }
2465
+ });
2466
+ presetpanel.add(para1);
2467
+
2468
+ cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF);
2469
+ para2.setToolTipText("Reset parallax");
2470
+ para2.addMouseListener(new MouseAdapter()
2471
+ {
2472
+ public void mouseClicked(MouseEvent e)
2473
+ {
2474
+ parallaxField.setFloat(0.265);
2475
+
2476
+ materialtouched = true;
2477
+ applySelf();
2478
+ }
2479
+ });
2480
+ presetpanel.add(para2);
2481
+
23352482 cGridBag panel = new cGridBag().setVertical(true);
23362483
23372484 presetpanel.preferredWidth = 1;
....@@ -2348,19 +2495,19 @@
23482495
23492496 cGridBag editBar = new cGridBag().setVertical(false);
23502497
2351
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2498
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
23522499 createMaterialButton.setToolTipText("Create material");
23532500
23542501 /*
23552502 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
23562503 */
23572504
2358
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2505
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
23592506 clearMaterialButton.setToolTipText("Clear material");
23602507
23612508 if (Globals.ADVANCED)
23622509 {
2363
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2510
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
23642511 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
23652512 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
23662513 }
....@@ -2577,6 +2724,12 @@
25772724 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
25782725 colorSection.add(backlit);
25792726
2727
+ cGridBag parallax = new cGridBag();
2728
+ parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints);
2729
+ parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2730
+ parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.5, -0.25)); // , aConstraints);
2731
+ colorSection.add(parallax);
2732
+
25802733 //panel.add(new JSeparator());
25812734
25822735 //panel.add(globalSection);
....@@ -3628,6 +3781,7 @@
36283781 shadowField.setFloat(mat.shadow);
36293782 textureField.setFloat(mat.texture);
36303783 opacityField.setFloat(mat.opacity);
3784
+ parallaxField.setFloat(mat.parallax + 0.25f);
36313785 fakedepthField.setFloat(mat.fakedepth);
36323786 shadowbiasField.setFloat(mat.shadowbias);
36333787 bumpField.setInteger(1); // dec 2013
....@@ -4161,11 +4315,18 @@
41614315
41624316 void New()
41634317 {
4164
- while (copy.Size() > 1)
4318
+ while (copy.Size() > 0)
41654319 {
4166
- copy.remove(1);
4320
+ copy.remove(0);
41674321 }
41684322
4323
+ copy.selection.clear();
4324
+
4325
+ if (copy == Grafreed.grafreed.universe)
4326
+ {
4327
+ CreateCameras();
4328
+ cameraView.SetCamera(GetCamera(copy, 0));
4329
+ }
41694330 ResetModel();
41704331 objEditor.refreshContents();
41714332 }
....@@ -4845,6 +5006,7 @@
48455006 current.shadow = (float) shadowField.getFloat();
48465007 current.texture = (float) textureField.getFloat();
48475008 current.opacity = (float) opacityField.getFloat();
5009
+ current.parallax = (float) parallaxField.getFloat() - 0.25f;
48485010 current.fakedepth = (float) fakedepthField.getFloat();
48495011 current.shadowbias = (float) shadowbiasField.getFloat();
48505012
....@@ -4899,6 +5061,8 @@
48995061 textureField.SetToolTipValue((mat.texture));
49005062 if (!Equal(opacityField.getFloat(), mat.opacity))
49015063 opacityField.SetToolTipValue((mat.opacity));
5064
+ //if (!Equal(parallaxField.getFloat(), mat.parallax))
5065
+ parallaxField.SetToolTipValue((mat.parallax));
49025066 if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
49035067 fakedepthField.SetToolTipValue((mat.fakedepth));
49045068 if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
....@@ -6155,6 +6319,8 @@
61556319 cNumberSlider textureField;
61566320 JLabel opacityLabel;
61576321 cNumberSlider opacityField;
6322
+ JLabel parallaxLabel;
6323
+ cNumberSlider parallaxField;
61586324 JLabel fakedepthLabel;
61596325 cNumberSlider fakedepthField;
61606326 JLabel shadowbiasLabel;