Package javax.vecmath

Examples of javax.vecmath.Quat4f.normalize()


    dorn.set(axis.x, axis.y, axis.z, (float) Math.cos(fAngle * timeStep * 0.5f));
    Quat4f orn0 = curTrans.getRotation(Stack.alloc(Quat4f.class));

    Quat4f predictedOrn = Stack.alloc(Quat4f.class);
    predictedOrn.mul(dorn, orn0);
    predictedOrn.normalize();
//  #endif
    predictedTransform.setRotation(predictedOrn);
  }

  public static void calculateVelocity(Transform transform0, Transform transform1, float timeStep, Vector3f linVel, Vector3f angVel) {
View Full Code Here


    MatrixUtil.getRotation(dmat, dorn);
// #endif

    // floating point inaccuracy can lead to w component > 1..., which breaks

    dorn.normalize();

    angle[0] = QuaternionUtil.getAngle(dorn);
    axis.set(dorn.x, dorn.y, dorn.z);
    // TODO: probably not needed
    //axis[3] = btScalar(0.);
View Full Code Here

    }

    public Quat4f getQuat4f() {
        Quat4f rotation = new Quat4f();
        QuaternionUtil.setEuler(rotation, yaw.getRadians(), pitch.getRadians(), roll.getRadians());
        rotation.normalize();
        return rotation;
    }

    public Side rotate(Side side) {
        Side result = side;
View Full Code Here

            sb.append("\t\"").append(bone.getName()).append("\" ").append(bone.getParentIndex()).append(" ( ");
            sb.append(bone.getObjectPosition().x).append(" ");
            sb.append(bone.getObjectPosition().y).append(" ");
            sb.append(bone.getObjectPosition().z).append(" ) ( ");
            Quat4f rot = new Quat4f(bone.getObjectRotation());
            rot.normalize();
            if (rot.w > 0) {
                rot.x = -rot.x;
                rot.y = -rot.y;
                rot.z = -rot.z;
            }
View Full Code Here

            if (boneLoc != null) {

                newPos.interpolate(frameA.getPosition(i), frameB.getPosition(i), interpolationVal);
                boneLoc.setLocalPosition(newPos);
                newRot.interpolate(frameA.getRotation(i), frameB.getRotation(i), interpolationVal);
                newRot.normalize();
                boneLoc.setLocalRotation(newRot);
                boneEntity.saveComponent(boneLoc);
            }
        }
    }
View Full Code Here

        float w = 0;
        if (t > 0.0f) {
            w = (float) -Math.sqrt(t);
        }
        Quat4f result = new Quat4f(x, y, z, w);
        result.normalize();
        return result;
    }

    public static Quat4f correctQuat4f(Quat4f rot) {
        Quat4f result = new Quat4f(CORRECTION_QUATERNION);
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.