private bool LinearSlice(Pair2D slice) { if (sliceJoints) { Slicer2D.Controller.Joints.LinearSliceJoints(slice); } List <Slice2D> results = Slicing.LinearSliceAll(slice, sliceLayer); bool result = false; foreach (Slice2D id in results) { if (id.GetGameObjects().Count > 0) { result = true; } eventHandler.Perform(id); } if (addForce == true) { foreach (Slice2D id in results) { AddForce.LinearSlice(id, addForceAmount); } } return(result); }
public void Draw(Transform transform) { if (input.GetVisualsEnabled() == false) { return; } visuals.Clear(); for (int id = 0; id < 10; id++) { if (input.GetInputHolding(id)) { if (startSliceIfPossible == false || startedSlice == true) { Pair2 pair = linearPair[id]; if (autocompleteDisplay) { pair = GetPair(id); } // If Stripped Line if (strippedLinear) { Vector2List linearPoints = GetLinearVertices(pair, minVertexDistance * visuals.visualScale); if (linearPoints.Count() > 1) { visuals.GenerateComplexMesh(linearPoints); } } else { visuals.GenerateLinearMesh(pair); } if (displayCollisions) { List <Slice2D> results = Slicing.LinearSliceAll(linearPair[id].ToPair2D(), sliceLayer, false); foreach (Slice2D slice in results) { foreach (Vector2D collision in slice.GetCollisions()) { Pair2 p = new Pair2(collision.ToVector2(), collision.ToVector2()); visuals.GenerateLinearMesh(p); } } } } } } visuals.Draw(); return; }