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
....@@ -1999,8 +2004,8 @@
19992004
20002005 // Warning: faster but dangerous
20012006 if (v.weights != null && v.weights[j]
2002
- // == 0)
2003
- < 0.001 * v.totalweight)
2007
+ == 0)
2008
+ //< 0.001 * v.totalweight)
20042009 {
20052010 //testweight += v.weights[j-1];
20062011 continue;
....@@ -3770,7 +3775,7 @@
37703775
37713776 //tempRep.Unstripify();
37723777
3773
- tempRep.GenerateNormals2(crease);
3778
+ tempRep.GenerateNormals(crease);
37743779
37753780 boolean keepnormal = Vertex.normalmode;
37763781 boolean epsequal = Grafreed.epsequal;
....@@ -3832,6 +3837,9 @@
38323837 //if (n.dot(v.norm) < 0)
38333838 if (n == null)
38343839 continue;
3840
+
3841
+ if (v.norm == null)
3842
+ v.norm = new cVector();
38353843
38363844 LA.vecCopy(n, v.norm);
38373845
....@@ -4022,8 +4030,6 @@
40224030 //System.out.println("NEW = " + positions.length);
40234031 uvmap = new float[ta.getVertexCount() * 2];
40244032
4025
- colors = new float[ta.getVertexCount()]; // * 3];
4026
-
40274033 ta.getCoordinates(0, positions);
40284034 ta.getNormals(0, normals);
40294035 // ta.getColors(0, colors);
....@@ -4031,6 +4037,14 @@
40314037
40324038 System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";");
40334039
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
+
40344048 triangles = new int[ta.getVertexCount()];
40354049
40364050 for (int i = 0; i < triangles.length; i++)
....@@ -4068,17 +4082,18 @@
40684082 positions = new float[3 * ga.getVertexCount()];
40694083 normals = new float[3 * ga.getVertexCount()];
40704084 uvmap = new float[2 * ga.getVertexCount()];
4071
- colors = new float[1 * ga.getVertexCount()];
40724085
40734086 tsa.getCoordinates(0, positions);
40744087 tsa.getNormals(0, normals);
40754088 tsa.getTextureCoordinates(0, 0, uvmap);
40764089 // tsa.getColors(0, colors);
4077
-
4078
- for (int i=colors.length; --i>=0;)
4079
- {
4080
- colors[i] = 1;
4081
- }
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
+// }
40824097
40834098 int stripcount = tsa.getNumStrips();
40844099 triangles = new int[stripcount];
....@@ -4087,6 +4102,7 @@
40874102 stripified = true;
40884103 } catch (ClassCastException e)
40894104 {
4105
+ // ??? aug 2019
40904106 TriangleArray ta = (TriangleArray) ga;
40914107
40924108 positions = new float[3 * ga.getVertexCount()];