Normand Briere
2019-08-26 6266c8a4b2485b29a7d5bcb217460d7aad3e1c4a
Proto version slider.
8 files modified
378 ■■■■■ changed files
Camera.java 1 ●●●● patch | view | raw | blame | history
CameraPane.java 30 ●●●●● patch | view | raw | blame | history
GroupEditor.java 96 ●●●●● patch | view | raw | blame | history
ObjEditor.java 115 ●●●●● patch | view | raw | blame | history
Object3D.java 118 ●●●●● patch | view | raw | blame | history
RandomNode.java 11 ●●●● patch | view | raw | blame | history
cFileSystemModel.java 5 ●●●●● patch | view | raw | blame | history
cTree.java 2 ●●● patch | view | raw | blame | history
Camera.java
....@@ -112,6 +112,7 @@
112112
113113 material.shift = 90;
114114 material.cameralight = 0.2f;
115
+ material.shadowbias = 10;
115116 }
116117
117118 void setAspect(int width, int height)
CameraPane.java
....@@ -12952,12 +12952,7 @@
1295212952 "ADD temp.x, temp.x, one.x;" +
1295312953 "MUL normal, normal, temp.xxxx;":""
1295412954 ) +
12955
- /**/
12956
-//// Normalize("normal") +
12957
-//// "MAX normal.z, eps.x, normal.z;" +
12958
-// Normalize("normal") +
12959
- "MOV normald, normal;" +
12960
- "MOV normals, normal;" +
12955
+ /**/
1296112956
1296212957 "MOV temp, fragment.texcoord[4];" +
1296312958
....@@ -12975,6 +12970,17 @@
1297512970 "XPD U, V, normal;" +
1297612971 Normalize("U") +
1297712972
12973
+ "MOV temp, fragment.texcoord[0];" +
12974
+
12975
+// "MAD normal, -temp.x, U, normal;" +
12976
+// "MAD normal, -temp.y, V, normal;" +
12977
+// Normalize("normal") +
12978
+
12979
+//// "MAX normal.z, eps.x, normal.z;" +
12980
+// Normalize("normal") +
12981
+ "MOV normald, normal;" +
12982
+ "MOV normals, normal;" +
12983
+
1297812984 // parallax mapping
1297912985
1298012986 "DP3 temp2.x, V, eye;" +
....@@ -12987,17 +12993,15 @@
1298712993 "RCP temp2.w, temp2.w;" +
1298812994
1298912995 "SUB temp2.w, temp2.w, half;" +
12990
-// "SGE temp.x, temp2.w, eps.x;" +
12991
-// "MUL temp2.w, temp2.w, temp.x;" +
12996
+ // "SGE temp.x, temp2.w, eps.x;" +
12997
+ // "MUL temp2.w, temp2.w, temp.x;" +
1299212998
12993
- //"MOV texSamp, U;" +
12999
+ // "MOV texSamp, U;" +
1299413000
1299513001 "MUL temp2.z, temp2.z, temp2.w;" +
1299613002 "MUL temp2.z, temp2.z, params7.z;" + // parallax
1299713003
1299813004 "MUL temp2, temp2, temp2.z;" +
12999
-
13000
- "MOV temp, fragment.texcoord[0];" +
1300113005
1300213006 "SUB temp, temp, temp2;" +
1300313007
....@@ -14732,8 +14736,8 @@
1473214736 }
1473314737 }
1473414738 PingThread pingthread = new PingThread();
14735
- int delta = 5;
14736
- int speed = 5;
14739
+ int delta = 2;
14740
+ int speed = 10;
1473714741 boolean autorepeat = false;
1473814742
1473914743 void GoDown(int mod)
GroupEditor.java
....@@ -765,11 +765,11 @@
765765 shadowYItem.addActionListener(this);
766766 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
767767 shadowZItem.addActionListener(this);
768
- attributeItem = menu.add(new MenuItem("Attribute"));
769
- attributeItem.addActionListener(this);
770768
771769 if (Globals.ADVANCED)
772770 {
771
+ attributeItem = menu.add(new MenuItem("Attribute"));
772
+ attributeItem.addActionListener(this);
773773 menu.add("-");
774774 linkerItem = menu.add(new MenuItem("Linker"));
775775 linkerItem.addActionListener(this);
....@@ -779,11 +779,18 @@
779779 pointflowItem.addActionListener(this);
780780 }
781781 menu.add("-");
782
+ textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red"));
783
+ textureRatioRItem.addActionListener(this);
784
+ textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green"));
785
+ textureRatioGItem.addActionListener(this);
786
+ textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue"));
787
+ textureRatioBItem.addActionListener(this);
788
+ menu.add("-");
782789 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
783790 resetTransformItem.addActionListener(this);
784791 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
785792 resetCentroidItem.addActionListener(this);
786
- resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
793
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ"));
787794 resetCentroidXZItem.addActionListener(this);
788795 transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
789796 transformGeometryItem.addActionListener(this);
....@@ -1217,7 +1224,7 @@
12171224 torusButton.setToolTipText("Create torus");
12181225 torusButton.addActionListener(this);
12191226
1220
- if (Globals.ADVANCED)
1227
+ if (false) //Globals.ADVANCED)
12211228 {
12221229 oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12231230 kleinButton.setToolTipText("Create Klein bottle");
....@@ -1493,7 +1500,7 @@
14931500
14941501 void EditObject(Object3D obj)
14951502 {
1496
- assert(obj instanceof Composite);
1503
+ //assert(obj instanceof Composite);
14971504
14981505 // if (obj.versionlist == null)
14991506 // {
....@@ -3612,6 +3619,18 @@
36123619 {
36133620 TransformChildren();
36143621 } else
3622
+ if (source == textureRatioRItem)
3623
+ {
3624
+ TextureRatio(0);
3625
+ } else
3626
+ if (source == textureRatioGItem)
3627
+ {
3628
+ TextureRatio(1);
3629
+ } else
3630
+ if (source == textureRatioBItem)
3631
+ {
3632
+ TextureRatio(2);
3633
+ } else
36153634 if (source == resetTransformItem)
36163635 {
36173636 ResetTransform();
....@@ -3984,7 +4003,8 @@
39844003 if (source == closeButton)
39854004 {
39864005 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3987
- Replace();
4006
+ if (copy.versionlist != null)
4007
+ Replace();
39884008
39894009 cRadio ab;
39904010 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
....@@ -4084,7 +4104,8 @@
40844104 } else
40854105 if(source instanceof cRadio)
40864106 {
4087
- Replace();
4107
+ if (copy.versionlist != null)
4108
+ Replace();
40884109
40894110 group.parent = keepparent;
40904111 group.attributes = 0;
....@@ -4137,7 +4158,7 @@
41374158 */
41384159 radio.layout.doClick();
41394160
4140
- assert(copy instanceof Composite);
4161
+ //assert(copy instanceof Composite);
41414162
41424163 if (copy.versionlist == null)
41434164 {
....@@ -4148,7 +4169,7 @@
41484169 // and check if any of these nodes are reachable below the root.
41494170 Grafreed.grafreed.universe.TagObjects(copy, true);
41504171
4151
- if (copy.versionlist == null && !copy.HasTags())
4172
+ if (copy instanceof Composite && copy.versionlist == null && !copy.HasTags())
41524173 {
41534174 copy.versionlist = new Object3D[100];
41544175
....@@ -4275,6 +4296,18 @@
42754296 refreshContents();
42764297 }
42774298
4299
+ void TextureRatio(int axis)
4300
+ {
4301
+ Object3D obj;
4302
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4303
+ {
4304
+ obj = (Object3D)e.nextElement();
4305
+ obj.TextureRatio(axis);
4306
+ }
4307
+
4308
+ refreshContents();
4309
+ }
4310
+
42784311 void ResetTransform()
42794312 {
42804313 ResetTransform(-1);
....@@ -4290,38 +4323,8 @@
42904323 if (obj.toParent == null)
42914324 continue;
42924325
4293
- if (mask == -1)
4294
- {
4295
- if (obj instanceof Camera) // jan 2014
4296
- {
4297
- LA.matIdentity(obj.toParent);
4298
- LA.matIdentity(obj.fromParent);
4299
- }
4300
- else
4301
- {
4302
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
4303
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
4304
- }
4305
- TouchTransform(obj);
4306
- continue;
4307
- }
4308
- if ((mask&2) != 0) // Scale/rotation
4309
- {
4310
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
4311
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4312
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4313
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4314
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4315
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4316
- }
4317
- if ((mask&1) != 0) // Translation
4318
- {
4319
- if (obj.toParent != null)
4320
- {
4321
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4322
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4323
- }
4324
- }
4326
+ obj.ResetTransform(mask);
4327
+
43254328 if (obj.parent == null)
43264329 {
43274330 System.out.println("NULL PARENT!");
....@@ -4829,6 +4832,12 @@
48294832 for (int i=0; i<group.selection.size(); i++)
48304833 {
48314834 Object3D obj = group.selection.get(i);
4835
+
4836
+ if (obj.toParent == null)
4837
+ {
4838
+ obj.toParent = LA.newMatrix();
4839
+ obj.fromParent = LA.newMatrix();
4840
+ }
48324841
48334842 LA.matTranslate(obj.toParent, i * scale, 0, 0);
48344843 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
....@@ -5412,7 +5421,7 @@
54125421 }
54135422 }
54145423
5415
- rootButton.setEnabled(allComposites);
5424
+ rootButton.setEnabled(true); // allComposites);
54165425 }
54175426
54185427 void refreshContents(boolean cp)
....@@ -6392,6 +6401,9 @@
63926401 private MenuItem maxTexturesItem;
63936402 private MenuItem panoTexturesItem;
63946403
6404
+ private MenuItem textureRatioRItem;
6405
+ private MenuItem textureRatioGItem;
6406
+ private MenuItem textureRatioBItem;
63956407 private MenuItem resetCentroidItem;
63966408 private MenuItem resetCentroidXZItem;
63976409 private MenuItem resetTransformItem;
ObjEditor.java
....@@ -316,6 +316,8 @@
316316 objEditor.ctrlPanel.remove(setupPanel2);
317317 objEditor.ctrlPanel.remove(objectCommandsPanel);
318318 objEditor.ctrlPanel.remove(pushPanel);
319
+ if (versionPanel != null)
320
+ objEditor.ctrlPanel.remove(versionPanel);
319321 //objEditor.ctrlPanel.remove(fillPanel);
320322
321323 //Remove(normalpushField);
....@@ -1163,6 +1165,7 @@
11631165 cGridBag setupPanel2;
11641166 cGridBag objectCommandsPanel;
11651167 cGridBag pushPanel;
1168
+ cGridBag versionPanel;
11661169 cGridBag fillPanel;
11671170
11681171 JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
....@@ -1409,9 +1412,14 @@
14091412 oe.ctrlPanel.add(objectCommandsPanel);
14101413 oe.ctrlPanel.Return();
14111414
1412
- pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1415
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH * 100, 1.1); // To have the buttons
14131416 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1414
- //Return();
1417
+ if (false && copy.versionlist != null && copy.versionindex != -1)
1418
+ {
1419
+ oe.ctrlPanel.Return();
1420
+ versionPanel = AddSlider(oe.ctrlPanel, "Version", 0, copy.VersionCount() - 1, copy.versionindex);
1421
+ versionField = (cNumberSlider)versionPanel.getComponent(1);
1422
+ }
14151423
14161424 oe.ctrlPanel.Return();
14171425
....@@ -2421,7 +2429,7 @@
24212429 cameraField.setFloat(0.001);
24222430 specularField.setFloat(0.001);
24232431 fakedepthField.setFloat(0.001);
2424
- opacityField.setFloat(0.6);
2432
+ opacityField.setFloat(0.4);
24252433
24262434 materialtouched = true;
24272435 applySelf();
....@@ -4067,6 +4075,7 @@
40674075 } else if (event.getSource() == link2masterCB)
40684076 {
40694077 copy.link2master ^= true;
4078
+ objEditor.refreshContents();
40704079 return;
40714080 }
40724081 if (event.getSource() == randomCB)
....@@ -4457,7 +4466,7 @@
44574466 copy.versionindex -= 1;
44584467
44594468 if (copy.versionindex != -1)
4460
- CopyChanged();
4469
+ CopyChanged(copy);
44614470
44624471 SetVersionStates();
44634472 }
....@@ -4539,20 +4548,20 @@
45394548 {
45404549 Object3D selection = new Object3D();
45414550
4542
- for (int i = 0; i < copy.selection.size(); i++)
4551
+ for (int i = 0; i < objEditor.copy.selection.size(); i++)
45434552 {
4544
- Object3D elem = copy.selection.elementAt(i);
4553
+ Object3D elem = objEditor.copy.selection.elementAt(i);
45454554
4546
- Object3D obj = copy.GetObject(elem.GetUUID());
4555
+ Object3D obj = objEditor.copy.GetObject(elem.GetUUID());
45474556
45484557 if (obj == null)
45494558 {
4550
- copy.selection.remove(i--);
4559
+ objEditor.copy.selection.remove(i--);
45514560 }
45524561 else
45534562 {
45544563 selection.add(obj);
4555
- copy.selection.setElementAt(obj, i);
4564
+ objEditor.copy.selection.setElementAt(obj, i);
45564565 }
45574566 }
45584567
....@@ -4565,44 +4574,43 @@
45654574 //refreshContents(false);
45664575 }
45674576
4568
- void CopyChanged()
4577
+ void CopyChanged(Object3D changed)
45694578 {
4570
- Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4571
-
4572
- SetVersionStates();
4579
+ Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]);
45734580
45744581 boolean temp = CameraPane.SWITCH;
45754582 CameraPane.SWITCH = false;
45764583
4577
- copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
4584
+ changed.ExtractBigData(Grafreed.grafreed.universe.versiontable);
45784585
4579
- copy.clear();
4586
+ changed.clear();
45804587
4581
- copy.skyboxname = obj.skyboxname;
4582
- copy.skyboxext = obj.skyboxext;
4588
+ changed.skyboxname = obj.skyboxname;
4589
+ changed.skyboxext = obj.skyboxext;
45834590
45844591 for (int i=0; i<obj.Size(); i++)
45854592 {
4586
- copy.add(obj.get(i));
4593
+ changed.add(obj.get(i));
45874594 }
45884595
4589
- copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
4596
+ changed.RestoreBigData(Grafreed.grafreed.universe.versiontable);
45904597
45914598 CameraPane.SWITCH = temp;
45924599
4593
- RefreshSelection();
4600
+ if (objEditor == this)
4601
+ RefreshSelection();
45944602 //assert(hashtable.isEmpty());
45954603
4596
- copy.Touch();
4604
+ objEditor.copy.Touch();
45974605
45984606 ResetModel();
4599
- copy.HardTouch(); // recompile?
4607
+ objEditor.copy.HardTouch(); // recompile?
46004608
46014609 cRadio ab;
4602
- for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4610
+ for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();)
46034611 {
46044612 ab = (cRadio)e.nextElement();
4605
- Object3D test = copy.GetObject(ab.object.GetUUID());
4613
+ Object3D test = objEditor.copy.GetObject(ab.object.GetUUID());
46064614 //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
46074615 if (test != null)
46084616 {
....@@ -4611,7 +4619,7 @@
46114619 }
46124620 }
46134621
4614
- refreshContents(true);
4622
+ objEditor.refreshContents(true);
46154623 }
46164624
46174625 cButton previousVersionButton;
....@@ -4625,15 +4633,7 @@
46254633
46264634 int VersionCount()
46274635 {
4628
- int count = 0;
4629
-
4630
- for (int i = copy.versionlist.length; --i >= 0;)
4631
- {
4632
- if (copy.versionlist[i] != null)
4633
- count++;
4634
- }
4635
-
4636
- return count;
4636
+ return copy.VersionCount();
46374637 }
46384638
46394639 public cGridBag versionSliderPane;
....@@ -4707,7 +4707,9 @@
47074707
47084708 copy.versionindex -= 1;
47094709
4710
- CopyChanged();
4710
+ CopyChanged(copy);
4711
+
4712
+ SetVersionStates();
47114713
47124714 return true;
47134715 }
....@@ -4725,7 +4727,9 @@
47254727 }
47264728
47274729 //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4728
- CopyChanged();
4730
+ CopyChanged(copy);
4731
+
4732
+ SetVersionStates();
47294733
47304734 return true;
47314735 }
....@@ -4762,10 +4766,12 @@
47624766
47634767 copy.versionindex += 1;
47644768
4765
- CopyChanged();
4769
+ CopyChanged(copy);
47664770
47674771 //if (!tab.user[tab.versionindex])
47684772 // tab.graphs[tab.versionindex] = null;
4773
+
4774
+ SetVersionStates();
47694775 }
47704776
47714777 void ImportGFD()
....@@ -5094,6 +5100,7 @@
50945100 }
50955101
50965102 cNumberSlider versionSlider;
5103
+ cNumberSlider versionField;
50975104
50985105 public void stateChanged(ChangeEvent e)
50995106 {
....@@ -5110,12 +5117,26 @@
51105117 if (version != -1 && copy.versionlist[version] != null)
51115118 {
51125119 copy.versionindex = version;
5113
- CopyChanged();
5120
+ CopyChanged(copy);
5121
+ SetVersionStates();
51145122 }
51155123
51165124 return;
51175125 }
51185126
5127
+ if (e.getSource() == versionField)
5128
+ {
5129
+ int version = versionField.getInteger();
5130
+
5131
+ if (version != -1 && copy.versionindex != version && copy.versionlist[version] != null)
5132
+ {
5133
+ copy.versionindex = version;
5134
+ CopyChanged(copy);
5135
+ }
5136
+
5137
+ return;
5138
+ }
5139
+
51195140 if (freezematerial)
51205141 {
51215142 return;
....@@ -5205,7 +5226,7 @@
52055226 }
52065227
52075228 if (normalpushField != null)
5208
- copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
5229
+ copy.NORMALPUSH = (float)normalpushField.getFloat() / 100;
52095230 }
52105231
52115232 void SnapObject()
....@@ -5579,7 +5600,7 @@
55795600 void ResetModel()
55805601 {
55815602 //assert(copy instanceof Composite);
5582
- Object3D /*Composite*/ group = (Object3D /*Composite*/) copy;
5603
+ Object3D /*Composite*/ group = (Object3D /*Composite*/) objEditor.copy;
55835604
55845605 // necessary? group.selection = new Object3D(); // java.util.Vector();
55855606
....@@ -5590,14 +5611,14 @@
55905611 //group.refreshEditWindow();
55915612 //refreshContents();
55925613
5593
- if (copy.selection == null)
5614
+ if (objEditor.copy.selection == null)
55945615 {
5595
- copy.selection = new Object3D();
5616
+ objEditor.copy.selection = new Object3D();
55965617 }
55975618
5598
- for (int j = 0; j < copy.selection.size(); j++)
5619
+ for (int j = 0; j < objEditor.copy.selection.size(); j++)
55995620 {
5600
- Object3D item = copy.selection.get(j);
5621
+ Object3D item = objEditor.copy.selection.get(j);
56015622
56025623 if (item instanceof cGroup && ((cGroup) item).transientlink)
56035624 {
....@@ -5606,15 +5627,15 @@
56065627
56075628 if (item.count <= 1) // ??? == 0)
56085629 {
5609
- copy.selection.remove(item);
5630
+ objEditor.copy.selection.remove(item);
56105631 }
56115632 }
56125633
56135634 boolean first = true;
56145635
5615
- for (int i = copy.selection.size(); --i >= 0;)
5636
+ for (int i = objEditor.copy.selection.size(); --i >= 0;)
56165637 {
5617
- Object3D item = copy.selection.get(i);
5638
+ Object3D item = objEditor.copy.selection.get(i);
56185639
56195640 if (item instanceof cGroup && ((cGroup) item).transientlink)
56205641 {
Object3D.java
....@@ -40,6 +40,19 @@
4040
4141 ScriptNode scriptnode;
4242
43
+ int VersionCount()
44
+ {
45
+ int count = 0;
46
+
47
+ for (int i = versionlist.length; --i >= 0;)
48
+ {
49
+ if (versionlist[i] != null)
50
+ count++;
51
+ }
52
+
53
+ return count;
54
+ }
55
+
4356 void InitOthers()
4457 {
4558 if (projectedVertices == null || projectedVertices.length <= 2)
....@@ -568,11 +581,11 @@
568581 }
569582 }
570583
571
- int memorysize;
584
+ transient int memorysize; // needs to be transient, dunno why
572585
573586 int MemorySize()
574587 {
575
- if (true) // memorysize == 0)
588
+ if (memorysize == 0)
576589 {
577590 try
578591 {
....@@ -3264,6 +3277,93 @@
32643277 blockloop = false;
32653278 }
32663279
3280
+ public void ResetTransform(int mask)
3281
+ {
3282
+ Object3D obj = this;
3283
+
3284
+ if (mask == -1)
3285
+ {
3286
+ if (obj instanceof Camera) // jan 2014
3287
+ {
3288
+ LA.matIdentity(obj.toParent);
3289
+ LA.matIdentity(obj.fromParent);
3290
+ }
3291
+ else
3292
+ {
3293
+ obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
3294
+ obj.fromParent = null; // LA.matIdentity(obj.fromParent);
3295
+ }
3296
+ return;
3297
+ }
3298
+
3299
+ if ((mask&2) != 0) // Scale/rotation
3300
+ {
3301
+ obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
3302
+ obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
3303
+ obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
3304
+ obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
3305
+ obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
3306
+ obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
3307
+ }
3308
+ if ((mask&1) != 0) // Translation
3309
+ {
3310
+ if (obj.toParent != null)
3311
+ {
3312
+ obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
3313
+ obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
3314
+ }
3315
+ }
3316
+ }
3317
+
3318
+ public void TextureRatioTransform(int axis)
3319
+ {
3320
+ cTexture tex = GetTextures();
3321
+
3322
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3323
+
3324
+ try
3325
+ {
3326
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, texres);
3327
+ }
3328
+ catch (Exception e)
3329
+ {
3330
+ System.err.println("FAIL TextureRatio: " + this);
3331
+ }
3332
+
3333
+ LA.matIdentity(Object3D.mat);
3334
+ Object3D.mat[axis][axis] = (double)texturedata.getWidth() / texturedata.getHeight();
3335
+
3336
+ if (toParent == null)
3337
+ {
3338
+ toParent = LA.newMatrix();
3339
+ fromParent = LA.newMatrix();
3340
+ }
3341
+
3342
+ ResetTransform(2);
3343
+
3344
+ LA.matConcat(Object3D.mat, fromParent, fromParent);
3345
+ LA.matInvert(fromParent, toParent);
3346
+ }
3347
+
3348
+ void TextureRatio(int axis)
3349
+ {
3350
+ if (blockloop)
3351
+ return;
3352
+
3353
+ blockloop = true;
3354
+
3355
+ TextureRatioTransform(axis);
3356
+
3357
+ for (int i=Size(); --i>=0;)
3358
+ {
3359
+ Object3D v = get(i);
3360
+
3361
+ v.TextureRatio(axis);
3362
+ }
3363
+
3364
+ blockloop = false;
3365
+ }
3366
+
32673367 void TransformChildren()
32683368 {
32693369 if (toParent != null)
....@@ -5969,6 +6069,11 @@
59696069 return parent.IsLive();
59706070 }
59716071
6072
+ boolean IsDynamic()
6073
+ {
6074
+ return live && bRep != null;
6075
+ }
6076
+
59726077 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
59736078 {
59746079 Invariants(); // june 2013
....@@ -6029,7 +6134,8 @@
60296134 if (support != null)
60306135 support = support;
60316136
6032
- boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6137
+ boolean usecalllists = !IsDynamic() &&
6138
+ IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
60336139 //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
60346140
60356141 //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
....@@ -8075,10 +8181,10 @@
80758181 } // + super.toString();
80768182 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
80778183
8078
- if (!Globals.ADVANCED)
8079
- return objname;
8184
+// if (!Globals.ADVANCED)
8185
+// return objname;
80808186
8081
- return objname + " " + System.identityHashCode(this);
8187
+ return objname + " " + System.identityHashCode(this); // + GetUUID()
80828188 }
80838189
80848190 public int hashCode()
RandomNode.java
....@@ -25,9 +25,14 @@
2525 // return 1;
2626 // }
2727
28
+ boolean IsSwitch()
29
+ {
30
+ return CameraPane.SWITCH && !this.link2master;
31
+ }
32
+
2833 public int size()
2934 {
30
- if (CameraPane.SWITCH)
35
+ if (IsSwitch())
3136 {
3237 if (super.size() > 0)
3338 return 1;
....@@ -88,7 +93,7 @@
8893
8994 public Object3D reserve(int i)
9095 {
91
- if (!CameraPane.SWITCH)
96
+ if (!IsSwitch())
9297 return super.reserve(i);
9398
9499 //assert(rnd == -1);
....@@ -160,7 +165,7 @@
160165
161166 public void release(int i)
162167 {
163
- if (!CameraPane.SWITCH)
168
+ if (!IsSwitch())
164169 {
165170 super.release(i);
166171 return;
cFileSystemModel.java
....@@ -110,8 +110,9 @@
110110 hasFocus);
111111
112112 String valueString = value.toString();
113
+ String lcString = valueString.toLowerCase();
113114
114
- if (valueString.toLowerCase().endsWith(".gfd") || valueString.toLowerCase().endsWith(".obj") || valueString.toLowerCase().endsWith(".3ds"))
115
+ if (lcString.endsWith(".gfd") || lcString.endsWith(".obj") || lcString.endsWith(".3ds"))
115116 {
116117 if (true)
117118 {
....@@ -138,7 +139,7 @@
138139
139140 if (rendererIcon == null)
140141 {
141
- rendererIcon = new javax.swing.ImageIcon();
142
+ rendererIcon = ObjEditor.GetIcon("icons/primitives.png");
142143 }
143144
144145 icons.put(valueTruncated, rendererIcon);
cTree.java
....@@ -21,7 +21,7 @@
2121 public void mousePressed(MouseEvent e)
2222 {
2323 //if (e.isPopupTrigger()) // Works only on mouse released on Windows.
24
- if ((e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
24
+ if (e.getModifiers() == InputEvent.BUTTON3_MASK)
2525 {
2626 int row = getClosestRowForLocation(e.getX(), e.getY());
2727 if (!isRowSelected(row))