コード例 #1
0
ファイル: MeshMask.cs プロジェクト: umetroleah/BigHatWizard
 public ControlPoint(Vector2 anchorPointPosition, Vector2 firstHandlePosition, Vector2 secondHandlePosition, ControlPointType type = ControlPointType.Cusp)
 {
     this.anchorPointPosition  = anchorPointPosition;
     this.firstHandlePosition  = firstHandlePosition;
     this.secondHandlePosition = secondHandlePosition;
     this.type = type;
 }
コード例 #2
0
 protected override void OnMouseDown(MouseEventArgsExtend args)
 {
     base.OnMouseDown(args);
     this.isMouseDown   = true;
     this.isShiftDown   = KeyboardExtend.IsModifyKeyDown(ModifierType.ShiftMask);
     this.moveDirection = MoveDirection.NONE;
     this.lastRotation  = 0f;
     if (this.selectedObjects != null)
     {
         foreach (VisualObject current in this.SelectedObjects)
         {
             if (current.Recorder.IsAutoRecord)
             {
                 current.Recorder.Stop(true);
             }
             else
             {
                 LogConfig.Logger.Error("don't try to start a auto record object's record");
             }
         }
     }
     this.rotationChanged = false;
     this.scaleChanged    = false;
     this.positionChanged = false;
     TimelineActionManager.Instance.CanAutoCreateFirstFrame = false;
     this.lastMousePoint   = args.Point;
     this.controlPointType = (ControlPointType)this.CSCom.GetControlPointType();
 }
コード例 #3
0
 public ControlPoint(string name, ControlPointType type, Point2D basePoint, Point2D location)
 {
     Name      = name;
     Type      = type;
     BasePoint = basePoint;
     Location  = location;
 }
コード例 #4
0
 public ControlPoint(int x, int y, int u, int v, ControlPointType controlPointType, ControlPointDirections controlPointDirections)
 {
     X = x;
     Y = y;
     U = u;
     V = v;
     ControlPointType       = controlPointType;
     ControlPointDirections = controlPointDirections;
 }
コード例 #5
0
ファイル: Part.cs プロジェクト: nickbrick/Letterbox
        public void AddControlPoint(Point position, ControlPointType type)
        {
            var newControlPoint = new ControlPoint(position, this, type: type);

            ControlPoints.Add(newControlPoint);
            ControlPointInserted(this, new PartEventArgs(this, new List <ControlPoint> {
                newControlPoint
            }, ControlPoints.Count));
        }
コード例 #6
0
ファイル: Mapper.cs プロジェクト: danartri/PanoBeam
 public static PanoBeamLib.Blend.ControlPointType ConvertControlPointType(ControlPointType type)
 {
     if (type == ControlPointType.Line)
     {
         return(PanoBeamLib.Blend.ControlPointType.Line);
     }
     if (type == ControlPointType.Spline)
     {
         return(PanoBeamLib.Blend.ControlPointType.Spline);
     }
     throw new Exception($"Unknown ControlPointType {type}");
 }
コード例 #7
0
ファイル: Spline.cs プロジェクト: EmeraldDream/ProjectR
    /// <summary>
    /// Get the Pos Before Spline Head Or After Spline Tail
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    public Vector3 GetAdditionalControlPoint(ControlPointType type)
    {
        Vector3 controlPoint = new Vector3();

        if (m_Knots == null)
        {
            return(controlPoint);
        }

        if (type == ControlPointType.Start)
        {
            controlPoint = GetAdditionalControlPoint(m_Knots[0].transform, m_Knots[1].transform);
        }
        else
        {
            controlPoint = GetAdditionalControlPoint(m_Knots.Last().transform, m_Knots[m_Knots.Count - 2].transform);
        }

        return(controlPoint);
    }
コード例 #8
0
        void OnPickup(HeldObjectData data)
        {
            try
            {
                AgentPrivate agent = ScenePrivate.FindAgent(data.HeldObjectInfo.SessionId);

                holdingAgent         = agent.AgentInfo;
                heldHand             = data.HeldObjectInfo.ControlPoint;
                simpleData.AgentInfo = holdingAgent;
                simpleData.ObjectId  = holdingAgent.ObjectId;

                unsubscribe = agent.Client.SubscribeToCommand(SelectCommand, OnSelect, (d) => { }).Unsubscribe;
            }
            catch (System.Exception)
            {
                holdingAgent         = null;
                simpleData.AgentInfo = null;
                simpleData.ObjectId  = ObjectId.Invalid;
            }
        }
コード例 #9
0
 void OnPickup(HeldObjectData data)
 {
     try {
         unsubscribe?.Invoke();
         unsubscribe  = null;
         holdingAgent = ScenePrivate.FindAgent(data.HeldObjectInfo.SessionId);
         if (IsAdmin(holdingAgent))
         {
             heldHand     = data.HeldObjectInfo.ControlPoint;
             unsubscribe  = holdingAgent.Client.SubscribeToCommand(BanCommand, OnBan, null).Unsubscribe;
             unsubscribe += holdingAgent.Client.SubscribeToCommand(InfoCommand, OnInfo, null).Unsubscribe;
         }
         else
         {
             if (UnauthorizedSound != null)
             {
                 ScenePrivate.PlaySoundAtPosition(UnauthorizedSound, ScenePrivate.FindObject(holdingAgent.AgentInfo.ObjectId).Position, SoundSettings);
             }
             holdingAgent.Client.UI.ModalDialog.Show("This tool is only usable by designated users. Not you.\nPlease drop the tool or you will be forced to drop it.", "Ok", "");
             AgentPrivate invalidUser = holdingAgent;
             Timer.Create(TimeSpan.FromSeconds(60), () => { if (holdingAgent == invalidUser)
                                                            {
                                                                Bannish(holdingAgent, ScenePrivate.SceneInfo.SansarUri);
                                                            }
                          });
         }
         unsubscribe += () => { unsubscribe = null; holdingAgent = null; };
     }
     catch (NullReferenceException nre) { if (DebugSpam)
                                          {
                                              Log.Write("OnPickup", nre.Message);
                                          }
     }                                                                                         // ignore exceptions for not found agents.
     catch (Exception e) { if (DebugSpam)
                           {
                               Log.Write("OnPickup", e.ToString());
                           }
                           holdingAgent = null; }
 }
コード例 #10
0
        void OnPickup(HeldObjectData data)
        {
            try
            {
                AgentPrivate agent = ScenePrivate.FindAgent(data.HeldObjectInfo.SessionId);
                holdingAgent = agent.AgentInfo;
                heldHand     = data.HeldObjectInfo.ControlPoint;

                ammo         = 10;
                shotsFired   = 0;
                shotsHit     = 0;
                score        = 0;
                unsubscribe += agent.Client.SubscribeToCommand(ShootCommand, OnTrigger, (d) => { }).Unsubscribe;
                unsubscribe += agent.Client.SubscribeToCommand(ReloadCommand, Reload, (d) => { }).Unsubscribe;
                Log.Write(GetType().Name, "Gun Picked up");
            }
            catch (System.Exception)
            {
                holdingAgent = null;
                Log.Write(GetType().Name, "Exception picking up gun");
            }
        }
コード例 #11
0
        private void getSegment(AgentPrivate ap, ObjectPrivate op, out Vector start, out Vector end)
        {
            float            distance = 10;
            Quaternion       orientation;
            Vector           offset;
            ControlPointType controlPoint = ControlPointType.GazeTarget;

            if (ap.GetControlPointEnabled(controlPoint))
            {
                offset      = Vector.Forward * distance;
                start       = ap.GetControlPointPosition(controlPoint);
                orientation = ap.GetControlPointOrientation(controlPoint);
            }
            else
            {
                offset      = Vector.Left * distance;
                start       = op.Position + Vector.Up * 0.5f;
                orientation = op.Rotation;
            }

            offset = offset.Rotate(ref orientation);
            end    = start + offset;
        }
コード例 #12
0
ファイル: Beatmap.FromKSH.cs プロジェクト: guusw/fx2
        private void AddControlPoint(float newValue, ControlPointType type, bool lerp)
        {
            ObjectReference last;

            lastControlPoints.TryGetValue(type, out last);

            ControlPoint current = new ControlPoint {
                Type = type, Value = newValue
            };

            current.Position = currentPosition;
            ObjectReference currentReference = new ObjectReference(current, currentMeasure);

            if (lerp && last != null)
            {
                ControlPoint lastControlPoint = (ControlPoint)last.Object;
                current.Previous      = last;
                lastControlPoint.Next = currentReference;
            }

            currentMeasure.Objects.Add(current);
            lastControlPoints[type] = currentReference;
        }
コード例 #13
0
ファイル: Targeting.cs プロジェクト: mandrakefx/sansar-script
        void OnPickup(HeldObjectData data)
        {
            try
            {
                AgentPrivate agent = ScenePrivate.FindAgent(data.HeldObjectInfo.SessionId);

                holdingAgent         = agent.AgentInfo;
                heldHand             = data.HeldObjectInfo.ControlPoint;
                simpleData.AgentInfo = holdingAgent;
                simpleData.ObjectId  = holdingAgent.ObjectId;
                ammo         = ClipSize;
                shotsFired   = 0;
                shotsHit     = 0;
                score        = 0;
                unsubscribe += agent.Client.SubscribeToCommand(ShootCommand, OnTrigger, null).Unsubscribe;
                unsubscribe += agent.Client.SubscribeToCommand(ReloadCommand, Reload, null).Unsubscribe;
            }
            catch (System.Exception)
            {
                holdingAgent         = null;
                simpleData.AgentInfo = null;
                simpleData.ObjectId  = ObjectId.Invalid;
            }
        }
コード例 #14
0
 public HitTestResult(VisualObject hitVisual, PointF hitPoint, OperationType operationType, ControlPointType controlPointType, bool isContinueTest) : base(hitVisual, isContinueTest)
 {
     this.HitPoint         = hitPoint;
     this.OperationType    = operationType;
     this.ControlPointType = controlPointType;
 }
コード例 #15
0
 public HitTestResult(VisualObject hitVisual, PointF hitPoint, OperationType operationType, ControlPointType controlPointType, float rotate) : this(hitVisual, hitPoint, operationType, controlPointType, hitVisual != null && hitVisual.Visible)
 {
     this.Rotate = rotate;
 }
コード例 #16
0
ファイル: ControlPoint.cs プロジェクト: danartri/PanoBeam
 public ControlPoint(double x, double y, ControlPointType pointType)
 {
     X         = x;
     Y         = y;
     PointType = pointType;
 }
コード例 #17
0
ファイル: ControlPoint.cs プロジェクト: nickbrick/Letterbox
 public ControlPoint(Point position, Part part, ControlPointType type = ControlPointType.Primary)
 {
     Position = position;
     Type     = type;
     Part     = part;
 }
コード例 #18
0
 public OperationType UpdateOperationType(PointF point)
 {
     this.operationType    = (OperationType)this.CSCom.HitTest(point);
     this.controlPointType = (ControlPointType)this.CSCom.GetControlPointType();
     return(this.operationType);
 }