コード例 #1
0
 public bool CreateFragmentListFromSaveData(HomographyEditor editor)
 {
     FragmentSaveFormat[] fsfList = FragmentsData;
     foreach (FragmentSaveFormat fsf in fsfList)
     {
         HomographyFragment hf = editor.CreateFragment().GetComponent <HomographyFragment> ();
         if (!fsf.GetFragment(ref hf))
         {
             return(false);
         }
     }
     editor.ScaleHomography = ScaleHomography;
     return(true);
 }
コード例 #2
0
        public override void Update()
        {
            HomographyFragment hf       = mHomographyEditor.CreateFragment().GetComponent <HomographyFragment> ();
            Vector3            mousePos = Input.mousePosition;
            Vector2            stdPos   = mHomographyEditor.ConvertPosToUv(new Vector2(mousePos.x, mousePos.y));
            FragmentVertex     fv       = new FragmentVertex(stdPos);

            hf.FragmentVertices.Add(fv);

            List <FragmentPoint> selectedList = mHomographyEditor.SelectedPointList;

            selectedList.RemoveRange(0, selectedList.Count);
            selectedList.Add(fv);

            mHomographyEditor.ManipulationMode = mHomographyEditor.EditTarget | HomographyEditor.ManipulationKind.Add;
            Controller.ReplaceManipulation(new MoveVertex());
        }