Skip to content

Commit

Permalink
Fix b/64571071: particle import drops particles
Browse files Browse the repository at this point in the history
Turns out we were throwing away 1/3 of the particle quads. No more!

Change-Id: I1f4257936f0d9a00ecf53a7bedc977f1bf173616
  • Loading branch information
dubois committed Aug 10, 2017
1 parent 87f8e85 commit 82d7a5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ internal static void FilterMesh(Mesh mesh, WarningCallback callback) {
ParticleMesh src = ParticleMesh.FromMesh(mesh);
ParticleMesh dst = new ParticleMesh();

// ClassifyQuad wants at least 6 verts to examine
int limit = src.VertexCount - 5;
// ClassifyQuad wants at least 6 indices (2 triangles) to examine
int limit = src.TriangleCount - 6;
int iiVert = 0;
while (iiVert < limit) {
switch (src.ClassifyQuad(iiVert, callback)) {
Expand Down Expand Up @@ -109,7 +109,7 @@ private static ParticleMesh FromMesh(Mesh mesh) {
bool m_bNoisy = true;
int? m_lastMod;

internal int VertexCount { get { return m_vertices.Count; } }
internal int TriangleCount { get { return m_triangles.Count; } }

// iiVert is an index to an index to a vert (an index into m_triangles)
// iiVert must be at least 6 verts from the end of the mesh.
Expand Down

0 comments on commit 82d7a5e

Please sign in to comment.