Package org.mt4j.util.math

Examples of org.mt4j.util.math.Vector3D.transform()


*/
  public float getWidthXYRelativeToParent() {
    Vector3D p = this.widthVect.getCopy();
    Matrix m = new Matrix(this.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
 
 
  /**
 
View Full Code Here


   */
  public float getWidthXYGlobal() {
    Vector3D p = this.widthVect.getCopy();
    Matrix m = new Matrix(this.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
 
 
 
View Full Code Here

*/
  public float getHeightXYRelativeToParent() {
    Vector3D p = this.heightVect.getCopy();
    Matrix m = new Matrix(this.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
 
  /**
   * Gets the "height vector" and transforms it to world space, then calculates
View Full Code Here

   */
  public float getHeightXYGlobal() {
    Vector3D p = this.heightVect.getCopy();
    Matrix m = new Matrix(this.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
 
  /**
   * Scales the shape to the given height relative to parent space.
View Full Code Here

   *
   * @return the center point relative to parent
   */
  public Vector3D getCenterPointRelativeToParent(){
    Vector3D c = this.centerPointLocal.getCopy();
    c.transform(this.getLocalMatrix());
    return c;
  }
 
  /**
   * Gets the center point global.
View Full Code Here

   *
   * @return the center point global
   */
  public Vector3D getCenterPointGlobal(){
    Vector3D c = this.centerPointLocal.getCopy();
    c.transform(this.getGlobalMatrix());
    return c;
  }
 
  /**
   * Sets the global position of the component. (In global coordinates)
View Full Code Here

       */
      protected Vector3D getRefCompCenterRelParent(AbstractShape shape){
        Vector3D centerPoint;
        if (shape.hasBounds()){
          centerPoint = shape.getBounds().getCenterPointLocal();
          centerPoint.transform(shape.getLocalMatrix()); //macht den punkt in self space
        }else{
          Vector3D localObjCenter = shape.getCenterPointGlobal();
          localObjCenter.transform(shape.getGlobalInverseMatrix()); //to localobj space
          localObjCenter.transform(shape.getLocalMatrix()); //to parent relative space
          centerPoint = localObjCenter;
View Full Code Here

        if (shape.hasBounds()){
          centerPoint = shape.getBounds().getCenterPointLocal();
          centerPoint.transform(shape.getLocalMatrix()); //macht den punkt in self space
        }else{
          Vector3D localObjCenter = shape.getCenterPointGlobal();
          localObjCenter.transform(shape.getGlobalInverseMatrix()); //to localobj space
          localObjCenter.transform(shape.getLocalMatrix()); //to parent relative space
          centerPoint = localObjCenter;
        }
        return centerPoint;
      }
View Full Code Here

          centerPoint = shape.getBounds().getCenterPointLocal();
          centerPoint.transform(shape.getLocalMatrix()); //macht den punkt in self space
        }else{
          Vector3D localObjCenter = shape.getCenterPointGlobal();
          localObjCenter.transform(shape.getGlobalInverseMatrix()); //to localobj space
          localObjCenter.transform(shape.getLocalMatrix()); //to parent relative space
          centerPoint = localObjCenter;
        }
        return centerPoint;
      }
  }//Class closebutton actionlistener
View Full Code Here

            //FIXME we could insetead just set the new value with setValue()
//            System.out.println("OUT OF BOUNDS RIGHT ->");
            Vector3D pos = new Vector3D( x + outerWidthLocal - innerPadding -knobWidthRelParent*0.5f, y + knobHeightRelParent*0.5f + innerPadding, 0);
//            pos.transform(outerShape.getGlobalMatrix());
//            knob.setPositionGlobal(pos);
            pos.transform(outerShape.getLocalMatrix());
            knob.setPositionRelativeToParent(pos);
          }else if( (knobCenterRelToParent.x - knobWidthRelParent*0.5f ) < (x + innerPadding) ){
//            System.out.println("OUT OF BOUNDS LEFT <-");
            Vector3D pos = new Vector3D( x + knobWidthRelParent*0.5f  + innerPadding, y + knobHeightRelParent*0.5f + innerPadding, 0);
//            pos.transform(outerShape.getGlobalMatrix());
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.