Exemplo n.º 1
0
        public bool CalculateOptimalTransformation()
        {
            var opo = new oapOptimizer(optTypeSelectorE.rotYtransXYZ);

            opo.verbosity = oapOptimizer.verbosityE.info;
            opo.addOapList(emlist);
            opo.init();
            opo.optimize();
            rotvek_deg = opo.rotvek * 180 / Mathf.PI;
            trnvek_met = opo.trnvek;

            var plausible = true;

            if (Mathf.Abs(rotvek_deg.y) > 10)
            {
                plausible = false;
            }
            if (Vector3.Magnitude(trnvek_met) > 1.0)
            {
                plausible = false;
            }

            SceneMan.Log("Opo status:" + opo.status + "  bstval:" + opo.bstval + "  bstidx:" + opo.bstiter + " Plausible:" + plausible);
            SceneMan.Log("Optimized rotvek:" + rotvek_deg.ToString("f3"));
            SceneMan.Log("Optimized trnvek:" + trnvek_met.ToString("f3"));
            Debug.Log("Opo status:" + opo.status + "  bstval:" + opo.bstval + "  bstidx:" + opo.bstiter + " Plausible:" + plausible);
            Debug.Log("Optimized rotvek:" + rotvek_deg.ToString("f3"));
            Debug.Log("Optimized trnvek:" + trnvek_met.ToString("f3"));
            return(plausible);
        }
Exemplo n.º 2
0
        public void SetSpatialMapping(bool onoff)
        {
            var smgo = GetSpatialMapper();

            if (smgo == null)
            {
                return;
            }
            // var sm = smgo.GetComponent<SpatialMapping>();
            SceneMan.Log("Found Spatial Mapping Component");
            Debug.Log("Found Spatial Mapping Component");
            //  sm.MappingEnabled = onoff;
            //  sm.DrawVisualMeshes = onoff;
            SceneMan.Log("Spatial Mapping " + onoff);
            Debug.Log("Spatial Mapping " + onoff);
        }
Exemplo n.º 3
0
 GameObject GetSpatialMapper()
 {
     if (smgo != null)
     {
         return(smgo);
     }
     smgo = GameObject.Find("Spatial Mapping");
     if (smgo == null)
     {
         SceneMan.Log("Could not find SpatialMapper GameObject");
         return(null);
     }
     SceneMan.Log("Found SpatialMapper GameObject");
     Debug.Log("Found SpatialMapper GameObject");
     return(smgo);
 }
Exemplo n.º 4
0
        public void ChangeNodeName()
        {
            var lcld = node.grc;
            var stat = lcld.ChangeNodeName(node.name, nodeName);

            lastmsg = stat.fullstatus();
            if (stat.ok)
            {
                SceneMan.Log(lastmsg);
                sman.RequestHighObjRefresh(nodeName, "ChangeNodeName");
            }
            else
            {
                SceneMan.Log(lastmsg);
                nodeName = node.name; // change the go name back to avoid confusion
            }
        }