protected FogSetupChangedAction(SerializationInfo info, StreamingContext context) : base(info, context) { v3dLayer = EditorManager.Project.Scene.MainLayer as V3DLayer; oldConfig = (FogSetup)info.GetValue("oldConfig", typeof(FogSetup)); newConfig = (FogSetup)info.GetValue("newConfig", typeof(FogSetup)); }
/// <summary> /// Constructor /// </summary> /// <param name="_v3dLayer"></param> /// <param name="_newConfig"></param> public FogSetupChangedAction(V3DLayer _v3dLayer, FogSetup _newConfig) { v3dLayer = _v3dLayer; oldConfig = v3dLayer.FogSetup; newConfig = _newConfig; }
void IProfileManager_ActiveProfileChanged(object sender, ActiveProfileChangedArgs e) { _forceSetSettings = true; try { ProfileSpecificSettings newSettings = e._activeProfile.GetProfileSettings(); _currentSettings._eSRGBMode = newSettings._eSRGBMode; _currentSettings._bWantsTimeOfDay = newSettings._bWantsTimeOfDay; _currentSettings._defaultLightColor = newSettings._defaultLightColor; NearClipDistance = newSettings._fNearClip; FarClipDistance = newSettings._fFarClip; FOV = newSettings._fFovX; // Time Stepping _currentSettings._iTicksPerSecond = newSettings._iTicksPerSecond; _currentSettings._iMaxTicksPerFrame = newSettings._iMaxTicksPerFrame; // Sky SkyConfig = newSettings._skyConfig; if (SkyConfig == null) { SkyConfig = new VisionSky(); } // Fog FogSetup = newSettings._fogSetup; if (FogSetup == null) { FogSetup = new FogSetup(); } // Time of Day TimeOfDay = newSettings._timeOfDay; EditorManager.RendererNodeManager.UpdateTimeOfDay(TimeOfDay); GlobalAmbientColor = newSettings._globalAmbientColor; // Renderer RendererNodeClass = newSettings._rendererSetup._rendererNodeClass; RendererProperties = newSettings._rendererSetup._rendererProperties; Postprocessors = newSettings._rendererSetup._rendererComponents; EditorManager.EngineManager.SetFogParameters(FogSetup); EditorManager.EngineManager.SetSRGBMode(newSettings._eSRGBMode); EditorManager.EngineManager.SetUpdateTicksPerSecond(_currentSettings._iTicksPerSecond, _currentSettings._iMaxTicksPerFrame, _currentSettings._bLimitFrameRate); //this event is necessary to update the property flags IScene.SendLayerChangedEvent(new LayerChangedArgs(this, null, LayerChangedArgs.Action.PropertyChanged)); } catch (Exception ex) { EditorManager.DumpException(ex, true); } _forceSetSettings = false; }
void OnFogSetupChanged(FogSetup sender) { EditorManager.ActiveView.UpdateView(false); }