Examples of toAngles()


Examples of com.jme.math.Quaternion.toAngles()

        Cell cell = editor.getCell();
        CellTransform cellTransform = cell.getLocalTransform();
        Vector3f translation = cellTransform.getTranslation(null);
        Quaternion rotation = cellTransform.getRotation(null);
        Vector3f scale = cellTransform.getScaling(null);
        float[] angles = rotation.toAngles(new float[3]);

        // Update the translation spinners
        translationXTF.setValue(translation.x);
        translationYTF.setValue(translation.y);
        translationZTF.setValue(translation.z);
View Full Code Here

Examples of com.jme.math.Quaternion.toAngles()

        // Fetch the current transform from the movable component
        CellTransform cellTransform = selectedCell.getLocalTransform();
        final Vector3f translation = cellTransform.getTranslation(null);
        Quaternion rotation = cellTransform.getRotation(null);
        final Vector3f scale = cellTransform.getScaling(null);
        final float[] angles = rotation.toAngles(new float[3]);

        // Says that we are changing the values of the spinners
        // programmatically. This prevents the values from being sent
        // back to the Cell via the movable component.
        setLocalChanges(true);
View Full Code Here

Examples of com.jme.math.Quaternion.toAngles()

        Quaternion rotation = sceneRoot.getWorldRotation();
        rootNode.setLocalTranslation(translation);
        rootNode.setLocalRotation(rotation);

        float[] angles = new float[3];
        rotation.toAngles(angles);
       
        // Create a tube to rotate about the X axis. The tube is drawn in the
        // X-Z plane, so we must rotate 90 degrees about the +z axis so that the
        // axis of rotation is about +x axis.
        xEntity = new Entity("Tube X");
View Full Code Here

Examples of com.jme.math.Quaternion.toAngles()

            // We need to rotate the normal about the rotation already applied
            // to the Cell. This will make sure that the direction of rotation
            // comes out properly.
            Quaternion rotation = rootNode.getLocalRotation();
            float angles[] = new float[3];
            rotation.toAngles(angles);
            normal = rotation.mult(normal);
           
            // Compute the signed angle between v1 and v2. We do this with the
            // following formula: angle = atan2(normal dot (v1 cross v2), v1 dot v2)
            float dotProduct = v1.dot(v2);
View Full Code Here

Examples of com.jme.math.Quaternion.toAngles()

     * @param node
     */
    private void setSpinners(Node modelBG, Node rootBG) {
        Vector3f translation = rootBG.getLocalTranslation();
        Quaternion quat = modelBG.getLocalRotation();
        float[] angles = quat.toAngles(new float[3]);
        Vector3f scale = modelBG.getLocalScale();

        translationXTF.setValue(translation.x);
        translationYTF.setValue(translation.y);
        translationZTF.setValue(translation.z);
View Full Code Here

Examples of com.jme.math.Quaternion.toAngles()

        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

Examples of com.jme.math.Quaternion.toAngles()

      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

Examples of com.jme.math.Quaternion.toAngles()

      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

Examples of com.jme3.math.Quaternion.toAngles()

    @Override
    public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) {
        Transform ownerTransform = this.getOwnerTransform(ownerSpace);
       
        Quaternion ownerRotation = ownerTransform.getRotation();
        ownerAngles = ownerRotation.toAngles(ownerAngles);
        targetAngles = targetTransform.getRotation().toAngles(targetAngles);

        Quaternion startRotation = ownerRotation.clone();
        Quaternion offset = Quaternion.IDENTITY;
        if ((flag & ROTLIKE_OFFSET) != 0) {// we add the original rotation to
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.