protected ModelComponent(IViewService viewService, Lazy <IAppModeService> appModeServiceLazy) { this.appModeServiceLazy = appModeServiceLazy; SingleColor = true; selectInteractionELement = new SelectOnClickInteractionElement(this, viewService); hittable = new SphereHittable <IModelComponent>(this, c => c.Model.BoundingSphere * c.Node.GlobalTransform); }
protected SpherePackingComponent(IEmbeddedResources embeddedResources, IViewService viewService, Lazy <IAppModeService> appModeServiceLazy) { this.embeddedResources = embeddedResources; this.viewService = viewService; this.appModeServiceLazy = appModeServiceLazy; Radius = 0.05f; Color = Color4.Red; selectInteractionELement = new SelectOnClickInteractionElement(this, viewService); hittable = new SphereHittable <SpherePackingComponent>(this, x => x.LocalBoundingSphere * x.Node.GlobalTransform); }
protected DragRectangleGizmoComponent(IInputHandler inputHandler, IUndoRedoService undoRedo) { hittable = new RectangleHittable <DragRectangleGizmoComponent>( this, Transform.Identity, x => x.GetRectComponent()?.Rectangle ?? DefaultRect, x => - 1f / (1 << 18)); interactionElement = new DragRectangleInteractionElement <DragRectangleGizmoComponent>(this, x => x.GetRectComponent(), x => x.GetChildSpace(), inputHandler, undoRedo); }
protected ResizeRectangleGizmoComponent(IInputHandler inputHandler, IEmbeddedResources embeddedResources, IUndoRedoService undoRedo) { visualElement = ModelVisualElement.New() .SetModel(embeddedResources.CubeModel()) .SetMaterial(StandardMaterial.New() .SetNoSpecular(true) .FromGlobalCache()) .SetTransform(Transform.Scaling(0.025f)); interactionElement = new ResizeRectangleInteractionElement <ResizeRectangleGizmoComponent>( this, x => x.GetRectAspect(), x => x.GetChildSpace(), x => x.Place, inputHandler, undoRedo); hittable = new SphereHittable <ResizeRectangleGizmoComponent>(this, x => { var globalTransform = Node.GlobalTransform; return(new Sphere(globalTransform.Offset, 0.025f * globalTransform.Scale)); }); }
protected StoryComponent(IViewService viewService, ICommonNodeFactory commonNodeFactory, IToolService toolService, IToolFactory toolFactory, IRenderService renderService, Lazy <IStoryService> storyGraphServiceLazy, INavigationService navigationService, Lazy <IAppModeService> appModeServiceLazy) { this.viewService = viewService; this.commonNodeFactory = commonNodeFactory; this.toolService = toolService; this.toolFactory = toolFactory; this.renderService = renderService; this.storyGraphServiceLazy = storyGraphServiceLazy; this.navigationService = navigationService; this.appModeServiceLazy = appModeServiceLazy; ShowAux1 = true; ShowAux2 = true; selectInteractionElement = new SelectOnClickInteractionElement(this, viewService); focusInteractionElement = new FocusOnDoubleClickInteractionElement(this); navigateInteractionElement = new NavigateOnDoubleClickInteractionElement(this, navigationService); }
protected CirclePackingAutoComponent(IEmbeddedResources embeddedResources, IViewService viewService, ICoroutineService coroutineService) { this.embeddedResources = embeddedResources; this.coroutineService = coroutineService; solver = new CirclePackingSolver(); Reset(); borderModel = new ExplicitModel(ResourceVolatility.Stable) { IndexSubranges = new ExplicitModelIndexSubrange[1], Topology = ExplicitModelPrimitiveTopology.LineStrip }; backgroundVisualElement = ModelVisualElement.New(this) .SetModel(embeddedResources.SimplePlaneXyModel()) .SetMaterial(StandardMaterial.New() .SetIgnoreLighting(true) .SetDiffuseColor(Color4.Black) .FromGlobalCache()) .SetRenderState(StandardRenderState.New() .SetZOffset(-GraphicsHelper.MinZOffset)) .SetTransform(x => Transform.Translation(new Vector3(x.border.BoundingRect.Center, 0))) .SetNonUniformScale(x => new Vector3( x.border.BoundingRect.HalfWidth, x.border.BoundingRect.HalfHeight, 1)); borderVisualElement = ModelVisualElement.New(this) .SetModel(x => x.GetRelevantBorderModel()) .SetMaterial(StandardMaterial.New() .SetDiffuseColor(Color4.Yellow) .SetIgnoreLighting(true) .FromGlobalCache()); circleVisualElements = new List <IVisualElement>(); selectOnClickInterationElement = new SelectOnClickInteractionElement(this, viewService); // todo: make precise hittable = new RectangleHittable <CirclePackingAutoComponent>(this, Transform.Identity, x => x.border.BoundingRect, x => 0); }
public void RegisterIAVolume(IInteractionElement interactionVolume) { registeredIAVolumes.Add(interactionVolume); }