Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
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,7 @@
24412468 else
24422469 {
24432470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
24442472 }
24452473 }
24462474
....@@ -5909,8 +5937,10 @@
59095937 if (support != null)
59105938 support = support;
59115939
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);
5940
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5941
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5942
+
5943
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
59145944
59155945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59165946 {
....@@ -5920,8 +5950,9 @@
59205950 // usecalllists &= !(parent instanceof RandomNode);
59215951 // usecalllists = false;
59225952
5923
- if (GetBRep() != null)
5924
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
59255956 //System.out.println("draw " + this);
59265957 //new Exception().printStackTrace();
59275958
....@@ -5943,7 +5974,7 @@
59435974 if (!(this instanceof Composite))
59445975 touched = false;
59455976 //if (displaylist == -1 && usecalllists)
5946
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59475978 {
59485979 bRep.displaylist = display.GenList();
59495980 assert(bRep.displaylist != 0);
....@@ -5954,7 +5985,7 @@
59545985
59555986 //System.out.println("\tnew list " + list);
59565987 //gl.glDrawBuffer(gl.GL_NONE);
5957
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
59585989 {
59595990 // System.err.println("new list " + bRep.displaylist + " for " + this);
59605991 display.NewList(bRep.displaylist);
....@@ -5963,7 +5994,7 @@
59635994 CallList(display, root, selected, blocked);
59645995
59655996 // compiled = true;
5966
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
59675998 {
59685999 // System.err.println("end list " + bRep.displaylist + " for " + this);
59696000 display.EndList();