TestFailure: TestMergePositionsMultipleGeometries - Index was outside the bounds of the array.
SimonDarksideJ opened this issue · comments
Prerequisites
- I have verified this issue is present in the
develop
branch - I have searched open and closed issues to ensure it has not already been reported.
MonoGame Version
Develop
Which MonoGame platform are you using?
N/A
Operating System
ALl
Description
The function MeshHelper.CalculateNormals
has an issue in generating the Normals for models, resulting in a failed Unit Test in the MonoGame.Tools solution.
The issue relates in to the creation of a VertextChannel array for the Geometry normals (Line 130 - MeshHelper
)
Steps to Reproduce
- Clone the MonoGame repository - develop
- Open the MonoGame.Tools. solution
- Run the Unit Tests
- Observe the failure of the
TestMergePositionsMultipleGeometries
test
(Run in Bebug to see the specific failure)
Minimal Example Repo
No response
Expected Behavior
MeshHelper.CalculateNormals should complete successfully
Resulting Behavior
TestMergePositionsMultipleGeometries
test failure
Files
No response
You can test further by updating the MathHelper.CalculateTangentFrames and changing the Normals check from a Return (skip processing missing normals) to the commented-out line MeshHelper.CalculateNormals(geom, true); (Generate missing normals)
This is then tested by the newer MissingNormalsTestCustom test, which has a model that includes Normals and is missing normals on some geometry.
The test fails if you attempt to use the CalculateNormals method to regenerate the missing ones.