Package org.mt4j.util.math

Examples of org.mt4j.util.math.Matrix


   
    this.unUsedCursors = new ArrayList<InputCursor>();
    this.lockedCursors = new ArrayList<InputCursor>();
   
    if (identityDummy == null)
      identityDummy = new Matrix();
   
    this.bSphere = bSphere;
    this.bSphere.setRadius(bSphere.getRadius() * sizeScaled);
    this.shape = component;
//    ((BoundingSphere)shape.getBoundingShape()).setRadius(((BoundingSphere)shape.getBoundingShape()).getRadius()*2);
 
View Full Code Here



  @Override
  public void cursorUpdated(InputCursor m, MTFingerInputEvt positionEvent) {
    if (lockedCursors.contains(m)){
      Matrix mat = ac.getNewRotation(m);
      this.fireGestureEvent(new ArcBallGestureEvent(this, ArcBallGestureEvent.GESTURE_UPDATED, positionEvent.getTargetComponent(), mat));
    }
  }
View Full Code Here

      // TEST
      if (doInWorldCoords)
        lastPoint.transform(shape.getGlobalMatrix());
     
      q = new Quaternion();
      returnMatrix = new Matrix();
     
      camDistToInterSection = 1;
    }
View Full Code Here

   *
   * @param otherComp the other comp
   * @param pos the pos
   */
  public void setPositionRelativeToOther(MTComponent otherComp, Vector3D pos){
    Matrix m0 = MTComponent.getTransformToDestinationLocalSpace(otherComp, this);
    pos.transform(m0);
   
    Vector3D centerpointGlobal = this.getCenterPointGlobal();
    centerpointGlobal.transform(this.getGlobalInverseMatrix()); //to localobj space
    centerpointGlobal.transform(this.getLocalMatrix()); //to parent relative space
View Full Code Here

*
* the width
*/
  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

                    Vector3D v = new Vector3D(0,-100, 0);

                    //Add the textarea to the set parent
                    if (getParentToAddNewTextAreaTo() != null){
                      //Transform the textarea so it appears at the same world coords after its added to another parent
                      Matrix m = MTComponent.getTransformToDestinationParentSpace(ta, getParentToAddNewTextAreaTo());
                      ta.transform(m);
                      //Transform the direction vector for the translation animation
                      //to preserve the direction from the old reference frame to the new parents one
//                      v.transformNormal(m);
                      v.transformDirectionVector(m);

                      ta.tweenTranslate(v, 500, 0.3f, 0.7f);

                      getParentToAddNewTextAreaTo().addChild(ta);
                    }else{
                      //If that isnt set, try to add it to the keyboards parent
                      if (getParent() != null){
                        /////////////////////////
                        // Transform the textarea so it appears at the same place after its added to another parent
                        Matrix m = MTComponent.getTransformToDestinationParentSpace(ta, getParent());
                        ta.transform(m);
                        //Transform the direction vector to preserve the global direction
                        //from the old reference frame to the new parents one
                        //The translation part has to be removed from the matrix because we're transforming
                        //a translation vector not a point vector
View Full Code Here

TOP

Related Classes of org.mt4j.util.math.Matrix

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.