Example #1
0
 public EditController()
 {
     CommandCombos.GetInstance().RegisterAtLeastCommand("increaseheight", new KeyCommandHandler(handler_IncreaseHeight));
     CommandCombos.GetInstance().RegisterAtLeastCommand("decreaseheight", new KeyCommandHandler(handler_DecreaseHeight));
     MetaverseClient.GetInstance().Tick     += new MetaverseClient.TickHandler(EditController_Tick);
     ViewerState.GetInstance().StateChanged += new ViewerState.StateChangedHandler(EditController_StateChanged);
 }
Example #2
0
        public KeyHandlerQuit()
        {
            LogFile.WriteLine("instantiating keyhandlerquit");
            CommandCombos.GetInstance().RegisterAtLeastCommand("quit", new KeyCommandHandler(QuitKeyDown));
            //KeyFilterComboKeys keyfiltercombokeys = KeyFilterComboKeys.GetInstance();
            //keyfiltercombokeys.RegisterCombo( new string[]{"quit"},null, new KeyComboHandler( QuitKeyDown ) );

            //RendererFactory.GetInstance().RegisterContextMenu(new string[]{ "Quit","&Quit" }, new ContextMenuCallback( ContextMenuQuit ) );
            ContextMenuController.GetInstance().RegisterPersistentContextMenu(new string[] { "Quit", "&Quit" }, new ContextMenuHandler(ContextMenuQuit));
            MenuController.GetInstance().RegisterMainMenu(new string[] { "&File", "&Quit" }, new MainMenuCallback(Quit));
        }
        public SelectionController()
        {
            selectionmodel = SelectionModel.GetInstance();

            //KeyFilterComboKeys keyfiltercombokeys = KeyFilterComboKeys.GetInstance();
            CommandCombos.GetInstance().RegisterAtLeastCommand("selectobject",
                                                               new KeyCommandHandler(SelectObjectKeyDown));
            CommandCombos.GetInstance().RegisterAtLeastCommand("selectindividual",
                                                               new KeyCommandHandler(SelectIndividualKeyDown));

            //keyfiltercombokeys.RegisterCombo( new string[]{"selectobject"},null, new KeyComboHandler( SelectObjectKeyDown ) );
            //keyfiltercombokeys.RegisterCombo( new string[]{"selectindividual"},null, new KeyComboHandler( SelectIndividualKeyDown ) );
        }
Example #4
0
        public PlayerMovement()
        {
            Test.Debug("instantiating PlayerMovement()");

            Config config = Config.GetInstance();

            //XmlElement minnode = (XmlElement)config.clientconfig.SelectSingleNode("worldboundingboxmin");
            //XmlElement maxnode =(XmlElement) config.clientconfig.SelectSingleNode("worldboundingboxmax");
            WorldBoundingBoxMin = new Vector3(0, 0, config.mingroundheight);
            WorldBoundingBoxMax = new Vector3(config.world_xsize, config.world_ysize, config.ceiling);
            Test.WriteOut(WorldBoundingBoxMin);
            Test.WriteOut(WorldBoundingBoxMax);

            XmlElement movementnode = (XmlElement)config.clientconfig.SelectSingleNode("movement");

            fAvatarAcceleration = Convert.ToDouble(movementnode.GetAttribute("acceleration"));
            fAvatarTurnSpeed    = Convert.ToDouble(movementnode.GetAttribute("turnspeed"));
            fAvatarMoveSpeed    = Convert.ToDouble(movementnode.GetAttribute("movespeed"));
            fVerticalMoveSpeed  = Convert.ToDouble(movementnode.GetAttribute("verticalmovespeed"));
            fDeceleration       = Convert.ToDouble(movementnode.GetAttribute("deceleration"));

            camera = Camera.GetInstance();
            //KeyFilterComboKeys keyfiltercombokeys = KeyFilterComboKeys.GetInstance();

            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "moveleft", new KeyCommandHandler(MoveLeft));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "moveright", new KeyCommandHandler(MoveRight));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "movebackwards", new KeyCommandHandler(MoveBackwards));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "moveforwards", new KeyCommandHandler(MoveForwards));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "moveup", new KeyCommandHandler(MoveUp));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "movedown", new KeyCommandHandler(MoveDown));

            ViewerState.GetInstance().StateChanged += new ViewerState.StateChangedHandler(PlayerMovement_StateChanged);
            MouseCache.GetInstance().MouseMove += new MouseMoveHandler(PlayerMovement_MouseMove);
            MetaverseClient.GetInstance().worldstorage.terrainmodel.TerrainModified += new TerrainModel.TerrainModifiedHandler(terrainmodel_TerrainModified);

            timekeeper = new TimeKeeper();

            Test.Debug("PlayerMovement instantiated");
        }
Example #5
0
        public void Login(string username, string password)
        {
            LogFile.WriteLine(this.GetType().ToString() + " trying to login as " + username + " ... ");
            this.mylogin = username;
            imimplementation.Login(username, password);
            //logindialog.Destroy();

            Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "chatwindow", "");
            app.Autoconnect(this);

            imimplementation.IMReceived += new IMReceivedHandler(MessageReceived);

            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "activatechat", new KeyCommandHandler(EnterChat));

            btnshowusers.Clicked   += new EventHandler(btnshowusers_Clicked);
            btnshowservers.Clicked += new EventHandler(btnshowservers_Clicked);
        }
Example #6
0
        public Editing3d()
        {
            selectionmodel        = SelectionModel.GetInstance();
            mousefiltermousecache = MouseCache.GetInstance();

            CommandCombos.GetInstance().RegisterCommandGroup(
                new string[] { CMD_EDITPOSITION, CMD_EDITSCALE, CMD_EDITROTATION }, new KeyCommandHandler(EditModeKeyEvent));

            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "leftmousebutton", new KeyCommandHandler(MouseDown));

            mousefiltermousecache.MouseMove += new MouseMoveHandler(MouseMove);

            editing3dpos   = new Editing3dPos(this);
            editing3drot   = new Editing3dRot(this);
            editing3dscale = new Editing3dScale(this);

            RendererFactory.GetInstance().WriteNextFrameEvent += new WriteNextFrameCallback(Editing3d_WriteNextFrameEvent);
        }
Example #7
0
        //const string CMD_ZOOM = "camerazoom";
        //const string CMD_PAN = "camerapan";
        //const string CMD_ORBIT = "cameraorbit";

        public Camera()
        {
            MouseCache mousefiltermousecache = MouseCache.GetInstance();

            ViewerState.GetInstance().StateChanged += new ViewerState.StateChangedHandler(Camera_StateChanged);

            //  CommandCombos.GetInstance().RegisterCommandGroup(
            //    new string[]{ CMD_ZOOM, CMD_PAN, CMD_ORBIT }, new KeyCommandHandler(CameraModeHandler));
            //CommandCombos.GetInstance().RegisterCommand(
            //  "cameraorbit", new KeyCommandHandler(CameraModeOrbitHandler));
            //CommandCombos.GetInstance().RegisterCommand(
            //  "camerapan", new KeyCommandHandler(CamerModePanHandler));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "toggleviewpoint", new KeyCommandHandler(ToggleViewpointHandler));
            CommandCombos.GetInstance().RegisterAtLeastCommand(
                "leftmousebutton", new KeyCommandHandler(MouseDown));
            MouseCache.GetInstance().MouseMove += new MouseMoveHandler(Camera_MouseMove);

            RendererFactory.GetInstance().PreDrawEvent += new PreDrawCallback(Camera_PreDrawEvent);
        }
Example #8
0
 ViewerState()
 {
     CommandCombos.GetInstance().RegisterCommandGroup(
         new string[] { CMD_MOUSELOOK, CMD_ZOOM, CMD_PAN, CMD_ORBIT }, new KeyCommandHandler(CameraModeHandler));
 }