コード例 #1
0
ファイル: Class1.cs プロジェクト: ncallaway/StoneCircle
        public bool IntersectsType(CollisionArc target)
        {
            Vector3 difference = location - target.Location;
            float   distance   = difference.X * difference.X + difference.Y * difference.Y;

            if ((distance < radius * radius || distance < target.Radius * target.Radius) && (difference.Z > target.Height || difference.Z < -height))
            {
                float angle = (float)Math.Atan2(-difference.Y, -difference.X);

                return(angle < centerAngle + angleWidth / 2 && angle > centerAngle - angleWidth / 2);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
 public HighHorizontal(Actor Actor)
 {
     id = "High Horizontal Swing";
     //weapon = Weapon;
     maxFrame     = 10;
     attackLength = 45;
     AvailableLow.LStickAction  = null;
     AvailableHigh.LStickAction = null;
     AvailableLow.YButton       = null;
     AvailableHigh.YButton      = null;
     AvailableHigh.NoButton     = null;
     AvailableLow.NoButton      = null;
     knockback = 15;
     hitBox    = new CollisionArc(Vector3.Zero, 0f, 40f,
                                  0f, (float)Math.PI / 4);
     hitBox.Radius = 0;
 }
コード例 #3
0
ファイル: Class1.cs プロジェクト: ncallaway/StoneCircle
 public Vector3 Intersection(CollisionArc target)
 {
     return(-target.Intersection(this));
 }
コード例 #4
0
ファイル: Class1.cs プロジェクト: ncallaway/StoneCircle
 public bool IntersectsType(CollisionArc target)
 {
     return(target.IntersectsType(this));
 }