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
....@@ -1997,9 +2002,10 @@
19972002 if (v.vertexlinks == null)
19982003 continue;
19992004
2000
- // Warning: a bit faster but dangerous
2001
- if (v.weights != null && v.weights[j] == 0)
2002
- // < 0.001 * v.totalweight)
2005
+ // Warning: faster but dangerous
2006
+ if (v.weights != null && v.weights[j]
2007
+ == 0)
2008
+ //< 0.001 * v.totalweight)
20032009 {
20042010 //testweight += v.weights[j-1];
20052011 continue;
....@@ -3769,7 +3775,7 @@
37693775
37703776 //tempRep.Unstripify();
37713777
3772
- tempRep.GenerateNormals2(crease);
3778
+ tempRep.GenerateNormals(crease);
37733779
37743780 boolean keepnormal = Vertex.normalmode;
37753781 boolean epsequal = Grafreed.epsequal;
....@@ -3831,6 +3837,9 @@
38313837 //if (n.dot(v.norm) < 0)
38323838 if (n == null)
38333839 continue;
3840
+
3841
+ if (v.norm == null)
3842
+ v.norm = new cVector();
38343843
38353844 LA.vecCopy(n, v.norm);
38363845
....@@ -4021,8 +4030,6 @@
40214030 //System.out.println("NEW = " + positions.length);
40224031 uvmap = new float[ta.getVertexCount() * 2];
40234032
4024
- colors = new float[ta.getVertexCount()]; // * 3];
4025
-
40264033 ta.getCoordinates(0, positions);
40274034 ta.getNormals(0, normals);
40284035 // ta.getColors(0, colors);
....@@ -4030,6 +4037,14 @@
40304037
40314038 System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";");
40324039
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
+
40334048 triangles = new int[ta.getVertexCount()];
40344049
40354050 for (int i = 0; i < triangles.length; i++)
....@@ -4067,17 +4082,18 @@
40674082 positions = new float[3 * ga.getVertexCount()];
40684083 normals = new float[3 * ga.getVertexCount()];
40694084 uvmap = new float[2 * ga.getVertexCount()];
4070
- colors = new float[1 * ga.getVertexCount()];
40714085
40724086 tsa.getCoordinates(0, positions);
40734087 tsa.getNormals(0, normals);
40744088 tsa.getTextureCoordinates(0, 0, uvmap);
40754089 // tsa.getColors(0, colors);
4076
-
4077
- for (int i=colors.length; --i>=0;)
4078
- {
4079
- colors[i] = 1;
4080
- }
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
+// }
40814097
40824098 int stripcount = tsa.getNumStrips();
40834099 triangles = new int[stripcount];
....@@ -4086,6 +4102,7 @@
40864102 stripified = true;
40874103 } catch (ClassCastException e)
40884104 {
4105
+ // ??? aug 2019
40894106 TriangleArray ta = (TriangleArray) ga;
40904107
40914108 positions = new float[3 * ga.getVertexCount()];