Package toxi.geom

Examples of toxi.geom.Vec2D


    this.getSketch().mouseReleased(v.x, v.y);
  }
 
 
  public void mouseDoubleClick(int mouseX, int mouseY) {
    Vec2D v = GLOBAL.uiTools.getPointOnPlane(new Vec2D(mouseX, mouseY),
        this.getPlane());
    this.getSketch().mouseDoubleClick(v.x, v.y);   
  }
View Full Code Here


    }

    if (SETTINGS.DEBUG) {
      g.stroke(255, 0, 0);
      for (int i = 0; i < this.debugIntersectionPoints.size(); i++) {
        Vec2D p = this.debugIntersectionPoints.get(i);
        float crossWidth = 20;
        g.line(p.x - (crossWidth / 2), p.y + (crossWidth / 2), p.x
            + (crossWidth / 2), p.y - (crossWidth / 2));
        g.line(p.x + (crossWidth / 2), p.y + (crossWidth / 2), p.x
            - (crossWidth / 2), p.y - (crossWidth / 2));
        //g.ellipse(p.x,p.y,0,20);
      }

      g.stroke(0, 0, 255);
      for (int i = 0; i < this.debugIntersectionPointsTop.size(); i++) {
        Vec2D p = this.debugIntersectionPointsTop.get(i);
        float tWidth = 20;
        float hover = 20;
        if (p != null) {
          g.line(p.x, p.y - hover, p.x, p.y - (tWidth + hover));
          g.line(p.x - (tWidth / 2), p.y - (tWidth + hover), p.x
              + (tWidth / 2), p.y - (tWidth + hover));
        }
      }

      g.stroke(0, 0, 255);
      for (int i = 0; i < this.debugIntersectionPointsBottom.size(); i++) {
        Vec2D p = this.debugIntersectionPointsBottom.get(i);
        float bHeight = 20;
        float bWidth = 10;
        float hover = 20;
        if (p != null) {
          g.line(p.x - (bWidth / 2), p.y + hover, p.x - (bWidth / 2),
View Full Code Here

    this.getSketch().setLayerSelected(true);
  }

  public void selectNodes(int mouseX, int mouseY) {
    if (this.getPlane() != null && this.getSketch() != null) {
      Vec2D transMouse = GLOBAL.uiTools.getPointOnPlane(new Vec2D(mouseX,
          mouseY), this.getPlane());

      if (transMouse != null)
        this.getSketch().selectNodes(transMouse.x, transMouse.y);
    }
View Full Code Here

    if (element.getAttributeValue("c1x") != null
        && element.getAttributeValue("c1x") != null) {
      float xmlC1X = Float.valueOf(element.getAttributeValue("c1x"));
      float xmlC1Y = Float.valueOf(element.getAttributeValue("c1y"));
      this.controlPoint1 = new Vec2D(xmlC1X, xmlC1Y);
    }

    if (element.getAttributeValue("c2x") != null
        && element.getAttributeValue("c2x") != null) {
      float xmlC2X = Float.valueOf(element.getAttributeValue("c2x"));
      float xmlC2Y = Float.valueOf(element.getAttributeValue("c2y"));
      this.controlPoint2 = new Vec2D(xmlC2X, xmlC2Y);
    }

  }
View Full Code Here

  public SketchPoint clone() {
    SketchPoint returnPoint = new SketchPoint(this.x, this.y);

    if (this.controlPoint1 != null)
      returnPoint.controlPoint1 = new Vec2D(this.controlPoint1.x,
          this.controlPoint1.y);

    if (this.controlPoint2 != null)
      returnPoint.controlPoint2 = new Vec2D(this.controlPoint2.x,
          this.controlPoint2.y);
    return returnPoint;

  }
View Full Code Here

  }

  public Vec2D getControlPoint1() {
    if (controlPoint1 == null)
      return new Vec2D(this.x, this.y);
    else
      return controlPoint1;
  }
View Full Code Here

      return controlPoint1;
  }

  public Vec2D getControlPoint2() {
    if (controlPoint2 == null)
      return new Vec2D(this.x, this.y);
    else
      return controlPoint2;
  }
View Full Code Here

      x += v.x;
      y += v.y;
    }
    if (this.getPath().size() > 0)
      return new Vec2D(x / this.getPath().size(), y
          / this.getPath().size());
    else
      return null;
  }
View Full Code Here

      scale = (((int) ((scale * 100.0f) / 5.0f)) * 5.0f) / 100.0f;
      scale = gui.applet.constrain(scale, 0.1f, 0.15f);
      scale = 0.15f; //just keep one scale at the moment

     
      Vec2D v = new Vec2D(width/2,GLOBAL.sketchChairs.getCurChair().getWidth()/2.0f);
      v.rotate((float) (Math.PI/2));
      float rotatedWidth = -v.x*2;
      float totalWidth = ((rotatedWidth*scale)+(width*scale/2));

      float yBorder = 10;
     
View Full Code Here

      scale = (((int) ((scale * 100.0f) / 5.0f)) * 5.0f) / 100.0f;
      scale = gui.applet.constrain(scale, 0.1f, 0.15f);
      scale = 0.15f;//0.15f; //just keep one scale at the moment


      Vec2D v = new Vec2D(width/2,GLOBAL.sketchChairs.getCurChair().getWidth()/2.0f);
      v.rotate((float) (Math.PI/2));
      float rotatedWidth = -v.x*2;
     
      float yBorder =10;
      float totalWidth = ((rotatedWidth*scale)+(width*scale/2));
      //setting at 0 0 draws the chair in the top left corner of the fbo
View Full Code Here

TOP

Related Classes of toxi.geom.Vec2D

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.