Package com.jme.math

Examples of com.jme.math.Quaternion


            }
        }

        public void panCamera(float radDegree) {
            if (react) {
                Quaternion pan = new Quaternion();
                Quaternion tilt = new Quaternion();

                xrot = xrot + radDegree;
                if (xrot > FastMath.TWO_PI * 2 || xrot < FastMath.TWO_PI * -2) {
                    xrot = 0 + radDegree;
                }

                tilt = tilt.fromAngleAxis(yrot, left);

                pan = pan.fromAngleAxis(xrot, Vector3f.UNIT_Z);
                pan.multLocal(tilt);
                camerapivot.setLocalRotation(pan);
                cameraOrbit.update();
View Full Code Here


        public void resetRotations() {
            xrot = 0;
            yrot = 0;
            camerapivot.setLocalTranslation(0, 0, 0);
            Quaternion q = new Quaternion();
            camerapivot.setLocalRotation(q);
            updateCenter();
        }
View Full Code Here

    private Vector3f position;
    private Quaternion camAxis;

    public CamMove()
    {
        camAxis=new Quaternion();
        //camAxis.lookAt(direction, up)
    }
View Full Code Here

        //jak se ty dve textury smichaji
        t01.setApply(ApplyMode.Combine);
        t02.setApply(ApplyMode.Combine);
      
        // jen na zkousku pootacim jednu z textur
        t01.setRotation(new Quaternion(new float[]{0.1f,0.5f,0.5f}));
        t01.setWrap(WrapMode.Repeat);
       
       
        //kdyz ma t01 a t02 ApplyMode combine, tak se da dale kombinovat za pomoci dalsiho milionu kombinaci
        /*t01.setCombineFuncRGB(CombinerFunctionRGB.Modulate);
 
View Full Code Here

        //jak se ty dve textury smichaji
        t01.setApply(ApplyMode.Combine);
        t02.setApply(ApplyMode.Combine);
      
        // jen na zkousku pootacim jednu z textur
        t01.setRotation(new Quaternion(new float[]{0.1f,0.5f,0.5f}));
        t01.setWrap(WrapMode.Repeat);
       
       
        //kdyz ma t01 a t02 ApplyMode combine, tak se da dale kombinovat za pomoci dalsiho milionu kombinaci
        /*t01.setCombineFuncRGB(CombinerFunctionRGB.Modulate);
 
View Full Code Here

                    new CoverScreenListener(placemark,getSessionManager(),location,"change",csd);
                }
            }
           
            // create the rotation
            Quaternion look = new Quaternion();
            Vector3f axis = new Vector3f(Vector3f.UNIT_Y);
            look.fromAngleAxis((float) Math.toRadians(angle), axis);

            // If the URL is an empty string, convert it to null. If the URL
            // is null, then it will use the current server.
            if (url != null && url.length() == 0) {
                url = null;
View Full Code Here

                     }

                     case TRANSFORM_USER_SET: {
                         SGChangeTransformUserSet chg = (SGChangeTransformUserSet) sgChange;
                         CellTransform userTransform = chg.transform.clone(null);
                         Quaternion r = userTransform.getRotation(null);
                         chg.viewNode.setLocalRotation(r);
                         logger.fine("View node set rotation = " + r);
                         Vector3f t = userTransform.getTranslation(null);
                         chg.viewNode.setLocalTranslation(t);
                         logger.fine("View node set translation = " + t);
View Full Code Here

  
        // get the cell's transform
        Vector3f trans = xform.getTranslation(null);
        // get the cell's rotation about each axis
        Quaternion rot = xform.getRotation(null);
        float[] angles = new float[3];
        rot.toAngles(angles);

        // get the relative offset (in Quaternions)
        float angle = 0;
        if (placemarkRotation != null) {
            angle = (float) Math.toRadians(Float.valueOf(placemarkRotation));
View Full Code Here

      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));
        getRootNode().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.