Skip to content

Commit

Permalink
Copy particleNorms before resizing
Browse files Browse the repository at this point in the history
This is more a question than an definite bug report or PR.

Shouldn't the normals, if they exist, be copied to the particleNorms before particleNorms is resized? Or is the intention that if the number of normals and vertices differ then all of the particleNorms are populated with <1, 0, 0>?
  • Loading branch information
renngar committed Jun 3, 2021
1 parent 3bf4095 commit db550f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NifFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,9 +1382,9 @@ OptResult NifFile::OptimizeFor(OptOptions& options) {
+ static_cast<uint32_t>(triangles.size()) * 3;
bsOptShape->particleVerts = *vertices;

bsOptShape->particleNorms.resize(vertices->size(), Vector3(1.0f, 0.0f, 0.0f));
if (normals && normals->size() == vertices->size())
if (normals)
bsOptShape->particleNorms = *normals;
bsOptShape->particleNorms.resize(vertices->size(), Vector3(1.0f, 0.0f, 0.0f));

bsOptShape->particleTris = triangles;
}
Expand Down

0 comments on commit db550f2

Please sign in to comment.