Examples of crossProduct()


Examples of nu3a.math.N3Vector3D.crossProduct()

    if (vertexes.size() > 2) {
      N3Point3D c = (N3Point3D) vertexes.elementAt(1);
      N3Point3D e1 = (N3Point3D) vertexes.elementAt(0);
      N3Point3D e2 = (N3Point3D) vertexes.elementAt(2);
      normal = new N3Vector3D(e2.x - c.x, e2.y - c.y, e2.z - c.z);
      normal.crossProduct(new N3Vector3D(e1.x - c.x, e1.y - c.y, e1.z
          - c.z));
      normal.normalize();
    }
    return normal;
  }
View Full Code Here

Examples of org.bukkit.util.Vector.crossProduct()

        final double off = TrigUtil.directionCheck(loc, player.getEyeHeight(), direction, block, TrigUtil.DIRECTION_PRECISION);

        if (off > 0.1D) {
            // Player failed the check. Let's try to guess how far they were from looking directly to the block...
            final Vector blockEyes = new Vector(0.5 + block.getX() - loc.getX(), 0.5 + block.getY() - loc.getY() - player.getEyeHeight(), 0.5 + block.getZ() - loc.getZ());
            final double distance = blockEyes.crossProduct(direction).length() / direction.length();

            // Add the overall violation level of the check.
            data.directionVL += distance;
           
            // TODO: Set distance parameter.
View Full Code Here

Examples of org.bukkit.util.Vector.crossProduct()

        final double off = TrigUtil.directionCheck(loc, player.getEyeHeight(), direction, block, TrigUtil.DIRECTION_PRECISION);

        if (off > 0.1D) {
            // Player failed the check. Let's try to guess how far they were from looking directly to the block...
            final Vector blockEyes = new Vector(0.5 + block.getX() - loc.getX(), 0.5 + block.getY() - loc.getY() - player.getEyeHeight(), 0.5 + block.getZ() - loc.getZ());
            final double distance = blockEyes.crossProduct(direction).length() / direction.length();

            // Add the overall violation level of the check.
            data.directionVL += distance;

            // Execute whatever actions are associated with this check and the violation level and find out if we should
View Full Code Here

Examples of org.bukkit.util.Vector.crossProduct()

        }

        if (off > 0.1) {
            // Player failed the check. Let's try to guess how far they were from looking directly to the entity...
            final Vector blockEyes = new Vector(dLoc.getX() - loc.getX(),  dLoc.getY() + height / 2D - loc.getY() - player.getEyeHeight(), dLoc.getZ() - loc.getZ());
            final double distance = blockEyes.crossProduct(direction).length() / direction.length();

            // Add the overall violation level of the check.
            data.directionVL += distance;

            // Execute whatever actions are associated with this check and the violation level and find out if we should
View Full Code Here

Examples of org.bukkit.util.Vector.crossProduct()

        }

        if (off > 0.1) {
            // Player failed the check. Let's try to guess how far they were from looking directly to the entity...
            final Vector blockEyes = new Vector(dLoc.x - loc.getX(),  dLoc.y + context.damagedHeight / 2D - loc.getY() - player.getEyeHeight(), dLoc.z - loc.getZ());
            final double distance = blockEyes.crossProduct(context.direction).length() / context.lengthDirection;
            context.minViolation = Math.min(context.minViolation, distance);
        }
        context.minResult = Math.min(context.minResult, off);
       
        return cancel;
View Full Code Here

Examples of org.bukkit.util.Vector.crossProduct()

            off += off2;

        if (off > 0.1D) {
            // Player failed the check. Let's try to guess how far they were from looking directly to the block...
            final Vector blockEyes = new Vector(0.5 + placed.getX() - loc.getX(), 0.5 + placed.getY() - loc.getY() - player.getEyeHeight(), 0.5 + placed.getZ() - loc.getZ());
            final double distance = blockEyes.crossProduct(direction).length() / direction.length();

            // Add the overall violation level of the check.
            data.directionVL += distance;

            // Execute whatever actions are associated with this check and the violation level and find out if we should
View Full Code Here

Examples of raytracer.common.type.Vector.crossProduct()

    double l;
    Vector dir = cam.getDirection();

    h = 2. * cam.getDistance() * Math.tan(cam.getFovY() / 2.);
    l = h * (((double) width) / ((double) height));
    u = dir.crossProduct(cam.getUp()).normal().product(l / (double) width);
    v = dir.crossProduct(u).normal().product(h / (double) height);
    ori = pos.add(dir.product(cam.getDistance()))
        .add(u.product(-(double) width / 2.))
        .add(v.product(-(double) height / 2.));
  }
View Full Code Here

Examples of raytracer.common.type.Vector.crossProduct()

    Vector dir = cam.getDirection();

    h = 2. * cam.getDistance() * Math.tan(cam.getFovY() / 2.);
    l = h * (((double) width) / ((double) height));
    u = dir.crossProduct(cam.getUp()).normal().product(l / (double) width);
    v = dir.crossProduct(u).normal().product(h / (double) height);
    ori = pos.add(dir.product(cam.getDistance()))
        .add(u.product(-(double) width / 2.))
        .add(v.product(-(double) height / 2.));
  }

View Full Code Here

Examples of sk.fiit.jim.math.Vector3D.crossProduct()

    Vector3D b = cartesian(1, 0, 0);
    assertEquals(a.dotProduct(a), 1.0, .01);
    assertEquals(a.dotProduct(b), 0.0, .01);
    assertThat(a.crossProduct(b), is(equalTo(cartesian(0, 0, -1))));
    assertThat(a.crossProduct(a), is(equalTo(cartesian(0, 0, 0))));
    assertThat(b.crossProduct(a), is(equalTo(cartesian(0, 0, 1))));
    }
  }
 
  @Test
  public void setters(){
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.