Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Quaternion


    }

    public static Quaternion slerp2(Quaternion a, Quaternion b, float t) {

        Quaternion result = new Quaternion();
        float cosom = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
        float t1 = 1.0f - t;

        // if the two quaternions are close, just use linear interpolation
        if (cosom >= 0.95f) {
View Full Code Here


     * @param t1
     *            the amount to interpolate between the two quaternions.
     */
    public static Quaternion slerp1(Quaternion q1, Quaternion q2, float t1)
    {
        Quaternion result = new Quaternion();

        // Create a local quaternion to store the interpolated quaternion
        if (q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w) {
            result.set(q1);
            return result;
        }

        float result1 = (q1.x * q2.x) + (q1.y * q2.y) + (q1.z * q2.z)
                + (q1.w * q2.w);
 
View Full Code Here

    this.a = a;
    this.e = e;
    time = 0.0f;
    this.period = period;

    rotation = new Quaternion();
    rotation.setFromAxisAngle(new Vector4f(rotX, rotY, rotZ, angle));
    position = new Vector3f();

    light = Lighting.addLight(position, 0.1f * red, 0.1f * green, 0.1f * blue, red, green, blue, red, green, blue);

View Full Code Here

    double phi = 2.0 * Math.atan(Math.sqrt((1.0 + e) / (1.0 - e)) * Math.tan(E / 2.0));
    double r = a * (1.0 - e * e) / (1.0 + e * Math.cos(phi));

    // rotate position
    Quaternion pos = new Quaternion((float) (r * Math.cos(phi)), (float) (r * Math.sin(phi)), 0.0f, 0.0f);
    Quaternion.mul(rotation, pos, pos);
    Quaternion.mulInverse(pos, rotation, pos);

    position.x = pos.x;
    position.y = pos.y;
View Full Code Here

TOP

Related Classes of org.lwjgl.util.vector.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.