Normand Briere
2019-08-08 8294241adc5fe698b70e13ebd6780af46ab83f7e
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,7 @@
24382468 else
24392469 {
24402470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
24412472 }
24422473 }
24432474
....@@ -5906,8 +5937,10 @@
59065937 if (support != null)
59075938 support = support;
59085939
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);
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.
59115944
59125945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59135946 {
....@@ -5917,8 +5950,9 @@
59175950 // usecalllists &= !(parent instanceof RandomNode);
59185951 // usecalllists = false;
59195952
5920
- if (GetBRep() != null)
5921
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
59225956 //System.out.println("draw " + this);
59235957 //new Exception().printStackTrace();
59245958
....@@ -5940,7 +5974,7 @@
59405974 if (!(this instanceof Composite))
59415975 touched = false;
59425976 //if (displaylist == -1 && usecalllists)
5943
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59445978 {
59455979 bRep.displaylist = display.GenList();
59465980 assert(bRep.displaylist != 0);
....@@ -5951,7 +5985,7 @@
59515985
59525986 //System.out.println("\tnew list " + list);
59535987 //gl.glDrawBuffer(gl.GL_NONE);
5954
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
59555989 {
59565990 // System.err.println("new list " + bRep.displaylist + " for " + this);
59575991 display.NewList(bRep.displaylist);
....@@ -5960,7 +5994,7 @@
59605994 CallList(display, root, selected, blocked);
59615995
59625996 // compiled = true;
5963
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
59645998 {
59655999 // System.err.println("end list " + bRep.displaylist + " for " + this);
59666000 display.EndList();
....@@ -7490,7 +7524,7 @@
74907524 hitSomething = hitScale;
74917525
74927526 double scale = 0.005f * clickInfo.camera.Distance();
7493
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7527
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
74947528 double sign = 1;
74957529 if (hScale < 0)
74967530 {
....@@ -7502,7 +7536,7 @@
75027536 //hScale = 0.01;
75037537 }
75047538
7505
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7539
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75067540 sign = 1;
75077541 if (vScale < 0)
75087542 {
....@@ -7717,7 +7751,7 @@
77177751 break;
77187752
77197753 case hitScale: // scale
7720
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7754
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
77217755 double sign = 1;
77227756 if (hScale < 0)
77237757 {
....@@ -7729,7 +7763,7 @@
77297763 //hScale = 0.01;
77307764 }
77317765
7732
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7766
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
77337767 sign = 1;
77347768 if (vScale < 0)
77357769 {