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); } }
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; }
public Vector3 Intersection(CollisionArc target) { return(-target.Intersection(this)); }
public bool IntersectsType(CollisionArc target) { return(target.IntersectsType(this)); }