public List <GameObject> CutObject(GameObject obj, bool destroyPrevious = false) { // represent the NDPlane in obj's reference frame Vector3 refUp = obj.transform.InverseTransformDirection(transform.up); Vector3 refPt = obj.transform.InverseTransformPoint(transform.position); plane.ComputePlane(refPt, refUp); prevCuts = MeshSlicer.CutObjectInstantiate(obj, plane, destroyPrevious); return(prevCuts); }
public void CutObject(GameObject obj, bool destroyPrevious = false) { plane.ComputePlane(transform.position, transform.up); MeshSlicer.CutObjectInstantiate(obj, plane, destroyPrevious); }