Examples of Matrix44


Examples of edu.cmu.cs.stage3.math.Matrix44

  public void setTransformation( javax.vecmath.Matrix4d m, ReferenceFrame asSeenBy ) {
    setLocalTransformation( calculateTransformation( m, asSeenBy ) );
  }
  public void setPosition( javax.vecmath.Vector3d position, ReferenceFrame asSeenBy ) {
    Matrix33 axes = getAxes( null );
    Matrix44 m = new Matrix44();
    m.setPosition( position );
    m = calculateTransformation( m, asSeenBy );
    m.setAxes( axes );
    setLocalTransformation( m );
  }
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

    m.setAxes( axes );
    setLocalTransformation( m );
  }
  public void setAxes( javax.vecmath.Matrix3d axes, ReferenceFrame asSeenBy ) {
    Vector3 translation = getPosition( null );
    Matrix44 m = new Matrix44();
    m.setAxes( axes );
    m = calculateTransformation( m, asSeenBy );
    m.setPosition( translation );
    setLocalTransformation( m );
  }
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

        upGuide = MathUtilities.getYAxis();
      }
      if( asSeenBy==null ) {
        asSeenBy = (ReferenceFrame)getParent();
      }
      Matrix44 transform = getTransformation( asSeenBy );
      Vector3 position = transform.getPosition();
      //Vector3 position = new Vector3( transform.m30, transform.m31, transform.m32 );
 
      ReferenceFrame actualTarget;
      if( offset==null ) {
        actualTarget = target;
      } else {
        s_calculatePointAtHelperOffset.setParent( target );
        Matrix44 m = new Matrix44();
        m.m30 = offset.x;
        m.m31 = offset.y;
        m.m32 = offset.z;
        s_calculatePointAtHelperOffset.setLocalTransformation( m );
        actualTarget = s_calculatePointAtHelperOffset;
      }
 
      Matrix33 result;
      if( onlyAffectYaw ) {
        // setup "helperA" with the orientation of "asSeenBy" and the position of "this"
        s_calculatePointAtHelperA.setParent( asSeenBy );
        s_calculatePointAtHelperA.setLocalTransformation( new Matrix44() );
        s_calculatePointAtHelperA.setPosition( Vector3.ZERO, this );
 
        // calculate the angle of rotation around y of "actualTarget" as seen by "helperA"
        Vector3 targetPosition = actualTarget.getPosition( s_calculatePointAtHelperA );
        double targetTheta = Math.atan2( targetPosition.x, targetPosition.z );
 
        // place "helperB" out in front of "this"
        s_calculatePointAtHelperB.setParent( this );
        s_calculatePointAtHelperB.setPosition( MathUtilities.getZAxis(), this );
 
        // calculate the angle of rotation around Y of "helperB" as seen by "helperA"
        Vector3 forwardPosition = s_calculatePointAtHelperB.getPosition( s_calculatePointAtHelperA );
        double forwardTheta = Math.atan2( forwardPosition.x, forwardPosition.z );
 
        // setup "helperB" to have position and orientation of "this"
        s_calculatePointAtHelperB.setLocalTransformation( new Matrix44() );
 
        // calculate how much to rotate
        double deltaTheta = targetTheta - forwardTheta;
 
        // rotate "helperB" around Y as seen by "helperA"
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

  }
  public void translate( javax.vecmath.Vector3d vector, ReferenceFrame asSeenBy ) {
    if( asSeenBy==null ) {
      asSeenBy = this;
    }
    Matrix44 m = getTransformation( asSeenBy );
    m.translate( vector );
    setTransformation( m, asSeenBy );
  }
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

  }
  public void rotate( javax.vecmath.Vector3d axis, double amount, ReferenceFrame asSeenBy ) {
    if( asSeenBy==null ) {
      asSeenBy = this;
    }
    Matrix44 m = getTransformation( asSeenBy );
    m.rotate( axis, amount );
    setTransformation( m, asSeenBy );
  }
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

  }
  public void scale( javax.vecmath.Vector3d axis, ReferenceFrame asSeenBy ) {
    if( asSeenBy==null ) {
      asSeenBy = this;
    }
    Matrix44 m = getTransformation( asSeenBy );
    m.scale( axis );
    setTransformation( m, asSeenBy );
  }
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

  }
  public void transform( javax.vecmath.Matrix4d trans, ReferenceFrame asSeenBy ) {
    if( asSeenBy==null ) {
      asSeenBy = this;
    }
    Matrix44 m = getTransformation( asSeenBy );
    m.transform( trans );
    setTransformation( m, asSeenBy );
  }
View Full Code Here

Examples of edu.cmu.cs.stage3.math.Matrix44

    return sphere;
  }
    */

  public void setPivot( ReferenceFrame pivot ) {
    Matrix44 m = getTransformation( pivot );
    Matrix44 mInverse = Matrix44.invert( m );
    transform( mInverse, this );
    for( int i=0; i<getChildCount(); i++ ) {
      Component child = getChildAt( i );
      if( child instanceof Transformable ) {
        ((Transformable)child).transform( m, this );
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.