Examples of dot()


Examples of engine.base.Vector3.dot()

    Vector3 lightDir = new Vector3();
    lightDir.setDir(theta.get() * (FMath.PI / 180.0f), phi.get() * (FMath.PI / 180.0f));

    Vector3 reflect = (new Vector3(0, 0, -1)).reflect(normalmap.getVector3());

    float ar = reflect.dot(lightDir);
    if (ar < 0)
      ar = 0;
    ar = FMath.pow(ar, shininess.get());

    in0.add_ip(ar);
View Full Code Here

Examples of javax.vecmath.GVector.dot()

        Vertex v=(Vertex)interiorReflexVertices.get(count);
        GVector n=new GVector(new double[] {v.getPosition().x,v.getPosition().y});
        n.sub(new GVector(new double[] {rightMostHoleVertex.getPosition().x,rightMostHoleVertex.getPosition().y}));
        n.normalize();
        GVector m=new GVector(new double[] {1.0,0.0});
        float dot=(float)m.dot(n);
       

        //if this line is the closest we've found
        if (dot > closestDot)
        {
View Full Code Here

Examples of javax.vecmath.Vector2d.dot()

              result.doesIntersect = false;

          // ===== 2. Now find if the polygons *will* intersect =====

          // Project the velocity on the current axis
          double velocityProjection = axis.dot(velocity);

          // Get the projection of polygon A during the movement
          if (velocityProjection < 0) {
              resA.min += velocityProjection;
          } else {
View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

  Vector3d segdir = new Vector3d();
  segdir.sub(segend, segstart);

  double A = raydir.dot(raydir);// Dot(ray.m,ray.m);
  double B = -raydir.dot(segdir);// -Dot(ray.m,seg.m);
  double C = segdir.dot(segdir);// Dot(seg.m,seg.m);
  double D = raydir.dot(diff);// Dot(ray.m,diff);
  double E; // -Dot(seg.m,diff), defer until needed
  double F = diff.dot(diff);// Dot(diff,diff);
  double det = Math.abs(A * C - B * B); // A*C-B*B = |Cross(M0,M1)|^2 >= 0

View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

  double tmp;

  if (det >= ZERO_TOL) {
    // ray and segment are not parallel
    E = -segdir.dot(diff);// -Dot(seg.m,diff);
    s = B * E - C * D;
    t = B * D - A * E;

    if (s >= 0) {
      if (t >= 0) {
View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

        return Math.abs(D * s + F);
      }
    }
    else {
      // same direction vectors
      E = segdir.dot(diff);// -Dot(seg.m,diff);
      t = 1;
      tmp = B + D;
      if (tmp >= 0) {
        s = 0;
        if (rayint != null) rayint.set(rayorig);
View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

  Vector3d seg1dir = new Vector3d();
  seg1dir.sub(s1end, s1start);

  double A = seg0dir.dot(seg0dir); // Dot(seg0dir,seg0dir);
  double B = -seg0dir.dot(seg1dir); // -Dot(seg0dir,seg1dir);
  double C = seg1dir.dot(seg1dir); // Dot(seg1dir,seg1dir);
  double D = seg0dir.dot(diff); // Dot(seg0dir,diff);
  double E; // -Dot(seg1dir,diff), defer until needed
  double F = diff.dot(diff); // Dot(diff,diff);
  double det = Math.abs(A * C - B * B); // A*C-B*B = |Cross(M0,M1)|^2 >= 0

View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

  double tmp;

  if (det >= ZERO_TOL) {
    // line segments are not parallel
    E = -seg1dir.dot(diff); // -Dot(seg1dir,diff);
    s = B * E - C * D;
    t = B * D - A * E;

    if (s >= 0) {
      if (s <= det) {
View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

        if (s1int != null) s1int.set(s1start);
        if (param != null) { param[0] = s; param[1] = t; }
        return Math.abs(D * s + F);
      }
      else {
        E = -seg1dir.dot(diff); // -Dot(seg1dir,diff);
        s = 1;
        tmp = A + D;
        if (-tmp >= B) {
          t = 1;
          if (s0int != null) s0int.set(s0end);
View Full Code Here

Examples of javax.vecmath.Vector3d.dot()

        if (s1int != null) s1int.set(s1start);
        if (param != null) { param[0] = s; param[1] = t; }
        return Math.abs(D * s + F);
      }
      else {
        E = -seg1dir.dot(diff); // -Dot(seg1dir,diff);
        s = 0;
        if (D >= -B) {
          t = 1;
          if (s0int != null) s0int.set(s0start);
          if (s1int != null) s1int.set(s1end);
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.