Examples of distanceTo()


Examples of toxi.geom.Vec2D.distanceTo()

    int index = -1;
    float dist = 0;

    for (int i = 0; i < getCentrePath().size(); i++) {
      Vec2D vec = (Vec2D) getCentrePath().get(i);
      if (vec.distanceTo(selectedNode) < dist || index == -1) {
        dist = vec.distanceTo(selectedNode);
        index = i;
      }
    }
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

    float dist = 0;

    for (int i = 0; i < getCentrePath().size(); i++) {
      Vec2D vec = (Vec2D) getCentrePath().get(i);
      if (vec.distanceTo(selectedNode) < dist || index == -1) {
        dist = vec.distanceTo(selectedNode);
        index = i;
      }
    }

    return index;
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

    if (closePoint != null)
      distToClosePoint = closePoint.distanceTo(new Vec2D(x, y));

    if (closePointCentre != null)
      distToClosePointCentre = closePointCentre
          .distanceTo(new Vec2D(x, y));

    if (closePoint != null && (distToClosePoint <= distToClosePointCentre)
        && distToClosePoint < SETTINGS_SKETCH.SELECT_EDGE_DIST) {
      this.path.lastMouseOverVec = closePoint;
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

      if (curSketch instanceof SketchPath
          || curSketch instanceof SketchSpline) {
        Vec2D pointOnPath = curSketch.getClosestPointAlongPath(x, y);

        if ((pointOnPath != null && closestPoint == null)
            || (pointOnPath != null && pointOnPath
                .distanceTo(new Vec2D(x, y)) < closestPoint
                .distanceTo(new Vec2D(x, y)))) {
          closestPoint = new SketchPoint(pointOnPath.copy());
          closestShape = curSketch;
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

      Vec2D closestPointTemp = curSketch.getClosestPointAlongPath(mouseX,
          mouseY);

      if (returnShape == null
          || closestPointTemp.distanceTo(mPos) < closestDist) {
        closestDist = closestPointTemp.distanceTo(mPos);
        returnShape = curSketch;
      }

    }
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

      Vec2D closestPointTemp = curSketch.getClosestPointAlongPath(mouseX,
          mouseY);

      if (returnShape == null
          || closestPointTemp.distanceTo(mPos) < closestDist) {
        closestDist = closestPointTemp.distanceTo(mPos);
        returnShape = curSketch;
      }

    }
    return returnShape;
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

  public SketchPoint getOverSelectPoint(float x, float y) {
    Vec2D pointOnPlan = new Vec2D(x, y);
    SketchPoint p = this.getClosestPathVertex(pointOnPlan);

    if (p != null && pointOnPlan.distanceTo(p) < SETTINGS_SKETCH.select_dia)
      return p;
    else
      return null;
  }
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

  public boolean overSelectPoint(float mouseX, float mouseY) {
    Vec2D pointOnPlan = new Vec2D(mouseX, mouseY);
    SketchPoint p = this.getClosestPathVertex(pointOnPlan);

    if (p != null && pointOnPlan.distanceTo(p) < SETTINGS_SKETCH.select_dia) {

      return true;
    } else
      return false;
  }
View Full Code Here

Examples of toxi.geom.Vec2D.distanceTo()

          Object o = curSketch.getSelectedNodes().get(n);
          Vec2D p = (Vec2D) curSketch.getSelectedNodes().get(n);

          nodeFound = true;
          if (selectedNode == null
              || p.distanceTo(new Vec2D(x, y)) < selectedNode
                  .distanceTo(new Vec2D(x, y))) {
            selectedNode = p;
            selectedNodeObj = o;
          }
        }
View Full Code Here

Examples of toxi.geom.Vec3D.distanceTo()

            collisionsFound++;
            //we found a intersection with the plane
            if (intersect != null) {

              float distToP1 = intersect.distanceTo(p1); //dist to intersection
              float distToP2 = intersect.distanceTo(p2); //dist to intersection
              float distBetweenP1P2 = p1.distanceTo(p2);
              float percentBetween = distToP1 / distBetweenP1P2; //distBetweenP1P2;

              float percent = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.