Closed Arc-huangjingtong closed 5 months ago
please fil the formular, we have a summary foreach release, so people can click on your PR and read what it is about without reading the code changes
In this func , has some fix
- if (tessellation < 3) tessellation = 3;
+ tessellation = Math.Max(3, tessellation); //more concise
- var vertices = new List<VertexPositionNormalTexture>();
- var indices = new List<int>();
//because the array size is definite , dont new list and toArray,it will be quickly
+ VertexPositionNormalTexture[] vertices = new VertexPositionNormalTexture[stride * stride];
+ int[] indices = new int[tessellation * tessellation * 6];
+ var indexerIndices = 0;
+ var indexerVertices = 0;
...
+ vertices[indexerVertices++] = ....
+ indices[indexerIndices++] = i * stride + j;
+ indices[indexerIndices++] = i * stride + nextJ;
+ indices[indexerIndices++] = nextI * stride + j;
+ indices[indexerIndices++] = i * stride + nextJ;
+ indices[indexerIndices++] = nextI * stride + nextJ;
+ indices[indexerIndices++] = nextI * stride + j;
- return new GeometricMeshData<VertexPositionNormalTexture>(vertices.ToArray(), indices.ToArray(),toLeftHanded) { Name = "Torus" };
+ return new GeometricMeshData<VertexPositionNormalTexture>(vertices, indices, toLeftHanded) { Name = "Torus" };
please fil the formular, we have a summary foreach release, so people can click on your PR and read what it is about without reading the code changes
yes , i done 😄
the pr details would be about what its changing overall
a description
the pr details would be about what its changing overall公关细节将是关于它的整体变化
a description 描述
Sorry ,now i get it 😿
Anyway, nice change. I think it would be nice to extend this same change to the other GeometricPrimitive
s.
Anyway, nice change. I think it would be nice to extend this same change to the other
GeometricPrimitive
s.总之,不错的变化。我认为将相同的更改扩展到其他GeometricPrimitive
s 会很好。
yes , if this pr success ,i will modified others
why closed?
why closed?
because i operate worrying , i will recommit in beijing time(utc➕8) night
why closed? 为什么关闭?
because i operate worrying , i will recommit in beijing time(utc➕8) night因为我担心,我会在北京时间(UTC➕8)晚上重新承诺
sorry I may not be able to fulfill my agreement
I'm a little under the weather
no hurry :D
PR Details
optimize method in GeometricPrimitive.Torus.New(...) it will avoid GC form List2Array
Related Issue
Types of changes
Checklist