Package com.jme.math

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


    public Quaternion unmarshal(QuaternionHandler q) throws Exception {
        if (q==null)
            return null;
        Vector3f axis = new Vector3f(q.x, q.y, q.z);
        Quaternion ret = new Quaternion();
        ret.fromAngleAxis(q.angle, axis);
        return ret;
    }

    @Override
    public QuaternionHandler marshal(Quaternion q) throws Exception {
View Full Code Here


        Quaternion newQuat = new Quaternion();

        float fromAngle = ((Quaternion)from).toAngleAxis(fromAxis);
        float toAngle = ((Quaternion)to).toAngleAxis(toAxis);

        newQuat.fromAngleAxis(fromAngle + (toAngle - fromAngle) * timelinePosition,
                new Vector3f(fromAxis.x + (toAxis.x - fromAxis.x) * timelinePosition,
                fromAxis.y + (toAxis.y - fromAxis.y) * timelinePosition,
                fromAxis.z + (toAxis.z - fromAxis.z) * timelinePosition));
        return newQuat;
    }
View Full Code Here

        // Set the destination look direction from the text field. If the text
        // field is empty, then set the server state as a zero rotation.
        Quaternion look = new Quaternion();
        Vector3f axis = new Vector3f(0.0f, 1.0f, 0.0f);
        float angle = (float) Math.toRadians(origLookDirection);
  look.fromAngleAxis((float) angle, axis);
        state.setLook(look);

  state.setAudioSourceType(origAudioSourceType);
  state.setAudioSource(origAudioSource);
  state.setUploadFile(true);
View Full Code Here

                    yrot = 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

                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

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

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.