Ejemplo n.º 1
0
    public Arml CreateARMLElements(string prefab, string id, GeoLocation geo, float compass, float viewArc)
    {
        createdTrackables = new List <TrackableElement>();
        createdViewPoints = new List <ViewPointElement>();
        createdSectors    = new List <SectorElement>();
        createdFeatures   = new List <FeatureElement>();

        creationTrackable = new TrackableElement();
        creationSector    = new SectorElement();
        creationViewPoint = new ViewPointElement();
        creationFeature   = new FeatureElement();

        SetTrackableElement(id);
        SetSectorElement(id, creationTrackable, compass, viewArc);
        SetViePointElement(id, creationSector, geo);
        SetFeatureElement(id, creationTrackable, prefab);

        createdTrackables.Add(creationTrackable);
        createdSectors.Add(creationSector);
        createdViewPoints.Add(creationViewPoint);
        createdFeatures.Add(creationFeature);

        arml                       = new Arml();
        arml.aRElements            = new ARElements();
        arml.aRElements.Trackables = createdTrackables;
        arml.aRElements.Sectors    = createdSectors;
        arml.aRElements.ViewPoints = createdViewPoints;
        arml.aRElements.Features   = createdFeatures;

        createdArmls.Add(arml);

        return(arml);
    }
Ejemplo n.º 2
0
        private void CreateViewpoint(ViewPointElement vpElement, Arml arml)
        {
            GameObject viewpointGO = new GameObject(vpElement.name);

            viewpointGO.transform.SetParent(viewpointsRoot.transform);
            Viewpoint vp = viewpointGO.AddComponent <Viewpoint>();

            if (vpElement.Point != null)
            {
                double[] pos = vpElement.Point.ParsePos();
                vp.latitude  = pos [0];
                vp.longitude = pos [1];
            }
            vp.zoneName = vpElement.zoneid;
            List <SectorElement> spotSectors = GetSectors(vpElement.SectorLinks, arml.aRElements.Sectors);

            foreach (SectorElement se in spotSectors)
            {
                string trackableId = GetTrackableId(se, arml.aRElements.Trackables);
                vp.CreateViewingSectorAndFindTrackable(se.ArcByCenterPoint.startAngle, se.ArcByCenterPoint.endAngle, trackableId);
            }
            ViewPointCreated(this, new EventArg <Viewpoint>(vp));
        }