Added two new overloads to Geometry.CalculateNormals
CalculateNormals(Span<Vector3> vertexData, Span<uint> elementData). Takes spans instead of arrays as inputs. usefull when you only want to make normals from part of you vertices.
CalculateNormals(Span<Vector3> vertexData, Span<uint> elementData, Span<Vector3> normalData). Same as previous one, except you have to supply your own array that the calculated normals will reside in. Useful when you know you can reuse an array.
´Span´ is part of the nuget package System.Memory. System.Memory required newer versions of the other packages this project uses so they had to be updated.
There was previously two versions on CalculateNormals, one that took an uint array of elements and one that took an int array. I merged those two into one method.
Added two checks to the method. First verifies that the element array length is a multiple of three. The second checks whether the supplied normal array is the same length as the vertex array.
Added two new overloads to
Geometry.CalculateNormals
CalculateNormals(Span<Vector3> vertexData, Span<uint> elementData)
. Takes spans instead of arrays as inputs. usefull when you only want to make normals from part of you vertices.CalculateNormals(Span<Vector3> vertexData, Span<uint> elementData, Span<Vector3> normalData)
. Same as previous one, except you have to supply your own array that the calculated normals will reside in. Useful when you know you can reuse an array.´Span´ is part of the nuget package
System.Memory
.System.Memory
required newer versions of the other packages this project uses so they had to be updated.There was previously two versions on
CalculateNormals
, one that took anuint
array of elements and one that took anint
array. I merged those two into one method. Added two checks to the method. First verifies that the element array length is a multiple of three. The second checks whether the supplied normal array is the same length as the vertex array.Lastly added a few tests to verify the behavior.