Normand Briere
2019-08-13 0cdf3fb57ddea3226f094ba45c836c7e9b123e3a
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.
....@@ -29,7 +30,10 @@
2930 Object3D saveskeleton;
3031 //
3132
32
- byte[] versions[];
33
+ String skyboxname;
34
+ String skyboxext;
35
+
36
+ Object3D versionlist[];
3337 int versionindex = -1;
3438
3539 ScriptNode scriptnode;
....@@ -219,7 +223,7 @@
219223 // o.bRep.support = null;
220224 // }
221225 o.selection = this.selection;
222
- o.versions = this.versions;
226
+ o.versionlist = this.versionlist;
223227 o.versionindex = this.versionindex;
224228
225229 if (this.support != null)
....@@ -242,6 +246,29 @@
242246 // this.support = null;
243247 // this.fileparent = null;
244248 }
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
+// }
245272
246273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
247274 {
....@@ -277,7 +304,7 @@
277304
278305 this.selection = o.selection;
279306
280
- this.versions = o.versions;
307
+ this.versionlist = o.versionlist;
281308 this.versionindex = o.versionindex;
282309 // July 2019 if (this.bRep != null)
283310 // this.bRep.support = o.transientrep;
....@@ -1011,6 +1038,9 @@
10111038
10121039 if (material == null || material.multiply)
10131040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10141044
10151045 // Transparent objects are dynamic because we have to sort the triangles.
10161046 return material.opacity > 0.99;
....@@ -2438,6 +2468,11 @@
24382468 else
24392469 {
24402470 //((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");
24412476 }
24422477 }
24432478
....@@ -5906,8 +5941,10 @@
59065941 if (support != null)
59075942 support = support;
59085943
5909
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5910
- boolean usecalllists = !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.
59115948
59125949 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59135950 {
....@@ -5917,8 +5954,9 @@
59175954 // usecalllists &= !(parent instanceof RandomNode);
59185955 // usecalllists = false;
59195956
5920
- if (GetBRep() != null)
5921
- usecalllists = usecalllists;
5957
+ if (display.DrawMode() == display.SHADOW)
5958
+ //GetBRep() != null)
5959
+ usecalllists = !!usecalllists;
59225960 //System.out.println("draw " + this);
59235961 //new Exception().printStackTrace();
59245962
....@@ -5940,7 +5978,7 @@
59405978 if (!(this instanceof Composite))
59415979 touched = false;
59425980 //if (displaylist == -1 && usecalllists)
5943
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5981
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59445982 {
59455983 bRep.displaylist = display.GenList();
59465984 assert(bRep.displaylist != 0);
....@@ -5951,7 +5989,7 @@
59515989
59525990 //System.out.println("\tnew list " + list);
59535991 //gl.glDrawBuffer(gl.GL_NONE);
5954
- if (usecalllists)
5992
+ if (usecalllists && bRep.displaylist > 0)
59555993 {
59565994 // System.err.println("new list " + bRep.displaylist + " for " + this);
59575995 display.NewList(bRep.displaylist);
....@@ -5960,7 +5998,7 @@
59605998 CallList(display, root, selected, blocked);
59615999
59626000 // compiled = true;
5963
- if (usecalllists)
6001
+ if (usecalllists && bRep.displaylist > 0)
59646002 {
59656003 // System.err.println("end list " + bRep.displaylist + " for " + this);
59666004 display.EndList();
....@@ -7490,7 +7528,7 @@
74907528 hitSomething = hitScale;
74917529
74927530 double scale = 0.005f * clickInfo.camera.Distance();
7493
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7531
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
74947532 double sign = 1;
74957533 if (hScale < 0)
74967534 {
....@@ -7502,7 +7540,7 @@
75027540 //hScale = 0.01;
75037541 }
75047542
7505
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7543
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75067544 sign = 1;
75077545 if (vScale < 0)
75087546 {
....@@ -7717,7 +7755,7 @@
77177755 break;
77187756
77197757 case hitScale: // scale
7720
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7758
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
77217759 double sign = 1;
77227760 if (hScale < 0)
77237761 {
....@@ -7729,7 +7767,7 @@
77297767 //hScale = 0.01;
77307768 }
77317769
7732
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7770
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
77337771 sign = 1;
77347772 if (vScale < 0)
77357773 {