Package rlforj.math

Examples of rlforj.math.Line2I


    activeFields.getLast().steep.near = new Point2I(1, 0);
    activeFields.getLast().steep.far = new Point2I(0, ady + 1);

    Point2I dest = new Point2I(0, 0);

    Line2I stopLine = new Line2I(new Point2I(0, 1), new Point2I(adx, ady + 1)), startLine = new Line2I(
        new Point2I(1, 0), new Point2I(adx + 1, ady));

    // Visit the source square exactly once (in quadrant 1).
    actIsBlocked(state, dest);

    CLikeIterator<fieldT> currentField = new CLikeIterator<fieldT>(
        activeFields.listIterator());
    int maxI = adx + ady;
    // For each square outline
    int lastStartJ = -1;
    Point2I topLeft = new Point2I(0, 0), bottomRight = new Point2I(0, 0);
    for (int i = 1; i <= maxI && !activeFields.isEmpty(); ++i)
    {
      // System.out.println("i "+i);
      int startJ = max(0, i - adx);
      startJ = max(startJ, lastStartJ - 1);
      int maxJ = min(i, ady);

      // System.out.println("Startj "+startJ+" maxj "+maxJ);
      // Visit the nodes in the outline
      int thisStartJ = -1;
      // System.out.println("startJ "+startJ+" maxJ "+maxJ);
      for (int j = startJ; j <= maxJ && !currentField.isAtEnd(); ++j)
      {
        // System.out.println("i j "+i+" "+j);
        dest.x = i - j;
        dest.y = j;
        topLeft.x = dest.x;
        topLeft.y = dest.y + 1;
        bottomRight.x = dest.x + 1;
        bottomRight.y = dest.y;
        // System.out.println(startLine+" "+topLeft+" "+stopLine+"
        // "+bottomRight);
        // System.out.println("isbelow "+startLine.isBelow(topLeft)+"
        // isabove "+stopLine.isAbove(bottomRight));
        if (startLine.isAboveOrContains(topLeft))
        {
          // not in range, continue
          // System.out.println("below start");
          continue;
        }
View Full Code Here


  class fieldT
  {
    public fieldT(fieldT f)
    {
      steep = new Line2I(new Point2I(f.steep.near.x, f.steep.near.y),
          new Point2I(f.steep.far.x, f.steep.far.y));
      shallow = new Line2I(
          new Point2I(f.shallow.near.x, f.shallow.near.y),
          new Point2I(f.shallow.far.x, f.shallow.far.y));
      steepBump = f.steepBump;
      shallowBump = f.shallowBump;
    }
View Full Code Here

TOP

Related Classes of rlforj.math.Line2I

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.