Exemplo n.º 1
0
        void Go()
        {
            string sText = SiteBox.Text;

            if (string.IsNullOrEmpty(sText))
            {
                return;
            }
            sText        = sText.Trim();
            SiteBox.Text = sText;
            Vector3d dest = Decoder.Decode(sText);

            if (Globals.Network.Connected == true)
            {
                MMessageBus.TeleportRequest(this, dest, Globals.LocalUpRotation());
            }
            else
            {
                MScene.Camera.transform.Position    = dest;
                Globals.UserAccount.CurrentPosition = MassiveTools.ArrayFromVector(dest);
                Globals.Avatar.SetPosition(dest);
                MMessageBus.AvatarMoved(this, Globals.UserAccount.UserID, dest, Quaterniond.Identity);
            }
            MMessageBus.Navigate(this, dest);
        }
Exemplo n.º 2
0
        private void MMessageBus_BookmardAddRequestEvent(object sender, BookmarkEvent e)
        {
            MBookmark b = new MBookmark();

            b.Name     = e.Name;
            b.Position = MassiveTools.ArrayFromVector(e.Position);
            b.Rotation = MassiveTools.ArrayFromQuaterniond(e.Rotation);
            Bookmarks.Add(b);
            Save();
            MMessageBus.BookmarkAdded(this, e);
        }
Exemplo n.º 3
0
        void Add(MBuildingBlock bb)
        {
            LastBuild = bb;
            if (MStateMachine.ZoneLocked == true)
            {
                MMessageBus.Error(this, "Can't build here, zone is locked / other building nearby");
                return;
            }

            Vector3d pos = Globals.Avatar.GetPosition();

            if (bb.TemplateID.Equals(MBuildParts.FOUNDATION01))
            {
                pos += Globals.Avatar.Forward() * 13 - Globals.Avatar.Up() * 1.0;
            }
            else
            {
                pos += Globals.Avatar.Forward() * 4 + Globals.Avatar.Up() * 3.0;
            }

            Quaterniond rot = Globals.LocalUpRotation();

            if (SelectedItem != null)
            {
                rot = SelectedItem.transform.Rotation;
                //prevent smaller items getting lost in the foundation
                if (SelectedItem.TemplateID != MBuildParts.FOUNDATION01)
                {
                    //pos = SelectedItem.transform.Position;
                }
            }

            if (Globals.Network.Connected == true)
            {
                Globals.Network.SpawnRequest(bb.TemplateID, "TEXTURE01", bb.TemplateID, bb.TemplateID, pos, rot);
            }
            else
            {
                MServerObject mso = new MServerObject();
                mso.InstanceID = Helper.GUID();
                mso.OwnerID    = Globals.UserAccount.UserID;
                mso.TextureID  = bb.TextureID;
                mso.TemplateID = bb.TemplateID;
                mso.Position   = MassiveTools.ArrayFromVector(pos);
                mso.Rotation   = MassiveTools.ArrayFromQuaterniond(rot);
                MMessageBus.CreateObjectRequest(this, mso);
            }
        }
Exemplo n.º 4
0
        private void HomeButton_Click(object sender, EventArgs e)
        {
            MServerZone zone = MZoneService.Find("Earth");
            //Vector3d pos = MassiveTools.Vector3dFromVector3_Server(zone.Position);

            //cape town
            Vector3d pos = MassiveTools.VectorFromArray(Globals.UserAccount.HomePosition);

            if (Globals.Network.Connected == true)
            {
                MMessageBus.TeleportRequest(Globals.UserAccount.UserID, pos, Quaterniond.Identity);
            }
            else
            {
                MScene.Camera.transform.Position    = pos;
                Globals.UserAccount.CurrentPosition = MassiveTools.ArrayFromVector(pos);
                Globals.Avatar.SetPosition(pos);
                MMessageBus.AvatarMoved(this, Globals.UserAccount.UserID, pos, Quaterniond.Identity);
            }
        }
Exemplo n.º 5
0
 private void MMessageBus_AvatarMovedEvent(object sender, MoveEvent e)
 {
     Globals.UserAccount.CurrentPosition = MassiveTools.ArrayFromVector(Globals.Avatar.GetPosition());
 }
Exemplo n.º 6
0
 void CreateAvatar()
 {
     Globals.UserAccount.HomePosition    = MassiveTools.ArrayFromVector(new Vector3d(12717655836.0836, 146353256922.555, -7581841295.85195));
     Globals.UserAccount.CurrentPosition = Globals.UserAccount.HomePosition;
     MMessageBus.ChangeAvatarRequest(this, Globals.UserAccount.UserID, Globals.UserAccount.AvatarID);
 }