public AnimationGraphPreview(AnimationGraphWindow window) : base(true) { _window = window; // Show floor widget _showFloorButton = ViewWidgetShowMenu.AddButton("Floor", OnShowFloorModelClicked); _showFloorButton.Icon = Style.Current.CheckBoxTick; _showFloorButton.IndexInParent = 1; // Floor model _floorModel = new StaticModel { Position = new Vector3(0, -25, 0), Scale = new Vector3(5, 0.5f, 5), Model = FlaxEngine.Content.LoadAsync <Model>(StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Primitives/Cube.flax")) }; Task.AddCustomActor(_floorModel); // Enable shadows PreviewLight.ShadowsMode = ShadowsCastingMode.All; PreviewLight.CascadeCount = 2; PreviewLight.ShadowsDistance = 1000.0f; Task.ViewFlags |= ViewFlags.Shadows; }
public Preview(ModelWindow window) : base(true) { _window = window; // Show floor widget _showFloorButton = ViewWidgetShowMenu.AddButton("Floor", OnShowFloorModelClicked); _showFloorButton.IndexInParent = 1; // Show current LOD widget _showCurrentLODButton = ViewWidgetShowMenu.AddButton("Current LOD", OnShowCurrentLODClicked); _showCurrentLODButton.IndexInParent = 2; // Floor model _floorModel = StaticModel.New(); _floorModel.Position = new Vector3(0, -25, 0); _floorModel.Scale = new Vector3(5, 0.5f, 5); _floorModel.Model = FlaxEngine.Content.LoadAsync <Model>(StringUtils.CombinePaths(Globals.EditorFolder, "Primitives/Cube.flax")); _floorModel.IsActive = false; Task.AddCustomActor(_floorModel); // Enable shadows PreviewLight.ShadowsMode = ShadowsCastingMode.All; PreviewLight.CascadeCount = 3; PreviewLight.ShadowsDistance = 2000.0f; Task.ViewFlags |= ViewFlags.Shadows; }
public Preview(SkinnedModelWindow window) : base(true) { _window = window; PlayAnimation = true; // Show floor widget _showFloorButton = ViewWidgetShowMenu.AddButton("Floor", button => { _floorModel.IsActive = !_floorModel.IsActive; _showFloorButton.Icon = _floorModel.IsActive ? Style.Current.CheckBoxTick : SpriteHandle.Invalid; }); _showFloorButton.IndexInParent = 1; // Show current LOD widget _showCurrentLODButton = ViewWidgetShowMenu.AddButton("Current LOD", button => { _showCurrentLOD = !_showCurrentLOD; _showCurrentLODButton.Icon = _showCurrentLOD ? Style.Current.CheckBoxTick : SpriteHandle.Invalid; }); _showCurrentLODButton.IndexInParent = 2; // Floor model _floorModel = new StaticModel { Position = new Vector3(0, -25, 0), Scale = new Vector3(5, 0.5f, 5), Model = FlaxEngine.Content.LoadAsync <Model>(StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Primitives/Cube.flax")), IsActive = false }; Task.AddCustomActor(_floorModel); // Enable shadows PreviewLight.ShadowsMode = ShadowsCastingMode.All; PreviewLight.CascadeCount = 3; PreviewLight.ShadowsDistance = 2000.0f; Task.ViewFlags |= ViewFlags.Shadows; }