Package org.mt4j.components.bounds

Examples of org.mt4j.components.bounds.BoundsZPlaneRectangle


        break;
    }
   
    //Create some default texture coords
    if (returnComponent != null && returnComponent.hasBounds() && returnComponent.getBounds() instanceof BoundsZPlaneRectangle){
      BoundsZPlaneRectangle bounds = (BoundsZPlaneRectangle) returnComponent.getBounds();
      float width = bounds.getWidthXY(TransformSpace.LOCAL);
      float height = bounds.getHeightXY(TransformSpace.LOCAL);
      float upperLeftX = bounds.getVectorsLocal()[0].x;
      float upperLeftY = bounds.getVectorsLocal()[0].y;
      Vertex[] verts = returnComponent.getVerticesLocal();
      for (int i = 0; i < verts.length; i++) {
        Vertex vertex = verts[i];
        vertex.setTexCoordU((vertex.x-upperLeftX)/width);
        vertex.setTexCoordV((vertex.y-upperLeftY)/height);
View Full Code Here


        tile.setUserData("top", top);
        tile.setUserData("right", right);
        tile.setUserData("bottom", bottom);
        tile.setUserData("left", left);
        //Create some default texture coords
        tile.setBounds(new BoundsZPlaneRectangle(tile));
        if (tile != null && tile.hasBounds() && tile.getBounds() instanceof BoundsZPlaneRectangle){
          BoundsZPlaneRectangle bounds = (BoundsZPlaneRectangle) tile.getBounds();
         
//          float width = bounds.getWidthXY(TransformSpace.LOCAL);
//          float height = bounds.getHeightXY(TransformSpace.LOCAL);
//          float upperLeftX = bounds.getVectorsLocal()[0].x;
//          float upperLeftY = bounds.getVectorsLocal()[0].y;
View Full Code Here

     
    }
    @Override
    protected IBoundingShape computeDefaultBounds() {
      //Use z plane bounding rect instead default boundingsphere since always 2D!
      return new BoundsZPlaneRectangle(this);
    }
View Full Code Here

      super(vertices, applet);
    }
   
    protected IBoundingShape computeDefaultBounds() {
      //Use z plane bounding rect instead default boundingsphere since always 2D!
      return new BoundsZPlaneRectangle(this);
    }
View Full Code Here

   */
  public Clip(PApplet pApplet, float x, float y, float width, float height) {
    MTRectangle clipRect = new MTRectangle(x, y, width, height, pApplet);
    clipRect.setNoStroke(true);
    if (clipRect.getBounds() == null ){
      clipRect.setBounds(new BoundsZPlaneRectangle(clipRect));
    }else{
      if (!(clipRect.getBounds() instanceof BoundsZPlaneRectangle)){
        clipRect.setBounds(new BoundsZPlaneRectangle(clipRect));
      }
    }
    clipRect.setBoundsBehaviour(AbstractShape.BOUNDS_ONLY_CHECK)
    this.clipShape = clipRect;
   
View Full Code Here

  /* (non-Javadoc)
   * @see com.jMT.components.visibleComponents.shapes.MTPolygon#computeDefaultBounds()
   */
  @Override
  protected IBoundingShape computeDefaultBounds(){
    return new BoundsZPlaneRectangle(this);
  }
View Full Code Here

  @Override
  protected IBoundingShape computeDefaultBounds() {
//    super.computeDefaultBounds();
     //FIXME if the ellipse is rotatet X or Y, the bounding shape doesent work anymore.. to be safe we
    //would have to use boundingshpere or box..but slower..
    return new BoundsZPlaneRectangle(this);
  }
View Full Code Here

    this.setPickable(false);
    //Actually dont draw this polygon - only its children (this.setVisible(false) would not draw the children)
    this.setNoFill(true);
    this.setNoStroke(true);
    //Because this is used in 2D on the z=0 plane probably.
    this.setBounds(new BoundsZPlaneRectangle(this));
    this.addChild(svgImage);
   
    if (stretchToFitWidth && stretchToFitHeight){
      svgImage.setSizeXYRelativeToParent(this.getWidthXY(TransformSpace.LOCAL), this.getHeightXY(TransformSpace.LOCAL));
    }else if (stretchToFitWidth){
View Full Code Here

    //register no gesture processors
  }
 
  @Override
  protected IBoundingShape computeDefaultBounds() {
    return  new BoundsZPlaneRectangle(this);
  }
View Full Code Here

       
        if (shape.hasBounds()){
          if (shape.getBounds() instanceof BoundsZPlaneRectangle || shape.getBounds() instanceof BoundsArbitraryPlanarPolygon){
            verts = shape.getBounds().getVectorsGlobal();
          }else{
            BoundsZPlaneRectangle b = new BoundsZPlaneRectangle(shape);
            verts = b.getVectorsGlobal();
          }
        }else{
          BoundsZPlaneRectangle b = new BoundsZPlaneRectangle(shape);
          verts = b.getVectorsGlobal();
//           verts = shape.getVerticesGlobal();
        }
       
        for (Vector3D v : verts){
          allClusteredVerts.add(v);
View Full Code Here

TOP

Related Classes of org.mt4j.components.bounds.BoundsZPlaneRectangle

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.