예제 #1
0
        public DrawSurfaceCurveTool(FScene scene, SceneObject target)
        {
            this.scene  = scene;
            this.target = target;

            behaviors = new InputBehaviorSet();

            // TODO is this where we should be doing this??
            behaviors.Add(
                new DrawSurfaceCurveTool_2DBehavior(scene.Context)
            {
                Priority = 5
            });
            behaviors.Add(
                new DrawSurfaceCurveTool_SpatialDeviceBehavior(scene.Context)
            {
                Priority = 5
            });


            // shut off transform gizmo
            scene.Context.TransformManager.PushOverrideGizmoType(TransformManager.NoGizmoType);

            scene.SelectionChangedEvent += Scene_SelectionChangedEvent;

            // restore radius
            //if (SavedSettings.Restore("DrawSurfaceCurveTool_width") != null)
            //    width = (float)SavedSettings.Restore("DrawSurfaceCurveTool_width");
        }
예제 #2
0
        public void PushCockpit(ICockpitInitializer initializer)
        {
            Cockpit trackingInitializer = null;

            if (activeCockpit != null)
            {
                trackingInitializer = activeCockpit;
                inputBehaviors.Remove(activeCockpit.InputBehaviors);
                overrideBehaviors.Remove(activeCockpit.OverrideBehaviors);
                cockpitStack.Push(activeCockpit);
                activeCockpit.RootGameObject.SetActive(false);
            }

            Cockpit c = new Cockpit(this);

            activeCockpit = c;
            if (Use2DCockpit)
            {
                c.UIElementLayer = FPlatform.UILayer;
            }
            c.Start(initializer);
            if (trackingInitializer != null)
            {
                c.InitializeTracking(trackingInitializer);
            }
            inputBehaviors.Add(c.InputBehaviors);
            overrideBehaviors.Add(c.OverrideBehaviors);

            mouseCursor.ResetCursorToCenter();
        }
예제 #3
0
        public SurfaceBrushTool(FScene scene, DMeshSO target)
        {
            this.scene  = scene;
            this.target = target;

            behaviors = new InputBehaviorSet();

            // TODO is this where we should be doing this??
            behaviors.Add(
                new SurfaceBrushTool_2DInputBehavior(this, scene.Context)
            {
                Priority = 5
            });
            if (FPlatform.IsUsingVR())
            {
                behaviors.Add(
                    new SurfaceBrushTool_SpatialBehavior(this, scene.Context)
                {
                    Priority = 5
                });
            }

            // shut off transform gizmo
            scene.Context.TransformManager.PushOverrideGizmoType(TransformManager.NoGizmoType);

            Indicators = new ToolIndicatorSet(this, scene);
        }
예제 #4
0
        public BaseSingleClickTool(FScene scene)
        {
            this.Scene = scene;

            // do this here ??
            behaviors = new InputBehaviorSet();
            behaviors.Add(
                new BaseSingleClickTool_2DBehavior(scene.Context, ObjectFilter)
            {
                Priority = 5
            });
        }
예제 #5
0
        public DrawPrimitivesTool(FScene scene)
        {
            this.scene = scene;

            behaviors = new InputBehaviorSet();

            // TODO is this where we should be doing this??
            behaviors.Add(
                new DrawPrimitivesTool_MouseBehavior(scene.Context)
            {
                Priority = 5
            });
            behaviors.Add(
                new DrawPrimitivesTool_SpatialDeviceBehavior(scene.Context)
            {
                Priority = 5
            });

            // shut off transform gizmo
            scene.Context.TransformManager.SetOverrideGizmoType(TransformManager.NoGizmoType);
        }
예제 #6
0
        public SculptCurveTool(FScene scene, List <SceneObject> targets)
        {
            this.scene = scene;

            behaviors = new InputBehaviorSet();

            // TODO is this where we should be doing this??
            behaviors.Add(
                new SculptCurveTool_2DInputBehavior(this, scene.Context)
            {
                Priority = 5
            });
            behaviors.Add(
                new SculptCurveTool_SpatialBehavior(this, scene.Context)
            {
                Priority = 5
            });

            // shut off transform gizmo
            scene.Context.TransformManager.PushOverrideGizmoType(TransformManager.NoGizmoType);

            scene.SelectionChangedEvent += Scene_SelectionChangedEvent;
            // initialize active set with input selection
            Scene_SelectionChangedEvent(null, null);


            indicators     = new ToolIndicatorSet(this, scene);
            brushIndicator = new BrushCursorSphere()
            {
                PositionF = () => { return(lastBrushPos.Origin); },
                Radius    = fDimension.World(() => { return(radius.WorldValue); })
            };
            moveSphereMat   = MaterialUtil.CreateTransparentMaterialF(Colorf.CornflowerBlue, 0.2f);
            smoothSphereMat = MaterialUtil.CreateTransparentMaterialF(Colorf.ForestGreen, 0.2f);
            indicators.AddIndicator(brushIndicator);
            brushIndicator.material = moveSphereMat;

            SmoothAlpha      = 0.15f;
            SmoothIterations = 5;
        }
예제 #7
0
        public BaseSurfacePointTool(FScene scene)
        {
            this.Scene = scene;

            // do this here ??
            behaviors = new InputBehaviorSet();
            behaviors.Add(
                new BaseSurfacePointTool_2DBehavior(scene.Context, ObjectFilter)
            {
                Priority = 5
            });
            if (FPlatform.IsUsingVR())
            {
                behaviors.Add(
                    new BaseSurfacePointTool_SpatialBehavior(scene.Context, ObjectFilter)
                {
                    Priority = 5
                });
            }

            // shut off transform gizmo
            Scene.Context.TransformManager.PushOverrideGizmoType(TransformManager.NoGizmoType);
        }
예제 #8
0
        public CurveSelectFacesTool(FScene scene, DMeshSO target)
        {
            Scene  = scene;
            Target = target;

            behaviors = new InputBehaviorSet();

            // TODO is this where we should be doing this??
            behaviors.Add(
                new CurveSelectFacesTool_2DBehavior(this, scene.Context)
            {
                Priority = 5
            });

            Indicators = new ToolIndicatorSet(this, scene);
        }