public static Geometry.Polygon GetPolyFromVector(Vector3 from, Vector3 to, float width) { var POS = to.Extend(from, from.LSDistance(to)); var direction = (POS - to.To2D()).Normalized(); var pos1 = (to.To2D() - direction.Perpendicular() * width / 2f).To3D(); var pos2 = (POS + (POS - to.To2D()).Normalized() + direction.Perpendicular() * width / 2f).To3D(); var pos3 = (to.To2D() + direction.Perpendicular() * width / 2f).To3D(); var pos4 = (POS + (POS - to.To2D()).Normalized() - direction.Perpendicular() * width / 2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return(poly); }
private Geometry.Polygon GetPoly(Vector3 pos) { var POS = player.ServerPosition.LSExtend(pos, Q.ChargedMaxRange); var direction = (POS.LSTo2D() - player.ServerPosition.LSTo2D()).Normalized(); var pos1 = (player.ServerPosition.LSTo2D() - direction.Perpendicular() * qWidth / 2f).To3D(); var pos2 = (POS.LSTo2D() + (POS.LSTo2D() - player.ServerPosition.LSTo2D()).Normalized() + direction.Perpendicular() * qWidth / 2f).To3D(); var pos3 = (player.ServerPosition.LSTo2D() + direction.Perpendicular() * qWidth / 2f).To3D(); var pos4 = (POS.LSTo2D() + (POS.LSTo2D() - player.ServerPosition.LSTo2D()).Normalized() - direction.Perpendicular() * qWidth / 2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return(poly); }
public static Geometry.Polygon GetPoly(Vector3 pos, float range, float widht) { var POS = player.ServerPosition.Extend(pos, range); var direction = (POS - player.ServerPosition.To2D()).Normalized(); var pos1 = (player.ServerPosition.To2D() - direction.Perpendicular() * widht / 2f).To3D(); var pos2 = (POS + (POS - player.ServerPosition.To2D()).Normalized() + direction.Perpendicular() * widht / 2f).To3D(); var pos3 = (player.ServerPosition.To2D() + direction.Perpendicular() * widht / 2f).To3D(); var pos4 = (POS + (POS - player.ServerPosition.To2D()).Normalized() - direction.Perpendicular() * widht / 2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return(poly); }
public static Geometry.Polygon GetQPolygon(Vector3 destination) { var polygon = new Geometry.Polygon(); for (var i = 10; i < SpellManager.QSkillshotRange; i += 10) { if (i > SpellManager.QSkillshotRange) { break; } polygon.Add(Player.ServerPosition.LSExtend(destination, i)); } return polygon; }
public static Geometry.Polygon GetPolyFromVector(Vector3 from, Vector3 to, float width) { var POS = to.Extend(from, from.Distance(to)); var direction = (POS - to.To2D()).Normalized(); var pos1 = (to.To2D() - direction.Perpendicular()*width/2f).To3D(); var pos2 = (POS + (POS - to.To2D()).Normalized() + direction.Perpendicular()*width/2f).To3D(); var pos3 = (to.To2D() + direction.Perpendicular()*width/2f).To3D(); var pos4 = (POS + (POS - to.To2D()).Normalized() - direction.Perpendicular()*width/2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return poly; }
public static Geometry.Polygon GetPoly(Vector3 pos, float range, float widht) { var POS = player.ServerPosition.Extend(pos, range); var direction = (POS - player.ServerPosition.To2D()).Normalized(); var pos1 = (player.ServerPosition.To2D() - direction.Perpendicular()*widht/2f).To3D(); var pos2 = (POS + (POS - player.ServerPosition.To2D()).Normalized() + direction.Perpendicular()*widht/2f).To3D(); var pos3 = (player.ServerPosition.To2D() + direction.Perpendicular()*widht/2f).To3D(); var pos4 = (POS + (POS - player.ServerPosition.To2D()).Normalized() - direction.Perpendicular()*widht/2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return poly; }
private Geometry.Polygon GetPoly(Vector3 pos) { var POS = player.ServerPosition.LSExtend(pos, Q.ChargedMaxRange); var direction = (POS.LSTo2D() - player.ServerPosition.LSTo2D()).LSNormalized(); var pos1 = (player.ServerPosition.LSTo2D() - direction.LSPerpendicular()*qWidth/2f).To3D(); var pos2 = (POS.LSTo2D() + (POS.LSTo2D() - player.ServerPosition.LSTo2D()).LSNormalized() + direction.LSPerpendicular()*qWidth/2f).To3D(); var pos3 = (player.ServerPosition.LSTo2D() + direction.LSPerpendicular()*qWidth/2f).To3D(); var pos4 = (POS.LSTo2D() + (POS.LSTo2D() - player.ServerPosition.LSTo2D()).LSNormalized() - direction.LSPerpendicular()*qWidth/2f).To3D(); var poly = new Geometry.Polygon(); poly.Add(pos1); poly.Add(pos3); poly.Add(pos2); poly.Add(pos4); return poly; }