Exemplo n.º 1
0
        public static SimWaypoint CreateGlobal(Vector3d v3d)
        {
            Vector3      v3        = SimPathStore.GlobalToLocal(v3d);
            SimPathStore PathStore = SimPathStore.GetPathStore(v3d);

            return(CreateLocal(v3, PathStore));
        }
        public string DistanceVectorString(Vector3d loc3d)
        {
            Vector3      loc = SimPathStore.GlobalToLocal(loc3d);
            SimPathStore R   = SimPathStore.GetPathStore(loc3d);

            return(String.Format("{0:0.0#}m ", Vector3d.Distance(GlobalPosition, loc3d))
                   + String.Format("{0}/{1:0.0#}/{2:0.0#}/{3:0.0#}", R.RegionName, loc.X, loc.Y, loc.Z));
        }
Exemplo n.º 3
0
        public string DistanceVectorString(Vector3d loc3d)
        {
            Vector3      loc = SimPathStore.GlobalToLocal(loc3d);
            SimPathStore R   = SimPathStore.GetPathStore(loc3d);

            return(String.Format("{0:0.00}m ", DistanceNoZ(GetWorldPosition(), loc3d))
                   + String.Format("{0}/{1:0.00}/{2:0.00}/{3:0.00}", R.RegionName, loc.X, loc.Y, loc.Z));
        }
        public static CollisionIndex CreateCollisionIndex(Vector3 from, SimPathStore PathStore)
        {
            float          POINTS_PER_METER = PathStore.POINTS_PER_METER;
            int            PX = PathStore.ARRAY_X(from.X);
            int            PY = PathStore.ARRAY_Y(from.Y);
            CollisionIndex WP;

            lock (PathStore.MeshIndex)
            {
                WP = PathStore.MeshIndex[PX, PY];
                if (WP != null)
                {
                    return(WP);
                }
                from.X = PX / POINTS_PER_METER;
                from.Y = PY / POINTS_PER_METER;
                Vector3d GlobalPos = PathStore.GetPathStore().LocalToGlobal(from);
                WP = new CollisionIndex(from, GlobalPos, PX, PY, PathStore);
            }
            return(WP);
        }
Exemplo n.º 5
0
        public void SetGlobalPos(Vector3d v3d)
        {
            SimPathStore R = SimPathStore.GetPathStore(v3d);

            _LocalPos  = SimPathStore.GlobalToLocal(v3d);
            PathStore  = R.GetPathStore3D(_LocalPos);
            _GlobalPos = R.LocalToGlobal(_LocalPos);
            //PX = (int)Math.Round(_LocalPos.X * PathStore.POINTS_PER_METER);
            //PY = (int)Math.Round(_LocalPos.Y * PathStore.POINTS_PER_METER);
            if (_IncomingArcs != null)
            {
                foreach (SimRoute A in _IncomingArcs)
                {
                    A.LengthUpdated = false;
                }
            }
            if (_OutgoingArcs != null)
            {
                foreach (SimRoute A in _OutgoingArcs)
                {
                    A.LengthUpdated = false;
                }
            }
        }