Add initial ClothProxyMapping utilities#249
Draft
nicoco007 wants to merge 2 commits intoNorbyte:masterfrom
Draft
Add initial ClothProxyMapping utilities#249nicoco007 wants to merge 2 commits intoNorbyte:masterfrom
nicoco007 wants to merge 2 commits intoNorbyte:masterfrom
Conversation
54106a2 to
1fd66a0
Compare
0fa7a43 to
2f2aba1
Compare
875059c to
871afd2
Compare
Norbyte
reviewed
Jun 10, 2024
|
|
||
| private static HashSet<ClothVertex> GetClothVertices(ClothMesh mesh) | ||
| { | ||
| var clothVertices = new HashSet<ClothVertex>(mesh.Vertices.Where(v => v.Weight > 0)); |
Owner
There was a problem hiding this comment.
It might be easier to store an Added flag in ClothVertex.
This improves things in 3 ways:
- No need to build a HashSet out of verts
AddOverlappingVerticesandAddNeighboringVerticesdoes not need to iterate over the complete set of vertices each time it is called, and re-check each vertex against the HashSet to see if it was added already; instead, if verts were kept in a List,AddOverlappingVerticesandAddNeighboringVerticescould just check the vert list starting from the last index they inspected, hence skipping verts whose neighbors and overlaps were already added.GetTargetClothVerticesis simplified, as the output ofGetClothVerticesalready contains a packed list of verts, so there is no need to separately buildpackedVertices
Contributor
Author
There was a problem hiding this comment.
You're totally right about the first two points, but I don't think the 3rd one is possible since I need the final number of vertices to build packedVertices in the right order. I'm not sure it'd really be easier with an Added flag, but I'll see what I can do.
Norbyte
reviewed
Jun 10, 2024
871afd2 to
9ce1366
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds some barebones utilities for populating the
ClothProxyMappingsection of a VisualBank resource. Testing against game meshes with this to get an idea of how accurate it is.