Exemplo n.º 1
0
        public Editing3dScale( Editing3d editing3d )
        {
            this.editing3d = editing3d;

            camera = Camera.GetInstance();
            graphics = GraphicsHelperFactory.GetInstance();
            selectionmodel = SelectionModel.GetInstance();
        }
Exemplo n.º 2
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");
        }