コード例 #1
0
ファイル: Player.cs プロジェクト: tubitos/1
        public Player(IScreen screen, Vector3 position, Matrix rotation, SimpleModel model, float width, float height, Boolean useThirdPerson = false)
            : base(screen, position, rotation, width, height, new Vector3(1F))
        {
            this.height = height * scale.Y;

            charecter.CharacterController.HorizontalMotionConstraint.Speed = 50;
            charecter.CharacterController.HorizontalMotionConstraint.MaximumForce = 10000;
            charecter.CharacterController.JumpSpeed = 35;

            mod = model;

            obj = new IObject(Materials.dMaterial, mod, charecter);

            Mouse.SetPosition(EngineSettings.graphicInfo.BackBufferWidth / 2, EngineSettings.graphicInfo.BackBufferHeight / 2);
            bstate = Mouse.GetState();

            rotSpeed = 0.05F;
            zoomDistance = 50;

            camera = new PlayerCamera(obj, (height / 2));
            camera.HorizontalOffset = -camera.HorizontalOffset;

            UpdateCamera();

            firstPerson = !useThirdPerson;

            this.Start();
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: tubitos/1
        public Player(IScreen screen, Vector3 position, Matrix rotation, SimpleModel model, float width, float height, Boolean useThirdPerson = false)
            : base(screen, position, rotation, width, height, new Vector3(1F))
        {
            this.height = height * scale.Y;

            charecter.CharacterController.HorizontalMotionConstraint.Speed        = 50;
            charecter.CharacterController.HorizontalMotionConstraint.MaximumForce = 10000;
            charecter.CharacterController.JumpSpeed = 35;

            mod = model;

            obj = new IObject(Materials.dMaterial, mod, charecter);

            Mouse.SetPosition(EngineSettings.graphicInfo.BackBufferWidth / 2, EngineSettings.graphicInfo.BackBufferHeight / 2);
            bstate = Mouse.GetState();

            rotSpeed     = 0.05F;
            zoomDistance = 50;

            camera = new PlayerCamera(obj, (height / 2));
            camera.HorizontalOffset = -camera.HorizontalOffset;

            UpdateCamera();

            firstPerson = !useThirdPerson;

            this.Start();
        }