Package com.jme.math

Examples of com.jme.math.Matrix4f.mult()


  Vector3f dragEye = new Vector3f();
  Vector3f dragStartEye = new Vector3f();
  Vector3f pressEye = new Vector3f();
  Vector3f eyeEye = new Vector3f();
  Vector3f thisEye = new Vector3f();
  camInverse.mult(dragWorld, dragEye);
  camInverse.mult(dragStartWorld, dragStartEye);
  camInverse.mult(pressWorld, pressEye);
  // TODO: perf: only really need to recalc eyeEye on camera change
  camInverse.mult(eyeWorld, eyeEye);
  camInverse.mult(thisWorld, thisEye);
View Full Code Here


  Vector3f dragStartEye = new Vector3f();
  Vector3f pressEye = new Vector3f();
  Vector3f eyeEye = new Vector3f();
  Vector3f thisEye = new Vector3f();
  camInverse.mult(dragWorld, dragEye);
  camInverse.mult(dragStartWorld, dragStartEye);
  camInverse.mult(pressWorld, pressEye);
  // TODO: perf: only really need to recalc eyeEye on camera change
  camInverse.mult(eyeWorld, eyeEye);
  camInverse.mult(thisWorld, thisEye);
View Full Code Here

  Vector3f pressEye = new Vector3f();
  Vector3f eyeEye = new Vector3f();
  Vector3f thisEye = new Vector3f();
  camInverse.mult(dragWorld, dragEye);
  camInverse.mult(dragStartWorld, dragStartEye);
  camInverse.mult(pressWorld, pressEye);
  // TODO: perf: only really need to recalc eyeEye on camera change
  camInverse.mult(eyeWorld, eyeEye);
  camInverse.mult(thisWorld, thisEye);

  // The displacement vector of this event from the center of the drag plane
View Full Code Here

  Vector3f thisEye = new Vector3f();
  camInverse.mult(dragWorld, dragEye);
  camInverse.mult(dragStartWorld, dragStartEye);
  camInverse.mult(pressWorld, pressEye);
  // TODO: perf: only really need to recalc eyeEye on camera change
  camInverse.mult(eyeWorld, eyeEye);
  camInverse.mult(thisWorld, thisEye);

  // The displacement vector of this event from the center of the drag plane
  Vector3f dragVectorEye = new Vector3f(
            (dragEye.x - pressEye.x) * (dragStartEye.z - eyeEye.z) / (thisEye.z - eyeEye.z),
View Full Code Here

  camInverse.mult(dragWorld, dragEye);
  camInverse.mult(dragStartWorld, dragStartEye);
  camInverse.mult(pressWorld, pressEye);
  // TODO: perf: only really need to recalc eyeEye on camera change
  camInverse.mult(eyeWorld, eyeEye);
  camInverse.mult(thisWorld, thisEye);

  // The displacement vector of this event from the center of the drag plane
  Vector3f dragVectorEye = new Vector3f(
            (dragEye.x - pressEye.x) * (dragStartEye.z - eyeEye.z) / (thisEye.z - eyeEye.z),
      (pressEye.y - dragEye.y) * (dragStartEye.z - eyeEye.z) / (thisEye.z - eyeEye.z),
View Full Code Here

        // The first thing we do is transform the point into local coords
        // TODO: perf: avoid doing a matrix invert every time
        Matrix4f local2World = getLocalToWorldMatrix(null);
        Matrix4f world2Local = local2World.invert();
        Vector3f pointLocal = world2Local.mult(point, new Vector3f());
        logger.fine("local point = " + pointLocal);

        // First calculate the actual coordinates of the top left corner of the view in local coords.
        float width = view.getDisplayerLocalWidth();
        float height = view.getDisplayerLocalHeight();
View Full Code Here

        // Calculate an arbitrary point on the plane (in this case, the top left corner)
        float width = view.getDisplayerLocalWidth();
        float height = view.getDisplayerLocalHeight();
        Vector3f topLeftLocal = new Vector3f(-width / 2f, height / 2f, 0f);
        Matrix4f local2World = getLocalToWorldMatrix(null);
        Vector3f topLeftWorld = local2World.mult(topLeftLocal, new Vector3f());

        // Calculate the plane normal
        Vector3f planeNormalWorld = getPlaneNormalWorld();
       
        // Now find the intersection of the ray with the plane
View Full Code Here

        logger.fine("topLeftLocal = " + topLeftLocal);
        logger.fine("topRightLocal = " + topRightLocal);
        logger.fine("bottomLeftLocal = " + bottomLeftLocal);
        logger.fine("bottomRightLocal = " + bottomRightLocal);
        Matrix4f local2World = getLocalToWorldMatrix(null); // TODO: prealloc
        Vector3f topLeftWorld = local2World.mult(topLeftLocal, new Vector3f()); // TODO:prealloc
        Vector3f topRightWorld = local2World.mult(topRightLocal, new Vector3f()); // TODO:prealloc
        Vector3f bottomLeftWorld = local2World.mult(bottomLeftLocal, new Vector3f()); // TODO:prealloc
        Vector3f bottomRightWorld = local2World.mult(bottomRightLocal, new Vector3f()); // TODO:prealloc
        logger.fine("topLeftWorld = " + topLeftWorld);
        logger.fine("topRightWorld = " + topRightWorld);
View Full Code Here

        logger.fine("topRightLocal = " + topRightLocal);
        logger.fine("bottomLeftLocal = " + bottomLeftLocal);
        logger.fine("bottomRightLocal = " + bottomRightLocal);
        Matrix4f local2World = getLocalToWorldMatrix(null); // TODO: prealloc
        Vector3f topLeftWorld = local2World.mult(topLeftLocal, new Vector3f()); // TODO:prealloc
        Vector3f topRightWorld = local2World.mult(topRightLocal, new Vector3f()); // TODO:prealloc
        Vector3f bottomLeftWorld = local2World.mult(bottomLeftLocal, new Vector3f()); // TODO:prealloc
        Vector3f bottomRightWorld = local2World.mult(bottomRightLocal, new Vector3f()); // TODO:prealloc
        logger.fine("topLeftWorld = " + topLeftWorld);
        logger.fine("topRightWorld = " + topRightWorld);
        logger.fine("bottomLeftWorld = " + bottomLeftWorld);
View Full Code Here

        logger.fine("bottomLeftLocal = " + bottomLeftLocal);
        logger.fine("bottomRightLocal = " + bottomRightLocal);
        Matrix4f local2World = getLocalToWorldMatrix(null); // TODO: prealloc
        Vector3f topLeftWorld = local2World.mult(topLeftLocal, new Vector3f()); // TODO:prealloc
        Vector3f topRightWorld = local2World.mult(topRightLocal, new Vector3f()); // TODO:prealloc
        Vector3f bottomLeftWorld = local2World.mult(bottomLeftLocal, new Vector3f()); // TODO:prealloc
        Vector3f bottomRightWorld = local2World.mult(bottomRightLocal, new Vector3f()); // TODO:prealloc
        logger.fine("topLeftWorld = " + topLeftWorld);
        logger.fine("topRightWorld = " + topRightWorld);
        logger.fine("bottomLeftWorld = " + bottomLeftWorld);
        logger.fine("bottomRightWorld = " + bottomRightWorld);
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.