Normand Briere
2019-08-06 4ec7130da08861dc4aff0232dbce38f3471696a4
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;
....@@ -5906,8 +5936,10 @@
59065936 if (support != null)
59075937 support = support;
59085938
5909
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5910
- boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5939
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5940
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5941
+
5942
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
59115943
59125944 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59135945 {
....@@ -5917,8 +5949,9 @@
59175949 // usecalllists &= !(parent instanceof RandomNode);
59185950 // usecalllists = false;
59195951
5920
- if (GetBRep() != null)
5921
- usecalllists = usecalllists;
5952
+ if (display.DrawMode() == display.SHADOW)
5953
+ //GetBRep() != null)
5954
+ usecalllists = !!usecalllists;
59225955 //System.out.println("draw " + this);
59235956 //new Exception().printStackTrace();
59245957
....@@ -5940,7 +5973,7 @@
59405973 if (!(this instanceof Composite))
59415974 touched = false;
59425975 //if (displaylist == -1 && usecalllists)
5943
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5976
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59445977 {
59455978 bRep.displaylist = display.GenList();
59465979 assert(bRep.displaylist != 0);
....@@ -5951,7 +5984,7 @@
59515984
59525985 //System.out.println("\tnew list " + list);
59535986 //gl.glDrawBuffer(gl.GL_NONE);
5954
- if (usecalllists)
5987
+ if (usecalllists && bRep.displaylist > 0)
59555988 {
59565989 // System.err.println("new list " + bRep.displaylist + " for " + this);
59575990 display.NewList(bRep.displaylist);
....@@ -5960,7 +5993,7 @@
59605993 CallList(display, root, selected, blocked);
59615994
59625995 // compiled = true;
5963
- if (usecalllists)
5996
+ if (usecalllists && bRep.displaylist > 0)
59645997 {
59655998 // System.err.println("end list " + bRep.displaylist + " for " + this);
59665999 display.EndList();
....@@ -7490,7 +7523,7 @@
74907523 hitSomething = hitScale;
74917524
74927525 double scale = 0.005f * clickInfo.camera.Distance();
7493
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7526
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
74947527 double sign = 1;
74957528 if (hScale < 0)
74967529 {
....@@ -7502,7 +7535,7 @@
75027535 //hScale = 0.01;
75037536 }
75047537
7505
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7538
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75067539 sign = 1;
75077540 if (vScale < 0)
75087541 {
....@@ -7717,7 +7750,7 @@
77177750 break;
77187751
77197752 case hitScale: // scale
7720
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7753
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
77217754 double sign = 1;
77227755 if (hScale < 0)
77237756 {
....@@ -7729,7 +7762,7 @@
77297762 //hScale = 0.01;
77307763 }
77317764
7732
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7765
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
77337766 sign = 1;
77347767 if (vScale < 0)
77357768 {