Exemplo n.º 1
0
        protected override void UpdateCameraAfterChange(bool resetHeadLocalAngle = true)
        {
            base.UpdateCameraAfterChange(resetHeadLocalAngle);

            if (resetHeadLocalAngle)
            {
                m_headLocalXAngle = 0;
                m_headLocalYAngle = 0;
            }

            if (m_enableFirstPerson)
            {
                UpdateNearFlag();
            }
            else
            {
                //Disable FPS mode for large cockpit
                if (MySession.IsCameraControlledObject() && MySession.Static.Settings.Enable3rdPersonView)
                {
                    MySession.SetCameraController(MyCameraControllerEnum.ThirdPersonSpectator);
                }
            }

            if (m_enableFirstPerson)
            {
                UpdateCockpitModel();
                UpdateCockpitGlass();

                //Pilot can be null when quiting the game and the player was remote controlling a ship from the same cockpit
                if (Pilot != null)
                {
                    Pilot.EnableHead(!Render.NearFlag);
                }
            }
        }
Exemplo n.º 2
0
        public void OnReleaseControl(IMyCameraController newCameraController)
        {
            UpdateNearFlag();
            if (m_enableFirstPerson)
            {
                UpdateCockpitModel();
                UpdateCockpitGlass();

                if (Pilot != null)
                {
                    Pilot.EnableHead(!Render.NearFlag);
                }
            }
        }