-
Notifications
You must be signed in to change notification settings - Fork 160
Add initial ClothProxyMapping utilities #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
54106a2 to
1fd66a0
Compare
0fa7a43 to
2f2aba1
Compare
875059c to
871afd2
Compare
|
|
||
| private static HashSet<ClothVertex> GetClothVertices(ClothMesh mesh) | ||
| { | ||
| var clothVertices = new HashSet<ClothVertex>(mesh.Vertices.Where(v => v.Weight > 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
871afd2 to
9ce1366
Compare
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.