public static DependentCircle dCircle(AbstractPoint center, AbstractPoint edge, Vector3 normDir) { DependentCircle dc = DependentCircle.Constructor(); dc.transform.parent = center.transform.parent; dc.center = center; dc.centerPos = center.Position3; dc.edge = edge; dc.edgePos = edge.Position3; dc.normalDir = normDir; HW_GeoSolver.ins.AddDependence(dc, center); HW_GeoSolver.ins.AddDependence(dc, edge); dc.InitializeFigure(); return(dc); }
public void makeSphere(Transform attachedArc, float radius) { #region initalize a sphere DependentCircle circle = attachedArc.GetComponent <DependentCircle>(); //Transform sphereMesh = new GameObject("Sphere").transform; DependentSphere sphere = DependentSphere.Constructor(); sphere.edge = circle.edge; sphere.center = circle.center; sphere.edgePosition = circle.edgePos; sphere.centerPosition = circle.centerPos; sphere.InitializeFigure(); sphere.AddToRManager(); sphere.gameObject.tag = "Sphere"; sphere.GetComponent <MasterGeoObj>().figType = GeoObjType.sphere; HW_GeoSolver.ins.addComponent(sphere.GetComponent <MasterGeoObj>()); HW_GeoSolver.ins.AddDependence(sphere, attachedArc.GetComponent <MasterGeoObj>()); #endregion }