示例#1
0
        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
 public Vector3 Intersection(CollisionArc target)
 {
     return(-target.Intersection(this));
 }
示例#4
0
 public bool IntersectsType(CollisionArc target)
 {
     return(target.IntersectsType(this));
 }