Package com.jme.math

Examples of com.jme.math.Quaternion


      float cosZ;
      float xe;
      float ze;
      float b, Lx, Ly, Lz, Yb;
      float L = 1.0f;
      Quaternion turretAngle = tankTurretBarrel.getWorldRotation();
      float angles[] = turretAngle.toAngles(null);
      System.out.println("angles[0]="+angles[0]*FastMath.RAD_TO_DEG);
      System.out.println("angles[1]="+angles[1]*FastMath.RAD_TO_DEG);
      System.out.println("angles[2]="+angles[2]*FastMath.RAD_TO_DEG);
      float Alpha = -(angles[0]*FastMath.RAD_TO_DEG) - 90;
      float Gamma = -(angles[1]*FastMath.RAD_TO_DEG) - 90;
View Full Code Here


        //  I could remove the missleTrajectory2 junk, I could make it a lot simpler.
        box.addController(new BulletMover(this, box, new Vector3f(dx,dy,dz),missleTrajectory2));
        rootNode.attachChild(missleTrajectory2);
    }
    private void setTurretAngle(){
        Quaternion turretAnglePitch = new Quaternion();
        Quaternion turretAngleYaw = new Quaternion();
        Quaternion turretAngle;

        turretAngleYaw.fromAngleAxis(FastMath.DEG_TO_RAD*currentYaw, new Vector3f(0, 1, 0));
        turretAnglePitch.fromAngleAxis(FastMath.DEG_TO_RAD*currentPitch, new Vector3f(1, 0, 0));
        turretAngle = turretAngleYaw.mult(turretAnglePitch);
       
View Full Code Here

TOP

Related Classes of com.jme.math.Quaternion

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.