Esempio n. 1
0
        void generate_points(PivotSO pivotSO, Frame3f targetSceneF)
        {
            PivotSOSnapPoint pt   = new PivotSOSnapPoint(pivotSO);
            Frame3f          objF = targetSceneF.ToFrame(pt.FrameS);

            snapFramesL.Add(objF);
        }
Esempio n. 2
0
        public HUDRadialMenu GeneratePivotRadialMenu(float fDiameter, PivotSO pivot)
        {
            HUDRadialMenu popup = new HUDRadialMenu();

            popup.Radius    = fDiameter * 0.5f;
            popup.TextScale = fDiameter * TextScale;
            float Pullback = 2.0f;

            if (cockpit.Context.TransformManager.HaveActiveGizmo &&
                cockpit.Context.TransformManager.ActiveGizmo.SupportsReferenceObject)
            {
                popup.AppendMenuItem("Use\nFrame", (s, o) => {
                    cockpit.Context.TransformManager.SetActiveReferenceObject(pivot);
                });
            }
            popup.AppendMenuItem("Teleport\nHere", (s, o) => {
                Teleporter.TeleportTowards_Level(cockpit.ActiveCamera, cockpit.Scene,
                                                 pivot.GetLocalFrame(CoordSpace.WorldCoords).Origin, Pullback);
            });
            popup.AppendMenuItem("Center", (s, o) => {
                cockpit.ActiveCamera.Animator().AnimatePanFocus(
                    pivot.GetLocalFrame(CoordSpace.WorldCoords).Origin, CoordSpace.WorldCoords, 0.3f);
            });
            popup.AppendMenuItem("Delete", (s, o) => {
                cockpit.Scene.History.PushChange(
                    new DeleteSOChange()
                {
                    scene = cockpit.Scene, so = pivot
                });
                cockpit.Scene.History.PushInteractionCheckpoint();
            });

            return(popup);
        }
Esempio n. 3
0
        public IVectorDisplacementSourceOp AppendLengthenOp(PivotSO Source)
        {
            Frame3f deformF = Frame3f.Identity;

            deformF = SceneTransforms.TransformTo(deformF, Source, leg);

            LengthenOp deformOp = new LengthenOp()
            {
                BasePoint        = deformF.Origin,
                Direction        = -Vector3d.AxisY,
                BandDistance     = 50.0f,
                LengthenDistance = 2.0f,
                MeshSource       = SOMeshSource
            };

            Combiner.Append(deformOp);
            SO_Op.Add(Source, deformOp);

            OnDeformationAdded?.Invoke(Source, deformOp);

            return(deformOp);
        }
Esempio n. 4
0
 public PivotSOSnapPoint(PivotSO pivotSO, int priority = 10)
 {
     so            = pivotSO;
     unique_id     = SnapGeometryUniqueIDGenerator.Allocate();
     this.priority = priority;
 }