public override bool CollidesWith(VerticalFunc line, out Vector2 crossPoint) { float y = ValueAt(line.x); crossPoint = new Vector2(line.x, y); bool ret = Line.AreOrdered(line.from, y, line.to) && Line.AreOrdered(from.X, line.x, to.X);//(y <= line.to && y >= line.from); return(ret); }
private void CastVertical() { VerticalFunc func = new VerticalFunc(to.X, from.Y, to.Y); for (int i = 0; i < lines.Count; i++) { Vector2 vecOut; if (lines[i].funct.CollidesWith(func, out vecOut)) { contacts.Add(vecOut); } } }
public override bool CollidesWith(VerticalFunc line, out Vector2 crossPoint) { crossPoint = Vector2.Zero; return false; }
public abstract bool CollidesWith(VerticalFunc line, out Vector2 crossPoint);