public override void UpdateDirty() { if (!dirty) { return; } if (sourceChanged) { if (Solve() != EquationSystem.SolveResult.OKAY) { Debug.LogError("Solve Failed!!!!!!"); } } canvas.Clear(); base.UpdateDirty(); go.transform.SetMatrix(transform); canvas.SetStyle("entities"); foreach (var e in sketch.entityList) { if (!e.isVisible) { continue; } e.Draw(canvas); } sketch.MarkUnchanged(); canvas.UpdateDirty(); }
protected override void OnUpdateDirty() { if (edges == null) { if (canvas == null) { go = new GameObject("MeshImportFeature"); canvas = GameObject.Instantiate(EntityConfig.instance.lineCanvas, go.transform); } else { canvas.Clear(); } canvas.SetStyle("entities"); if (useThreshold) { edges = meshCheck.GenerateEdges(thresholdAngle); } else { edges = new List <Pair <Vector3, Vector3> >(); var indices = mesh.GetIndices(0); var vertices = mesh.vertices; for (int i = 0; i < indices.Length / 3; i++) { for (int j = 0; j < 3; j++) { edges.Add(new Pair <Vector3, Vector3>(vertices[indices[i * 3 + j]], vertices[indices[i * 3 + (j + 1) % 3]])); } } } foreach (var edge in edges) { canvas.DrawLine(edge.a, edge.b); } meshCheck.drawErrors(canvas); } go.transform.SetMatrix(basis.matrix); go.SetActive(visible); }
protected override void OnUpdateDirty() { if (edges == null) { if (canvas == null) { go = new GameObject("MeshImportFeature"); canvas = GameObject.Instantiate(EntityConfig.instance.lineCanvas, go.transform); } else { canvas.Clear(); } canvas.SetStyle("entities"); edges = meshCheck.GenerateEdges(thresholdAngle); foreach (var edge in edges) { canvas.DrawLine(edge.a, edge.b); } meshCheck.drawErrors(canvas); } go.transform.SetMatrix(basis.matrix); go.SetActive(visible); }