Package org.mt4j.util.math

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


          }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());
//            knob.setPositionGlobal(pos);
            pos.transform(outerShape.getLocalMatrix());
            knob.setPositionRelativeToParent(pos);
          }
         
//          System.out.println("Slider value: " + getValue());
         
View Full Code Here


    float knobAdvanceFromLeftValue =  valueOffsetFromMinValue * valueRangeToSliderValueRange;
   
    Vector3D pos = new Vector3D( x + innerPadding + knobWidthRelParent*0.5f + knobAdvanceFromLeftValue , y + knob.getHeightXY(TransformSpace.RELATIVE_TO_PARENT)*0.5f + innerPadding, 0);
//    pos.transform(outerShape.getGlobalMatrix());
//    knob.setPositionGlobal(pos);
    pos.transform(outerShape.getLocalMatrix());
    knob.setPositionRelativeToParent(pos);
   
//    System.out.println("slidervalue: " + sliderAdvanceFromLeftValue);
   
    //Fire property change event
View Full Code Here

 
 
  public Vector3D getCenterPointGlobal() {
    if (centerWorldDirty){
      Vector3D tmp = this.getCenterPointLocal();
      tmp.transform(this.peerComponent.getGlobalMatrix());
//      tmp = peerComponent.localToGlobal(tmp);
      this.centerPointWorld = tmp;
      this.centerWorldDirty = false;
      return this.centerPointWorld;
    }
View Full Code Here

   */
  private float getHeightXYRelativeToParent() {
    Vector3D p = this.getHeightXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
//    Vector3D[] v = this.getVectorsRelativeToParent();
//    float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
//    return minMax[3] - minMax[1];
View Full Code Here

   */
  private float getHeightXYGlobal() {
    Vector3D p = this.getHeightXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
//    Vector3D[] v = this.getVectorsGlobal();
//    float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
//    return minMax[3] - minMax[1];
View Full Code Here

  private float getWidthXYRealtiveToParent() {
    //This calculates the width aligned/relative to the object
    Vector3D p = this.getWidthXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
    //This calculates the dimension relative to the screen axis (here X-axis)
//    Vector3D[] v = this.getVectorsRelativeToParent();
//    float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
View Full Code Here

   */
  private float getWidthXYGlobal() {
    Vector3D p = this.getWidthXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
   
//    Vector3D[] v = this.getVectorsGlobal();
//    float[] minMax = ToolsGeometry.getMinXYMaxXY(v);
//    return minMax[2] - minMax[0];
View Full Code Here

   */
  //@Override
  public Vector3D getCenterPointGlobal() {
    if (centerWorldDirty){
      Vector3D tmp = this.getCenterPointLocal();
      tmp.transform(this.peerComponent.getGlobalMatrix());
      this.centerPointWorld = tmp;
      this.centerWorldDirty = false;
      return this.centerPointWorld;
    }else{
      return this.centerPointWorld;
View Full Code Here

   */
  private float getHeightXYRelativeToParent() {
    Vector3D p = this.getHeightXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getLocalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }
 
 
  /**
 
View Full Code Here

   */
  private float getHeightXYGlobal() {
    Vector3D p = this.getHeightXYVectLocal();
    Matrix m = new Matrix(this.peerComponent.getGlobalMatrix());
    m.removeTranslationFromMatrix();
    p.transform(m);
    return p.length();
  }

  /**
   * Gets the "height vector". The vector is calculated from the bounds vectors,
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.