Package org.mt4j.util.math

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


    if (v0.z == 0 && v1.z == 0){ //Only create bounding poly if the line is in the z=0 plane
      Vector3D dir = v1.getSubtracted(v0);
      dir.normalizeLocal();
      dir.scaleLocal(10);
      dir.rotateZ(PApplet.radians(90));
      Vector3D bv0 = new Vector3D(v0.getAdded(dir));
      Vector3D bv1 = new Vector3D(v0.getAdded(dir.getScaled(-1)));
      Vector3D bv2 = new Vector3D(v1.getAdded(dir.getScaled(-1)));
      Vector3D bv3 = new Vector3D(v1.getAdded(dir));
      Vector3D[] v = new Vector3D[]{
View Full Code Here


          //Inverse the angle if we are inside the boundingsphere and
          //hit the inner side
          if (camInSphere){ //we hit the backside of the boundingsphere, have to invert direction
//            angle *= -1;
//            rotationAxis.rotateZ(PApplet.radians(180)); //better than angle*-1
            rotationAxis.rotateZ(ToolsMath.PI); //better than angle*-1
//            rotationAxis.rotateX(PApplet.radians(180)); //better than angle*-1
//            rotationAxis.scaleLocal(-1); //like angle*-1
//            rotationAxis.rotateAroundAxisLocal(rotationAxis, PApplet.radians(90));
          }
          rotationAxis.normalizeLocal();
View Full Code Here

    final float buttonOpacity = 170;
   
    //CLOSE BUTTON
//    Vector3D a = new Vector3D(-width * 1.2f, height/2f);
    Vector3D a = new Vector3D(-width * 1.55f, 0);
    a.rotateZ(PApplet.radians(80));
    final MTRectangle closeButton = new MTRectangle(x + a.x, y + a.y, buttonWidth, buttonHeight, app);
   
    if (closeButtonImage == null){
      closeButtonImage = app.loadImage(MT4jSettings.getInstance().getDefaultImagesPath() +
//          "close_32.png"));
View Full Code Here

    //or was added to a normal scene
    //-> if its not a windowed scene we dont display the Restore button
    if (this.windowedScene){
      //RESTORE BUTTON
      Vector3D b = new Vector3D(-width * 1.55f, 0);
      b.rotateZ(PApplet.radians(10));
      final MTRectangle restoreButton = new MTRectangle(x + b.x, y + b.y, buttonWidth, buttonHeight, app);
     
      if (restoreButtonImage == null){
        restoreButtonImage = app.loadImage(MT4jSettings.getInstance().getDefaultImagesPath() +
//            "window_app_32.png"));
View Full Code Here

   
    System.out.println(c.angleBetween(d) * ToolsMath.RAD_TO_DEG);
    assertTrue(c.angleBetween(d) * ToolsMath.RAD_TO_DEG == 90 );
   
    Vector3D e = new Vector3D(c);
    e.rotateZ(90 * ToolsMath.DEG_TO_RAD);
    e.rotateZ(-90 * ToolsMath.DEG_TO_RAD);
    assertTrue(e.equalsVector(c));
  }

}
 
View Full Code Here

    System.out.println(c.angleBetween(d) * ToolsMath.RAD_TO_DEG);
    assertTrue(c.angleBetween(d) * ToolsMath.RAD_TO_DEG == 90 );
   
    Vector3D e = new Vector3D(c);
    e.rotateZ(90 * ToolsMath.DEG_TO_RAD);
    e.rotateZ(-90 * ToolsMath.DEG_TO_RAD);
    assertTrue(e.equalsVector(c));
  }

}
 
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.