Examples of Vec2D


Examples of toxi.geom.Vec2D

    return gPath;

  }

  public SketchShape getOverShape(float x, float y) {
    Vec2D closePoint = getClosestPointAlongPath(x, y);
    if (closePoint != null
        && closePoint.distanceTo(new Vec2D(x, y)) < SETTINGS_SKETCH.SELECT_EDGE_DIST) {
      this.lastMouseOverVec = closePoint;
      this.lastMouseOverPercent = getClosestPercent(x, y);
      return this;
    }
    return null;
View Full Code Here

Examples of toxi.geom.Vec2D

    return getLengthTo(index) / this.getlength();
  }

  public Vec2D getPerpendicular(float percent) {

    Vec2D vecBefore = null;
    Vec2D vecAfter = null;

    float offsetSearch = .01f;

    if (percent - offsetSearch < 0)
      vecBefore = this.getPos((percent));
    else
      vecBefore = this.getPos((percent - offsetSearch));

    if (percent + offsetSearch > 1)
      vecAfter = this.getPos((percent));
    else
      vecAfter = this.getPos((percent + offsetSearch));

    if (vecAfter == null)
      return null;

    vecAfter = (Vec2D) vecAfter.sub(vecBefore);
    vecAfter.normalize();
    // SketchPoint newAn = vecAfter.getRotated((float)(Math.PI/2));

    if (WoundClockwise())
      vecAfter = vecAfter.rotate((float) Math.PI);

    return vecAfter;
  }
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.