Normand Briere
2019-08-01 7d02eaffc02895a01d95d8fd7e089044449e1d6d
Object3D.java
....@@ -1015,6 +1015,9 @@
10151015 if (material == null || material.multiply)
10161016 return true;
10171017
1018
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1019
+ return false;
1020
+
10181021 // Transparent objects are dynamic because we have to sort the triangles.
10191022 return material.opacity > 0.99;
10201023 }
....@@ -5909,8 +5912,10 @@
59095912 if (support != null)
59105913 support = support;
59115914
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);
5915
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5916
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5917
+
5918
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
59145919
59155920 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59165921 {
....@@ -5920,8 +5925,9 @@
59205925 // usecalllists &= !(parent instanceof RandomNode);
59215926 // usecalllists = false;
59225927
5923
- if (GetBRep() != null)
5924
- usecalllists = usecalllists;
5928
+ if (display.DrawMode() == display.SHADOW)
5929
+ //GetBRep() != null)
5930
+ usecalllists = !!usecalllists;
59255931 //System.out.println("draw " + this);
59265932 //new Exception().printStackTrace();
59275933
....@@ -5943,7 +5949,7 @@
59435949 if (!(this instanceof Composite))
59445950 touched = false;
59455951 //if (displaylist == -1 && usecalllists)
5946
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5952
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59475953 {
59485954 bRep.displaylist = display.GenList();
59495955 assert(bRep.displaylist != 0);
....@@ -5954,7 +5960,7 @@
59545960
59555961 //System.out.println("\tnew list " + list);
59565962 //gl.glDrawBuffer(gl.GL_NONE);
5957
- if (usecalllists)
5963
+ if (usecalllists && bRep.displaylist > 0)
59585964 {
59595965 // System.err.println("new list " + bRep.displaylist + " for " + this);
59605966 display.NewList(bRep.displaylist);
....@@ -5963,7 +5969,7 @@
59635969 CallList(display, root, selected, blocked);
59645970
59655971 // compiled = true;
5966
- if (usecalllists)
5972
+ if (usecalllists && bRep.displaylist > 0)
59675973 {
59685974 // System.err.println("end list " + bRep.displaylist + " for " + this);
59695975 display.EndList();
....@@ -7493,7 +7499,7 @@
74937499 hitSomething = hitScale;
74947500
74957501 double scale = 0.005f * clickInfo.camera.Distance();
7496
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7502
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
74977503 double sign = 1;
74987504 if (hScale < 0)
74997505 {
....@@ -7505,7 +7511,7 @@
75057511 //hScale = 0.01;
75067512 }
75077513
7508
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7514
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75097515 sign = 1;
75107516 if (vScale < 0)
75117517 {
....@@ -7720,7 +7726,7 @@
77207726 break;
77217727
77227728 case hitScale: // scale
7723
- double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7729
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
77247730 double sign = 1;
77257731 if (hScale < 0)
77267732 {
....@@ -7732,7 +7738,7 @@
77327738 //hScale = 0.01;
77337739 }
77347740
7735
- double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7741
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
77367742 sign = 1;
77377743 if (vScale < 0)
77387744 {