Normand Briere
2019-08-23 60cec91731a350fe67e9b5ffe7a00d70e9026314
Object3D.java
....@@ -36,6 +36,8 @@
3636 Object3D versionlist[];
3737 int versionindex = -1;
3838
39
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
40
+
3941 ScriptNode scriptnode;
4042
4143 void InitOthers()
....@@ -269,6 +271,50 @@
269271 //
270272 // return null;
271273 // }
274
+
275
+ transient boolean tag;
276
+
277
+ void TagObjects(Object3D o, boolean tag)
278
+ {
279
+ if (blockloop)
280
+ return;
281
+
282
+ o.tag = tag;
283
+
284
+ if (o == this)
285
+ return;
286
+
287
+ blockloop = true;
288
+
289
+ for (int i=0; i<Size(); i++)
290
+ {
291
+ get(i).TagObjects(o, tag);
292
+ }
293
+
294
+ blockloop = false;
295
+ }
296
+
297
+ boolean HasTags()
298
+ {
299
+ if (blockloop)
300
+ return false;
301
+
302
+ blockloop = true;
303
+
304
+ boolean hasTags = false;
305
+
306
+ for (int i=0; i<Size(); i++)
307
+ {
308
+ hasTags |= get(i).tag || get(i).HasTags();
309
+
310
+ if (hasTags)
311
+ break;
312
+ }
313
+
314
+ blockloop = false;
315
+
316
+ return hasTags;
317
+ }
272318
273319 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
274320 {
....@@ -641,7 +687,7 @@
641687 {
642688 if (maxcount != 1)
643689 {
644
- new Exception().printStackTrace();
690
+ //new Exception().printStackTrace();
645691 }
646692
647693 toParentMarked = LA.newMatrix();
....@@ -2323,11 +2369,6 @@
23232369
23242370 InitOthers();
23252371
2326
- if (this instanceof Camera)
2327
- {
2328
- material.shift = 90;
2329
- }
2330
-
23312372 material.multiply = multiply;
23322373
23332374 if (multiply)
....@@ -3576,15 +3617,47 @@
35763617
35773618 void ClearMaterials()
35783619 {
3620
+ if (blockloop)
3621
+ return;
3622
+
3623
+ blockloop = true;
3624
+
35793625 ClearMaterial();
3580
- for (int i = 0; i < size(); i++)
3626
+ for (int i = 0; i < Size(); i++)
35813627 {
3582
- Object3D child = (Object3D) reserve(i);
3628
+ Object3D child = (Object3D) get(i);
35833629 if (child == null)
35843630 continue;
35853631 child.ClearMaterials();
3586
- release(i);
35873632 }
3633
+
3634
+ blockloop = false;
3635
+ }
3636
+
3637
+ void ClearVersionList()
3638
+ {
3639
+ this.versionlist = null;
3640
+ this.versionindex = -1;
3641
+ this.versiontable = null;
3642
+ }
3643
+
3644
+ void ClearVersions()
3645
+ {
3646
+ if (blockloop)
3647
+ return;
3648
+
3649
+ blockloop = true;
3650
+
3651
+ ClearVersionList();
3652
+ for (int i = 0; i < Size(); i++)
3653
+ {
3654
+ Object3D child = (Object3D) get(i);
3655
+ if (child == null)
3656
+ continue;
3657
+ child.ClearVersions();
3658
+ }
3659
+
3660
+ blockloop = false;
35883661 }
35893662
35903663 void FlipV(boolean flip)
....@@ -7638,7 +7711,9 @@
76387711
76397712 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
76407713
7641
- if (modified || opposite)
7714
+ // Modified could snap
7715
+ if (//modified ||
7716
+ opposite)
76427717 {
76437718 //assert(false);
76447719 /*
....@@ -7732,7 +7807,7 @@
77327807
77337808 if (modified)
77347809 {
7735
- // Rotate 90 degrees
7810
+ // Rotate 45 degrees
77367811 angle /= (Math.PI / 4);
77377812 angle = Math.floor(angle + 0.5);
77387813 angle *= (Math.PI / 4);
....@@ -7818,7 +7893,7 @@
78187893 case 3: // '\001'
78197894 if (modified || opposite)
78207895 {
7821
- if (modified && opposite)
7896
+ if (modified) // && opposite)
78227897 LA.matScale(toParent, totalScale, totalScale, totalScale);
78237898 else
78247899 //LA.matScale(toParent, 1, hScale, vScale);
....@@ -7834,7 +7909,7 @@
78347909 case 2: // '\002'
78357910 if (modified || opposite)
78367911 {
7837
- if (modified && opposite)
7912
+ if (modified) // && opposite)
78387913 LA.matScale(toParent, totalScale, totalScale, totalScale);
78397914 else
78407915 //LA.matScale(toParent, hScale, 1, vScale);
....@@ -7848,7 +7923,7 @@
78487923 case 1: // '\003'
78497924 if (modified || opposite)
78507925 {
7851
- if (modified && opposite)
7926
+ if (modified) // && opposite)
78527927 LA.matScale(toParent, totalScale, totalScale, totalScale);
78537928 else
78547929 //LA.matScale(toParent, hScale, vScale, 1);