Upload the three models tt0.dae, tt1a.dae and tt1d.dae. Use the same mesh for all LODs and for the physics shape. Do not click "Analyze". Rez the objects in-world and switch the Physics shape types to "Prim". Observe the (triangle-based)physics weights using the More Info link in the edit floater.
Actual Behavior
The models tt0 and tt1d have the expected weight of 0.5, but the model tt1a has a weight of 2606 (rounded), which is greater than the maximum of 80 predicted by the wiki.
Expected Behavior
The models used each consist of two oppositely facing equilateral triangles perpendicular to the x axis and with one side parallel to the y axis. They are separated by 0.5m on the x axis and have a width, as defined in the wiki, of 0.5m. In tt0, the triangles are perfectly flat, all vertices having x coordinates 0.25m either side of zero. In tt1a, the top (largest in z coordinate) vertex of the triangle at x=0.25 is displaced 0.000001m towards the x axis (i.e. at x=0.249999). Inn tt1d, the top vertex of the other triangle is displaced 0.000001m towards the x axis (i.e. at x=-0.249999).
The wiki states that the the (harmonic) average triangle width is clamped between 0.001m and 20m. The minimum width of 0.001m implies a maximum weight of K.n/0.001, where K is a constant and n is the number of triangles. Here n=2, so that the maximum weight is 2.K/0.001 = 2000K.
The wiki further states that if all triangles have width 0.5m, so that the average width must be 0.5m, the weight should be 0.1 per triangle. That implies that K/0.5 = 0.1, and thus that K = 0.05. This was tested using two models with more than two triangles of the same size as used in the models described, as the minimum weight of 0.5 is expected to be applied to a model with two triangles. A model containing 32 triangles had a weight of 1.3, and linking five copies of that model gave a weight of 6.4. This implies K = 6.4x0.5/(5x32) = 0.02. A second model consisted of two flat hexagonally joined arrays each of 18 identical triangles, which had a weight of 1.3. Allowing for rounding gave K between 0.017 and 0.019. The value of 0.02 is consistent with a large number of other measurements using triangles of different sizes. It is assumed that the lower value of K with the second model is the result of the width approximation, mentioned in the wiki, for that particular geometry.
The K implied in the wiki would imply a maximum weight for a two-triangle model of 2000x0.04 = 80. The measured value of K implies a maximum weight of 40 for the same model. Whichever K is correct, the weight of a two triangle model should never be higher than 80.
Other information
1) This is related to BUG-1081 and BUG-965, in the sense that it likely originates from the same problem in the weight calculation code. I was advised to submit as a new issue indicating the association with the previous issues, as I cannot add comments to those. This describes an additional way in which the calculation does not perform as described in the wiki, leading to extremely high weights. It is added in the hope that it will aid in identifying the source of the erroneous calculations, as it would appear to happen after the clamping of the average width.
2) The two models tt1a and tt1d contain an exactly identical pair of triangles, the difference being effectively a reflection of the geometry in the YZ plane.
3) The same displacements of each of the other vertices in the triangle at x=0.25 produced similar weights (2642 and 2611).
4) The same displacements of each of the other vertices in the triangle at x=-0.25 left the weight at 0.5.
5) Inverting the order of the two triangles in the did not change the observation (2) and (3), except for small changes in the high weights (2606 to 2611; 2642 to 2611; 2611 unchanged).
Original Jira Fields
| Field | Value |
| ------------- | ------------- |
| Issue | BUG-1339 |
| Summary | Minimum average triangle width in triangle-based physics weight calculation does not appear to work |
| Type | Bug |
| Priority | Unset |
| Status | Accepted |
| Resolution | Released |
| Reporter | Drongle McMahon (drongle.mcmahon) |
| Created at | 2013-01-14T19:22:52Z |
| Updated at | 2014-03-21T18:41:56Z |
```
{
'Business Unit': ['Platform'],
'Date of First Response': '2013-01-17T16:28:25.067-0600',
"Is there anything you'd like to add?": 'd',
'System': 'SL Simulator',
'Target Viewer Version': 'viewer-development',
'What just happened?': 'a',
'What were you doing when it happened?': 'b',
'What were you expecting to happen instead?': 'c',
'Where': 'Aditi: mesh sandbox 6',
}
```
Steps to Reproduce
Upload the three models tt0.dae, tt1a.dae and tt1d.dae. Use the same mesh for all LODs and for the physics shape. Do not click "Analyze". Rez the objects in-world and switch the Physics shape types to "Prim". Observe the (triangle-based)physics weights using the More Info link in the edit floater.
Actual Behavior
The models tt0 and tt1d have the expected weight of 0.5, but the model tt1a has a weight of 2606 (rounded), which is greater than the maximum of 80 predicted by the wiki.
Expected Behavior
The models used each consist of two oppositely facing equilateral triangles perpendicular to the x axis and with one side parallel to the y axis. They are separated by 0.5m on the x axis and have a width, as defined in the wiki, of 0.5m. In tt0, the triangles are perfectly flat, all vertices having x coordinates 0.25m either side of zero. In tt1a, the top (largest in z coordinate) vertex of the triangle at x=0.25 is displaced 0.000001m towards the x axis (i.e. at x=0.249999). Inn tt1d, the top vertex of the other triangle is displaced 0.000001m towards the x axis (i.e. at x=-0.249999).
The wiki states that the the (harmonic) average triangle width is clamped between 0.001m and 20m. The minimum width of 0.001m implies a maximum weight of K.n/0.001, where K is a constant and n is the number of triangles. Here n=2, so that the maximum weight is 2.K/0.001 = 2000K.
The wiki further states that if all triangles have width 0.5m, so that the average width must be 0.5m, the weight should be 0.1 per triangle. That implies that K/0.5 = 0.1, and thus that K = 0.05. This was tested using two models with more than two triangles of the same size as used in the models described, as the minimum weight of 0.5 is expected to be applied to a model with two triangles. A model containing 32 triangles had a weight of 1.3, and linking five copies of that model gave a weight of 6.4. This implies K = 6.4x0.5/(5x32) = 0.02. A second model consisted of two flat hexagonally joined arrays each of 18 identical triangles, which had a weight of 1.3. Allowing for rounding gave K between 0.017 and 0.019. The value of 0.02 is consistent with a large number of other measurements using triangles of different sizes. It is assumed that the lower value of K with the second model is the result of the width approximation, mentioned in the wiki, for that particular geometry.
The K implied in the wiki would imply a maximum weight for a two-triangle model of 2000x0.04 = 80. The measured value of K implies a maximum weight of 40 for the same model. Whichever K is correct, the weight of a two triangle model should never be higher than 80.
Other information
1) This is related to BUG-1081 and BUG-965, in the sense that it likely originates from the same problem in the weight calculation code. I was advised to submit as a new issue indicating the association with the previous issues, as I cannot add comments to those. This describes an additional way in which the calculation does not perform as described in the wiki, leading to extremely high weights. It is added in the hope that it will aid in identifying the source of the erroneous calculations, as it would appear to happen after the clamping of the average width.
2) The two models tt1a and tt1d contain an exactly identical pair of triangles, the difference being effectively a reflection of the geometry in the YZ plane.
3) The same displacements of each of the other vertices in the triangle at x=0.25 produced similar weights (2642 and 2611).
4) The same displacements of each of the other vertices in the triangle at x=-0.25 left the weight at 0.5.
5) Inverting the order of the two triangles in the did not change the observation (2) and (3), except for small changes in the high weights (2606 to 2611; 2642 to 2611; 2611 unchanged).
Attachments
Links
Related
Original Jira Fields
| Field | Value | | ------------- | ------------- | | Issue | BUG-1339 | | Summary | Minimum average triangle width in triangle-based physics weight calculation does not appear to work | | Type | Bug | | Priority | Unset | | Status | Accepted | | Resolution | Released | | Reporter | Drongle McMahon (drongle.mcmahon) | | Created at | 2013-01-14T19:22:52Z | | Updated at | 2014-03-21T18:41:56Z | ``` { 'Business Unit': ['Platform'], 'Date of First Response': '2013-01-17T16:28:25.067-0600', "Is there anything you'd like to add?": 'd', 'System': 'SL Simulator', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'a', 'What were you doing when it happened?': 'b', 'What were you expecting to happen instead?': 'c', 'Where': 'Aditi: mesh sandbox 6', } ```