Normand Briere
2019-11-07 f868664f7e7626f651e6ade9c9f6863851ef43b7
Dangerous "reset".
8 files modified
1 files added
96 ■■■■■ changed files
Biparam.java 6 ●●●●● patch | view | raw | blame | history
Camera.java 7 ●●●● patch | view | raw | blame | history
CameraPane.java 9 ●●●●● patch | view | raw | blame | history
Composite.java 48 ●●●●● patch | view | raw | blame | history
GroupEditor.java 3 ●●●●● patch | view | raw | blame | history
ObjEditor.java 1 ●●●● patch | view | raw | blame | history
Object3D.java 14 ●●●●● patch | view | raw | blame | history
SuperEditor.java 8 ●●●● patch | view | raw | blame | history
icons/scenes.jpg patch | view | raw | blame | history
Biparam.java
....@@ -37,6 +37,12 @@
3737 bRep.SetVertex(v, i);
3838 }
3939
40
+ if (reset)
41
+ {
42
+ this.recalculate();
43
+ reset = false;
44
+ }
45
+
4046 super.DrawNode(display, root, selected);
4147 }
4248
Camera.java
....@@ -388,8 +388,13 @@
388388 locationBuf.y = location.y * K + locationBuf.y * (1 - K);
389389 lookAtBuf.y = lookAt.y * K + lookAtBuf.y * (1 - K);
390390
391
+ int Y = 1;
392
+
393
+ if (UP.y < 0)
394
+ Y = -1;
395
+
391396 UP.x = 0 * K + UP.x * (1 - K);
392
- UP.y = 1 * K + UP.y * (1 - K);
397
+ UP.y = Y * K + UP.y * (1 - K);
393398 UP.z = 0 * K + UP.z * (1 - K);
394399 UP.normalize();
395400
CameraPane.java
....@@ -15647,7 +15647,8 @@
1564715647 {
1564815648 // Set the blank cursor to the JFrame.
1564915649 //object.editWindow.frame.
15650
- setCursor(blankCursor);
15650
+ if (Globals.ADVANCED)
15651
+ setCursor(blankCursor); // Contaminates other apps!
1565115652
1565215653 if (key >= '0' && key <= '5')
1565315654 clampbit = (key-'0');
....@@ -16112,12 +16113,14 @@
1611216113 }
1611316114 repaint();
1611416115 break;
16116
+ case '.':
16117
+ Globals.ONESTEP = true;
16118
+ repaint();
16119
+ break;
1611516120 case BACKSPACE:
1611616121 // almost working enablebackspace = true;
1611716122 Globals.WALK ^= true;
1611816123
16119
- object.Step();
16120
- object.Touch();
1612116124 // SwitchCameras(false);
1612216125 repaint();
1612316126 break;
Composite.java
....@@ -543,33 +543,49 @@
543543
544544 void SoftTouch()
545545 {
546
- super.SoftTouch();
547
- for (int i = 0; i < Children().size(); i++)
546
+ if (blockloop)
548547 {
549
- Object3D obj = (Object3D) Children().reserve(i);
550
-
551
- if (obj == null)
552
- continue;
553
-
554
- if (obj.material == null)
555
- {
556
- obj.SoftTouch();
557
- }
558
- Children().release(i);
548
+ return;
559549 }
550
+
551
+ blockloop = true;
552
+
553
+ super.SoftTouch();
554
+
555
+ for (int i = 0; i < Size(); i++)
556
+ {
557
+ Object3D child = (Object3D) get(i);
558
+ if (child == null)
559
+ continue;
560
+ if (child.material == null)
561
+ {
562
+ child.SoftTouch();
563
+ }
564
+ }
565
+
566
+ blockloop = false;
560567 }
561568
562569 void HardTouch()
563570 {
564
- super.HardTouch();
565
- for (int i = 0; i < Children().size(); i++)
571
+ if (blockloop)
566572 {
567
- Object3D child = (Object3D) Children().reserve(i);
573
+ return;
574
+ }
575
+
576
+ blockloop = true;
577
+
578
+ super.HardTouch();
579
+
580
+ for (int i = 0; i < Size(); i++)
581
+ {
582
+ Object3D child = (Object3D) get(i);
568583 if (child == null)
569584 continue;
570585 child.HardTouch();
571
- Children().release(i);
572586 }
587
+
588
+ blockloop = false;
573589 }
574590
575591 // void ClearMaterial()
GroupEditor.java
....@@ -2042,8 +2042,11 @@
20422042 animationItem.addItemListener(this);
20432043 animationItem.setState(Globals.ANIMATION);
20442044
2045
+ if (Globals.ADVANCED)
2046
+ {
20452047 menu.add(archiveItem = new MenuItem("Archive3D..."));
20462048 archiveItem.addActionListener(this);
2049
+ }
20472050
20482051 menu.add("-");
20492052 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
ObjEditor.java
....@@ -5064,6 +5064,7 @@
50645064
50655065 ResetModel();
50665066 objEditor.copy.HardTouch(); // recompile?
5067
+ Globals.lighttouched = true;
50675068
50685069 cRadio ab;
50695070 for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();)
Object3D.java
....@@ -5711,8 +5711,9 @@
57115711 {
57125712 }
57135713 // transient int displaylist = 0; // -1;
5714
- transient boolean touched = true;
5715
- transient boolean softtouched = true;
5714
+ transient boolean reset = false; // Recalculate
5715
+ transient boolean touched = true; // call list only
5716
+ transient boolean softtouched = true; // aucune idee
57165717
57175718 void Touch()
57185719 {
....@@ -5765,6 +5766,7 @@
57655766 {
57665767 //System.out.println("HardTouch " + this); // new Exception().printStackTrace();
57675768 //new Exception().printStackTrace();
5769
+ reset = true;
57685770 touched = true;
57695771 CameraPane.touched = true;
57705772 //if (parent != null)
....@@ -6624,7 +6626,7 @@
66246626 }
66256627 }
66266628
6627
- assert (!(this instanceof Composite));
6629
+ // Bezier surface: assert (!(this instanceof Composite));
66286630 {
66296631 // CRASH MOCAP!! for (int i = 0; i < size(); i++)
66306632 // {
....@@ -6905,11 +6907,11 @@
69056907
69066908 if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
69076909 return;
6908
-
6909
- if (hide)
6910
- return;
69116910 }
69126911
6912
+ if (hide)
6913
+ return;
6914
+
69136915 if (scriptnode != null)
69146916 {
69156917 scriptnode.DrawNode(display, root, selected);
SuperEditor.java
....@@ -52,13 +52,13 @@
5252 northPanel = new cGridBag();
5353
5454 northPanel.add(northLabel = new JLabel("XY factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
55
- northPanel.add(northField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
55
+ northPanel.add(northField = new cNumberSlider(this, 0.0001,3, 1.1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
5656 oe.ctrlPanel.add(northPanel);
5757
5858 oe.ctrlPanel.Return();
5959 eastPanel = new cGridBag();
6060 eastPanel.add(eastLabel = new JLabel("Z factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
61
- eastPanel.add(eastField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
61
+ eastPanel.add(eastField = new cNumberSlider(this, 0.0001,3, 1.1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
6262 oe.ctrlPanel.add(eastPanel);
6363
6464 oe.ctrlPanel.Return();
....@@ -171,8 +171,8 @@
171171 public void applySelf()
172172 {
173173 super.applySelf();
174
- superE.north = northField.getFloat();
175
- superE.east = eastField.getFloat();
174
+ superE.north = northField.getFloat() * 2;
175
+ superE.east = eastField.getFloat() * 2;
176176 superE.recalculate();
177177 }
178178
icons/scenes.jpg
Binary files differ