Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
GroupEditor.java
....@@ -808,11 +808,19 @@
808808 // debugCB.addItemListener(this);
809809
810810 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
811812 oeilCB.addItemListener(this);
812813
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
+ {
813820 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814821 lookAtCB.setToolTipText("Look-at target");
815822 lookAtCB.addItemListener(this);
823
+ }
816824
817825 }
818826
....@@ -827,6 +835,14 @@
827835 void EditObject(Object3D obj)
828836 {
829837 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
+
830846 radioButton.SetObject(obj);
831847 radioButton.layout = sevenButton;
832848 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -863,7 +879,9 @@
863879 JCheckBox speakerCameraCB;
864880 JCheckBox speakerFocusCB;
865881 JCheckBox debugCB;
882
+
866883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
867885 JCheckBox lookAtCB;
868886
869887 // static int COLOR = 1;
....@@ -966,6 +984,10 @@
966984 else if(e.getSource() == oeilCB)
967985 {
968986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
969991 }
970992 else if(e.getSource() == lookAtCB)
971993 {
....@@ -3126,8 +3148,14 @@
31263148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
31273149 {
31283150 ab = (cRadio)e.nextElement();
3129
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
31303152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
31313159 buttonGroup.remove(ab);
31323160 radioPanel.remove(ab);
31333161