.. | .. |
---|
7 | 7 | |
---|
8 | 8 | class BoundaryRep implements java.io.Serializable |
---|
9 | 9 | { |
---|
10 | | - static final long serialVersionUID = -4852664309425035321L; |
---|
| 10 | + static final long serialVersionUID = // VERY old 2008 -5762968998168738314L; |
---|
| 11 | + -4852664309425035321L; |
---|
11 | 12 | |
---|
12 | 13 | transient int displaylist = 0; |
---|
13 | 14 | |
---|
.. | .. |
---|
530 | 531 | static Vertex vertextemp = new Vertex(true); |
---|
531 | 532 | static Vertex vertextemp2 = new Vertex(true); |
---|
532 | 533 | |
---|
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; |
---|
534 | 535 | |
---|
535 | 536 | // Compute weight of point w/r to this |
---|
536 | 537 | float ComputeWeight(Vertex v, double[][] toRoot, int k) |
---|
.. | .. |
---|
686 | 687 | |
---|
687 | 688 | void RecomputeBasis(BoundaryRep other, double[][] toRoot, Vertex v) |
---|
688 | 689 | { |
---|
| 690 | + CameraPane.CreateSelectedPoint(); |
---|
689 | 691 | CameraPane.selectedpoint. |
---|
690 | 692 | getAverage(cStatic.point1, true); |
---|
691 | 693 | |
---|
.. | .. |
---|
1003 | 1005 | |
---|
1004 | 1006 | v.closestsupport = -1; |
---|
1005 | 1007 | |
---|
| 1008 | + CameraPane.CreateSelectedPoint(); |
---|
1006 | 1009 | CameraPane.selectedpoint. |
---|
1007 | 1010 | getAverage(cStatic.point1, true); |
---|
1008 | 1011 | |
---|
.. | .. |
---|
1261 | 1264 | for (int wi = v0.weights.length; --wi>=0;) |
---|
1262 | 1265 | v[wi] = 0; |
---|
1263 | 1266 | |
---|
| 1267 | + CameraPane.CreateSelectedPoint(); |
---|
1264 | 1268 | CameraPane.selectedpoint. |
---|
1265 | 1269 | getAverage(cStatic.point1, true); |
---|
1266 | 1270 | |
---|
.. | .. |
---|
1398 | 1402 | v0.x = v0.y = v0.z = 0; |
---|
1399 | 1403 | v0.norm.x = v0.norm.y = v0.norm.z = 0; |
---|
1400 | 1404 | |
---|
| 1405 | + CameraPane.CreateSelectedPoint(); |
---|
1401 | 1406 | CameraPane.selectedpoint. |
---|
1402 | 1407 | getAverage(cStatic.point1, true); |
---|
1403 | 1408 | |
---|
.. | .. |
---|
1999 | 2004 | |
---|
2000 | 2005 | // Warning: faster but dangerous |
---|
2001 | 2006 | if (v.weights != null && v.weights[j] |
---|
2002 | | - // == 0) |
---|
2003 | | - < 0.001 * v.totalweight) |
---|
| 2007 | + == 0) |
---|
| 2008 | + //< 0.001 * v.totalweight) |
---|
2004 | 2009 | { |
---|
2005 | 2010 | //testweight += v.weights[j-1]; |
---|
2006 | 2011 | continue; |
---|
.. | .. |
---|
3770 | 3775 | |
---|
3771 | 3776 | //tempRep.Unstripify(); |
---|
3772 | 3777 | |
---|
3773 | | - tempRep.GenerateNormals2(crease); |
---|
| 3778 | + tempRep.GenerateNormals(crease); |
---|
3774 | 3779 | |
---|
3775 | 3780 | boolean keepnormal = Vertex.normalmode; |
---|
3776 | 3781 | boolean epsequal = Grafreed.epsequal; |
---|
.. | .. |
---|
3832 | 3837 | //if (n.dot(v.norm) < 0) |
---|
3833 | 3838 | if (n == null) |
---|
3834 | 3839 | continue; |
---|
| 3840 | + |
---|
| 3841 | + if (v.norm == null) |
---|
| 3842 | + v.norm = new cVector(); |
---|
3835 | 3843 | |
---|
3836 | 3844 | LA.vecCopy(n, v.norm); |
---|
3837 | 3845 | |
---|
.. | .. |
---|
4022 | 4030 | //System.out.println("NEW = " + positions.length); |
---|
4023 | 4031 | uvmap = new float[ta.getVertexCount() * 2]; |
---|
4024 | 4032 | |
---|
4025 | | - colors = new float[ta.getVertexCount()]; // * 3]; |
---|
4026 | | - |
---|
4027 | 4033 | ta.getCoordinates(0, positions); |
---|
4028 | 4034 | ta.getNormals(0, normals); |
---|
4029 | 4035 | // ta.getColors(0, colors); |
---|
.. | .. |
---|
4031 | 4037 | |
---|
4032 | 4038 | System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";"); |
---|
4033 | 4039 | |
---|
| 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 | + |
---|
4034 | 4048 | triangles = new int[ta.getVertexCount()]; |
---|
4035 | 4049 | |
---|
4036 | 4050 | for (int i = 0; i < triangles.length; i++) |
---|
.. | .. |
---|
4068 | 4082 | positions = new float[3 * ga.getVertexCount()]; |
---|
4069 | 4083 | normals = new float[3 * ga.getVertexCount()]; |
---|
4070 | 4084 | uvmap = new float[2 * ga.getVertexCount()]; |
---|
4071 | | - colors = new float[1 * ga.getVertexCount()]; |
---|
4072 | 4085 | |
---|
4073 | 4086 | tsa.getCoordinates(0, positions); |
---|
4074 | 4087 | tsa.getNormals(0, normals); |
---|
4075 | 4088 | tsa.getTextureCoordinates(0, 0, uvmap); |
---|
4076 | 4089 | // 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 | +// } |
---|
4082 | 4097 | |
---|
4083 | 4098 | int stripcount = tsa.getNumStrips(); |
---|
4084 | 4099 | triangles = new int[stripcount]; |
---|
.. | .. |
---|
4087 | 4102 | stripified = true; |
---|
4088 | 4103 | } catch (ClassCastException e) |
---|
4089 | 4104 | { |
---|
| 4105 | + // ??? aug 2019 |
---|
4090 | 4106 | TriangleArray ta = (TriangleArray) ga; |
---|
4091 | 4107 | |
---|
4092 | 4108 | positions = new float[3 * ga.getVertexCount()]; |
---|