Normand Briere
2019-08-12 b1d79b74514041a059b454a9f6fc3970773c0cb8
Object3D.java
....@@ -22,6 +22,7 @@
2222 //static final long serialVersionUID = -607422624994562685L;
2323 static final long serialVersionUID = 5022536242724664900L;
2424
25
+ // Use GetUUID for backward compatibility with null.
2526 private UUID uuid = UUID.randomUUID();
2627
2728 // TEMPORARY for mocap undo. No need to be transient.
....@@ -32,7 +33,7 @@
3233 String skyboxname;
3334 String skyboxext;
3435
35
- byte[] versions[];
36
+ Object3D versionlist[];
3637 int versionindex = -1;
3738
3839 ScriptNode scriptnode;
....@@ -222,7 +223,7 @@
222223 // o.bRep.support = null;
223224 // }
224225 o.selection = this.selection;
225
- o.versions = this.versions;
226
+ o.versionlist = this.versionlist;
226227 o.versionindex = this.versionindex;
227228
228229 if (this.support != null)
....@@ -245,6 +246,29 @@
245246 // this.support = null;
246247 // this.fileparent = null;
247248 }
249
+
250
+// Object3D GetObject(java.util.UUID uuid)
251
+// {
252
+// if (this.uuid.equals(uuid))
253
+// return this;
254
+//
255
+// if (blockloop)
256
+// return null;
257
+//
258
+// blockloop = true;
259
+//
260
+// for (int i=0; i<Size(); i++)
261
+// {
262
+// Object3D o = get(i).GetObject(uuid);
263
+//
264
+// if (o != null)
265
+// return o;
266
+// }
267
+//
268
+// blockloop = false;
269
+//
270
+// return null;
271
+// }
248272
249273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
250274 {
....@@ -280,7 +304,7 @@
280304
281305 this.selection = o.selection;
282306
283
- this.versions = o.versions;
307
+ this.versionlist = o.versionlist;
284308 this.versionindex = o.versionindex;
285309 // July 2019 if (this.bRep != null)
286310 // this.bRep.support = o.transientrep;
....@@ -1014,6 +1038,9 @@
10141038
10151039 if (material == null || material.multiply)
10161040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10171044
10181045 // Transparent objects are dynamic because we have to sort the triangles.
10191046 return material.opacity > 0.99;
....@@ -2441,6 +2468,11 @@
24412468 else
24422469 {
24432470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ if (objectUI != null)
2472
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2473
+ else
2474
+ //new Exception().printStackTrace();
2475
+ System.err.println("objectUI is null");
24442476 }
24452477 }
24462478
....@@ -5909,8 +5941,10 @@
59095941 if (support != null)
59105942 support = support;
59115943
5912
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5913
- boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5944
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5945
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5946
+
5947
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
59145948
59155949 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59165950 {
....@@ -5920,8 +5954,9 @@
59205954 // usecalllists &= !(parent instanceof RandomNode);
59215955 // usecalllists = false;
59225956
5923
- if (GetBRep() != null)
5924
- usecalllists = usecalllists;
5957
+ if (display.DrawMode() == display.SHADOW)
5958
+ //GetBRep() != null)
5959
+ usecalllists = !!usecalllists;
59255960 //System.out.println("draw " + this);
59265961 //new Exception().printStackTrace();
59275962
....@@ -5943,7 +5978,7 @@
59435978 if (!(this instanceof Composite))
59445979 touched = false;
59455980 //if (displaylist == -1 && usecalllists)
5946
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5981
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59475982 {
59485983 bRep.displaylist = display.GenList();
59495984 assert(bRep.displaylist != 0);
....@@ -5954,7 +5989,7 @@
59545989
59555990 //System.out.println("\tnew list " + list);
59565991 //gl.glDrawBuffer(gl.GL_NONE);
5957
- if (usecalllists)
5992
+ if (usecalllists && bRep.displaylist > 0)
59585993 {
59595994 // System.err.println("new list " + bRep.displaylist + " for " + this);
59605995 display.NewList(bRep.displaylist);
....@@ -5963,7 +5998,7 @@
59635998 CallList(display, root, selected, blocked);
59645999
59656000 // compiled = true;
5966
- if (usecalllists)
6001
+ if (usecalllists && bRep.displaylist > 0)
59676002 {
59686003 // System.err.println("end list " + bRep.displaylist + " for " + this);
59696004 display.EndList();
....@@ -7493,7 +7528,7 @@
74937528 hitSomething = hitScale;
74947529
74957530 double scale = 0.005f * clickInfo.camera.Distance();
7496
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7531
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
74977532 double sign = 1;
74987533 if (hScale < 0)
74997534 {
....@@ -7505,7 +7540,7 @@
75057540 //hScale = 0.01;
75067541 }
75077542
7508
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7543
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75097544 sign = 1;
75107545 if (vScale < 0)
75117546 {
....@@ -7720,7 +7755,7 @@
77207755 break;
77217756
77227757 case hitScale: // scale
7723
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7758
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
77247759 double sign = 1;
77257760 if (hScale < 0)
77267761 {
....@@ -7732,7 +7767,7 @@
77327767 //hScale = 0.01;
77337768 }
77347769
7735
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7770
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
77367771 sign = 1;
77377772 if (vScale < 0)
77387773 {