Package org.mt4j.util.math

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


        v = new Vector3D(this.getVerticesLocal()[2]);
        v.transform(this.getGlobalMatrix());
        return v;
      case UPPER_LEFT:
        v = new Vector3D(this.getVerticesLocal()[0]);
        v.transform(this.getGlobalMatrix());
        return v;
      default:
        break;
      }
      break;
View Full Code Here


//      mouseInfo.ellipse.translate(new Vector3D(0, advanceValue, 0)); //TODO nicht immer neuen vector machen
//      mouseInfo.ellipse.setPositionParentRelative(new Vector3D(mouseInfo.x, mouseInfo.y,0));
      if (currentScene!= null){
        //If canvas is scaled
        Vector3D dir = new Vector3D(mouseInfo.x, mouseInfo.y,0);
        dir.transform(currentScene.getCanvas().getGlobalInverseMatrix());
        mouseInfo.ellipse.setPositionRelativeToParent(dir);
      }else{
        mouseInfo.ellipse.setPositionRelativeToParent(new Vector3D(mouseInfo.x, mouseInfo.y,0));
      }
    }
View Full Code Here

    if (mouseInfo.ellipse != null){
//      mouseInfo.ellipse.translate(new Vector3D(0, advanceValue, 0)); //TODO nicht immer neuen vector machen
      if (currentScene!= null){
        //If canvas is scaled
        Vector3D dir = new Vector3D(mouseInfo.x, mouseInfo.y,0);
        dir.transform(currentScene.getCanvas().getGlobalInverseMatrix());
        mouseInfo.ellipse.setPositionRelativeToParent(dir);
      }else{
        mouseInfo.ellipse.setPositionRelativeToParent(new Vector3D(mouseInfo.x, mouseInfo.y,0));
      }
    }
View Full Code Here

   *
   * @return the obj space vec to parent relative space
   */
  public static Vector3D getLocalVecToParentRelativeSpace(MTComponent referenceComp, Vector3D point){
    Vector3D ret = point.getCopy();
    ret.transform(referenceComp.getLocalMatrix());
    return ret;
  }

  /**
   * Transforms the given vector in global space coordinates
View Full Code Here

    if (referenceComp.getParent() == null){
      return point.getCopy();
    }else{
      Vector3D ret = point.getCopy();
//      System.out.println("parent abs world to local matrix: " + referenceComp.getParent().getAbsoluteWorldToLocalMatrix());
      ret.transform(referenceComp.getParent().getGlobalInverseMatrix());
      return ret;
    }
//    Vector3D ret = point.getCopy(); //OLD WAY
//    ret.transform(referenceComp.getAbsoluteWorldToLocalMatrix());
//    return ret;
View Full Code Here

   *
   * @return A new vector3D object with coordinates relative to the global/canvas.
   */
  public Vector3D localToGlobal(Vector3D point){
    Vector3D ret = point.getCopy();
    ret.transform(this.getGlobalMatrix());
    return ret;
  }
 
 
  /**
 
View Full Code Here

   *
   * @return A new vector3D object with coordinates relative to the parent component.
   */
  public Vector3D localToParent(Vector3D point){
    Vector3D ret = point.getCopy();
    ret.transform(this.getLocalMatrix());
    return ret;
  }
 
 
  /**
 
View Full Code Here

   *
   * @return A new vector3D object with coordinates relative to the components local space.
   */
  public Vector3D parentToLocal(Vector3D point){
    Vector3D ret = point.getCopy();
    ret.transform(this.getLocalInverseMatrix());
    return ret;
  }
 
 
  /**
 
View Full Code Here

   *
   * @return a new vector3D object with coordinates relative to the component.
   */
  public Vector3D globalToLocal(Vector3D point){
    Vector3D ret = point.getCopy();
    ret.transform(this.getGlobalInverseMatrix());
    return ret;
  }
 
 
  /**
 
View Full Code Here

    Matrix refCompLocalToWorld = new Matrix(this.getReferenceComp().getGlobalMatrix());
    //Remove translation for direction vectors(width/height)
    refCompLocalToWorld.removeTranslationFromMatrix();
   
    //obj width vect to world space
    v.transform(refCompLocalToWorld);
   
   
   
    Matrix svgButtonAbsInv = new Matrix(this.getCompToResize().getGlobalInverseMatrix());
    //TODO doch wieder localbase von svg dazutransformen?
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.