// Set slicing objects static void SetSlices(RFShatter shatter, Transform tm, RFSlice slices) { // Filter List <Transform> list = new List <Transform>(); for (int i = 0; i < slices.sliceList.Count; i++) { if (slices.sliceList[i] != null) { list.Add(slices.sliceList[i]); } } // No objects if (list.Count == 0) { return; } // Get slice data Vector3[] points = list.Select(t => t.position).ToArray(); Vector3[] norms = list.Select(t => slices.Axis(t)).ToArray(); // Set params shatter.SetBricksParams(points, norms, tm); }
// Copy from void CopyFrom(RayfireShatter shatter) { type = shatter.type; voronoi = new RFVoronoi(shatter.voronoi); splinters = new RFSplinters(shatter.splinters); slabs = new RFSplinters(shatter.slabs); radial = new RFRadial(shatter.radial); custom = new RFCustom(shatter.custom); slice = new RFSlice(shatter.slice); tets = new RFTets(shatter.tets); mode = shatter.mode; material.CopyFrom(shatter.material); clusters = new RFShatterCluster(shatter.clusters); advanced = new RFShatterAdvanced(shatter.advanced); }
// Constructor public RFSlice(RFSlice src) { plane = src.plane; sliceList = src.sliceList; }