Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
GroupEditor.java
....@@ -176,7 +176,6 @@
176176 copyItem.addActionListener(this);
177177 pasteItem = menu.add(new MenuItem("Paste"));
178178 pasteItem.addActionListener(this);
179
- menu.add("-");
180179
181180 menu.add("-");
182181 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -369,11 +368,11 @@
369368 billboardItem.addActionListener(this);
370369 csgItem = menu.add(new MenuItem("CSG"));
371370 csgItem.addActionListener(this);
372
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
373372 shadowXItem.addActionListener(this);
374
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
375374 shadowYItem.addActionListener(this);
376
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
377376 shadowZItem.addActionListener(this);
378377 if (Globals.ADVANCED)
379378 {
....@@ -637,19 +636,19 @@
637636
638637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
639638
640
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641640 twoButton.setToolTipText("Show center view only");
642641 twoButton.addActionListener(this);
643
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644643 fourButton.addActionListener(this);
645644 fourButton.setToolTipText("Show left panel only");
646
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647646 sixButton.setToolTipText("2-column layout left");
648647 sixButton.addActionListener(this);
649
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650649 threeButton.setToolTipText("2-column layout right");
651650 threeButton.addActionListener(this);
652
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
653652 sevenButton.setToolTipText("3-column layout");
654653 sevenButton.addActionListener(this);
655654 //
....@@ -664,32 +663,30 @@
664663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
665664 //clearButton.addActionListener(this);
666665
667
- cGridBag commandsPanel = new cGridBag();
668
-
669
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670667 editButton.setToolTipText("Edit selection");
671668 editButton.addActionListener(this);
672669
673
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674671 uneditButton.setToolTipText("Unedit selection");
675672 uneditButton.addActionListener(this);
676673
677
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
678675 allParamsButton.setToolTipText("Edit all params");
679676 allParamsButton.addActionListener(this);
680677
681
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682679 clearPanelButton.setToolTipText("Clear edit panel");
683680 clearPanelButton.addActionListener(this);
684681
685
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686683 unselectButton.setToolTipText("Unselect");
687684 unselectButton.addActionListener(this);
688685
689
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
690687
691
- oe.treePanel.add(commandsPanel);
692
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
693690
694691 // oe.aConstraints.gridx += 1;
695692 // oe.aConstraints.weighty = 0;
....@@ -811,11 +808,19 @@
811808 // debugCB.addItemListener(this);
812809
813810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
814812 oeilCB.addItemListener(this);
815813
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ if (Globals.ADVANCED)
819
+ {
816820 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
817821 lookAtCB.setToolTipText("Look-at target");
818822 lookAtCB.addItemListener(this);
823
+ }
819824
820825 }
821826
....@@ -830,6 +835,14 @@
830835 void EditObject(Object3D obj)
831836 {
832837 cRadio radioButton = new cRadio(obj.name);
838
+
839
+ // Patch to avoid bug with transparency.
840
+ radioButton.hadMaterial = obj.material != null;
841
+ if (!radioButton.hadMaterial)
842
+ {
843
+ obj.material = new cMaterial();
844
+ }
845
+
833846 radioButton.SetObject(obj);
834847 radioButton.layout = sevenButton;
835848 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -866,7 +879,9 @@
866879 JCheckBox speakerCameraCB;
867880 JCheckBox speakerFocusCB;
868881 JCheckBox debugCB;
882
+
869883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
870885 JCheckBox lookAtCB;
871886
872887 // static int COLOR = 1;
....@@ -969,6 +984,10 @@
969984 else if(e.getSource() == oeilCB)
970985 {
971986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
972991 }
973992 else if(e.getSource() == lookAtCB)
974993 {
....@@ -1454,6 +1473,7 @@
14541473 shadow.material = new cMaterial(obj.material);
14551474 shadow.material.diffuse = 0.0001f;
14561475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
14571477
14581478 makeSomething(shadow);
14591479 }
....@@ -3128,8 +3148,14 @@
31283148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
31293149 {
31303150 ab = (cRadio)e.nextElement();
3131
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
31323152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
31333159 buttonGroup.remove(ab);
31343160 radioPanel.remove(ab);
31353161