Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Point3.z()


      // Check for intersection with each of the six sides of the box.
      if (ray.direction().x() != 0.0) {
        t = (box.minimumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() > 0.0, BOX_SURFACE_MIN_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here


      // Check for intersection with each of the six sides of the box.
      if (ray.direction().x() != 0.0) {
        t = (box.minimumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() > 0.0, BOX_SURFACE_MIN_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

        }

        t = (box.maximumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() < 0.0, BOX_SURFACE_MAX_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

        }

        t = (box.maximumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() < 0.0, BOX_SURFACE_MAX_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

      if (ray.direction().y() != 0.0) {
        t = (box.minimumY() - ray.origin().y()) / ray.direction().y();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().y() > 0.0, BOX_SURFACE_MIN_Y)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

      if (ray.direction().y() != 0.0) {
        t = (box.minimumY() - ray.origin().y()) / ray.direction().y();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().y() > 0.0, BOX_SURFACE_MIN_Y)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

        }

        t = (box.maximumY() - ray.origin().y()) / ray.direction().y();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().y() < 0.0, BOX_SURFACE_MAX_Y)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

        }

        t = (box.maximumY() - ray.origin().y()) / ray.direction().y();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().y() < 0.0, BOX_SURFACE_MAX_Y)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

    switch (x.getTag())
    {
    case BOX_SURFACE_MAX_X:
      facePoint = new Point2(
          (box.maximumZ() - p.z()) / box.lengthX(),
          (box.maximumY() - p.y()) / box.lengthY()
      );
      break;

    case BOX_SURFACE_MIN_X:
View Full Code Here

      );
      break;

    case BOX_SURFACE_MIN_X:
      facePoint = new Point2(
          (p.z() - box.minimumZ()) / box.lengthZ(),
          (box.maximumY() - p.y()) / box.lengthY()
      );
      break;

    case BOX_SURFACE_MAX_Y:
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.