Package com.jme3.math

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


    // aureus: temporary solution; scout should ultimately be a separate object
    scoutNode = new Node();
    scoutNode.setLocalTranslation(new Vector3f(0.0f, 3.0f, -10.0f));
    Matrix3f scoutMatrix = new Matrix3f();
    scoutMatrix.fromAngleAxis((float)Math.atan2(3.0f, 10.0f), Vector3f.UNIT_X);
    scoutNode.setLocalRotation(scoutMatrix);
    hector.getLegsNode().attachChild(scoutNode);

    player.setPhysicsLocation(incarn.getLocation());
View Full Code Here


               
                theta *= influence;

                if (theta != 0) {
                    Vector3f vectorR = vectorA.cross(vectorC);
                    boneWorldRotation.fromAngleAxis(theta, vectorR);
                    boneWorldTransform.getRotation().multLocal(boneWorldRotation);
                    constraintHelper.applyTransform(boneContexts[i].getArmatureObjectOMA(), bone.getName(), Space.CONSTRAINT_SPACE_WORLD, boneWorldTransform);
                }

                bone.updateWorldVectors();
View Full Code Here

        Vector3f planeNormal = secondCurvePoint.subtract(firstCurvePoint).normalizeLocal();

        float angle = FastMath.acos(planeNormal.dot(Vector3f.UNIT_Y));
        planeNormal.crossLocal(Vector3f.UNIT_Y).normalizeLocal();// planeNormal is the rotation axis now
        Quaternion pointRotation = new Quaternion();
        pointRotation.fromAngleAxis(angle, planeNormal);

        Matrix4f m = new Matrix4f();
        m.setRotationQuaternion(pointRotation);
        m.setTranslation(firstCurvePoint);
View Full Code Here

            float angle = parseFloat(attribs.getValue("angle"));
            float axisX = parseFloat(attribs.getValue("axisX"));
            float axisY = parseFloat(attribs.getValue("axisY"));
            float axisZ = parseFloat(attribs.getValue("axisZ"));
            Quaternion q = new Quaternion();
            q.fromAngleAxis(angle, new Vector3f(axisX, axisY, axisZ));
            return q;
        } else {
            // defines as 3 angles along XYZ axes
            float angleX = parseFloat(attribs.getValue("angleX"));
            float angleY = parseFloat(attribs.getValue("angleY"));
View Full Code Here

    character.setLocalTranslation(0f, 0f, 5f);
    Material mat_character = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md");
    mat_character.setTexture("DiffuseMap", app.getAssetManager().loadTexture("character/male/male.png"));
    character.setMaterial(mat_character);
    Quaternion rotate = new Quaternion();
    rotate.fromAngleAxis(-FastMath.PI / 2, new Vector3f(1, 0, 0));
    character.setLocalRotation(rotate);
    characterNode.attachChild(character);
    app.getRootNode().attachChild(characterNode);

    System.out.println(cam.getDirection());
View Full Code Here

  public void rotateEpsilon(float epsilon) {

    Quaternion quat = new Quaternion();
    // seems silly to make this over and over.
    quat.fromAngleAxis(epsilon, Vector3f.UNIT_Y);
    quat.mult(viewDirection, viewDirection);
    player.setViewDirection(viewDirection);
  }

  public void forwardEpsilon(float epsilon) {
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.