Normand Briere
2019-09-18 f9325048496d7cdbcad233f8a6b84c88e79adcc2
BoundaryRep.java
....@@ -7,7 +7,8 @@
77
88 class BoundaryRep implements java.io.Serializable
99 {
10
- static final long serialVersionUID = -4852664309425035321L;
10
+ static final long serialVersionUID = // VERY old 2008 -5762968998168738314L;
11
+ -4852664309425035321L;
1112
1213 transient int displaylist = 0;
1314
....@@ -530,7 +531,7 @@
530531 static Vertex vertextemp = new Vertex(true);
531532 static Vertex vertextemp2 = new Vertex(true);
532533
533
- static double SEUIL = 0.05f; // 0.1 for rag doll; 0.07;
534
+ static double SEUIL = 0.025f; // 0.1 for rag doll; 0.07;
534535
535536 // Compute weight of point w/r to this
536537 float ComputeWeight(Vertex v, double[][] toRoot, int k)
....@@ -686,6 +687,7 @@
686687
687688 void RecomputeBasis(BoundaryRep other, double[][] toRoot, Vertex v)
688689 {
690
+ CameraPane.CreateSelectedPoint();
689691 CameraPane.selectedpoint.
690692 getAverage(cStatic.point1, true);
691693
....@@ -1003,6 +1005,7 @@
10031005
10041006 v.closestsupport = -1;
10051007
1008
+ CameraPane.CreateSelectedPoint();
10061009 CameraPane.selectedpoint.
10071010 getAverage(cStatic.point1, true);
10081011
....@@ -1261,6 +1264,7 @@
12611264 for (int wi = v0.weights.length; --wi>=0;)
12621265 v[wi] = 0;
12631266
1267
+ CameraPane.CreateSelectedPoint();
12641268 CameraPane.selectedpoint.
12651269 getAverage(cStatic.point1, true);
12661270
....@@ -1398,6 +1402,7 @@
13981402 v0.x = v0.y = v0.z = 0;
13991403 v0.norm.x = v0.norm.y = v0.norm.z = 0;
14001404
1405
+ CameraPane.CreateSelectedPoint();
14011406 CameraPane.selectedpoint.
14021407 getAverage(cStatic.point1, true);
14031408
....@@ -1998,7 +2003,9 @@
19982003 continue;
19992004
20002005 // Warning: faster but dangerous
2001
- if (v.weights != null && v.weights[j] == 0) // < 0.001 * v.totalweight)
2006
+ if (v.weights != null && v.weights[j]
2007
+ == 0)
2008
+ //< 0.001 * v.totalweight)
20022009 {
20032010 //testweight += v.weights[j-1];
20042011 continue;
....@@ -3768,7 +3775,7 @@
37683775
37693776 //tempRep.Unstripify();
37703777
3771
- tempRep.GenerateNormals2(crease);
3778
+ tempRep.GenerateNormals(crease);
37723779
37733780 boolean keepnormal = Vertex.normalmode;
37743781 boolean epsequal = Grafreed.epsequal;
....@@ -3830,6 +3837,9 @@
38303837 //if (n.dot(v.norm) < 0)
38313838 if (n == null)
38323839 continue;
3840
+
3841
+ if (v.norm == null)
3842
+ v.norm = new cVector();
38333843
38343844 LA.vecCopy(n, v.norm);
38353845
....@@ -4020,8 +4030,6 @@
40204030 //System.out.println("NEW = " + positions.length);
40214031 uvmap = new float[ta.getVertexCount() * 2];
40224032
4023
- colors = new float[ta.getVertexCount()]; // * 3];
4024
-
40254033 ta.getCoordinates(0, positions);
40264034 ta.getNormals(0, normals);
40274035 // ta.getColors(0, colors);
....@@ -4029,6 +4037,14 @@
40294037
40304038 System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";");
40314039
4040
+ colors = null;
4041
+// colors = new float[ta.getVertexCount()]; // * 3];
4042
+//
4043
+// for (int i=colors.length; --i>=0;)
4044
+// {
4045
+// colors[i] = 1;
4046
+// }
4047
+
40324048 triangles = new int[ta.getVertexCount()];
40334049
40344050 for (int i = 0; i < triangles.length; i++)
....@@ -4066,17 +4082,18 @@
40664082 positions = new float[3 * ga.getVertexCount()];
40674083 normals = new float[3 * ga.getVertexCount()];
40684084 uvmap = new float[2 * ga.getVertexCount()];
4069
- colors = new float[1 * ga.getVertexCount()];
40704085
40714086 tsa.getCoordinates(0, positions);
40724087 tsa.getNormals(0, normals);
40734088 tsa.getTextureCoordinates(0, 0, uvmap);
40744089 // tsa.getColors(0, colors);
4075
-
4076
- for (int i=colors.length; --i>=0;)
4077
- {
4078
- colors[i] = 1;
4079
- }
4090
+
4091
+ colors = null;
4092
+// colors = new float[1 * ga.getVertexCount()];
4093
+// for (int i=colors.length; --i>=0;)
4094
+// {
4095
+// colors[i] = 1;
4096
+// }
40804097
40814098 int stripcount = tsa.getNumStrips();
40824099 triangles = new int[stripcount];
....@@ -4085,6 +4102,7 @@
40854102 stripified = true;
40864103 } catch (ClassCastException e)
40874104 {
4105
+ // ??? aug 2019
40884106 TriangleArray ta = (TriangleArray) ga;
40894107
40904108 positions = new float[3 * ga.getVertexCount()];