Examples of sub()


Examples of mikera.vectorz.Vector.sub()

  }
 
  @Override
  public Vector subCopy(AVector a) {
    Vector r=this.toVector();
    r.sub(a);
    return r;
  }
 
  @Override
  public void add(double[] srcData, int srcOffset) {
View Full Code Here

Examples of net.fortytwo.ripple.model.NumericValue.sub()

        b = mc.toNumericValue(stack.getFirst());
        stack = stack.getRest();
        a = mc.toNumericValue(stack.getFirst());
        stack = stack.getRest();

        result = a.sub(b);

        solutions.put(
                stack.push(result));
    }
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

      p2 = new Vector2f(p1);
      p2.add(new Vector2f(chains * 20, 0));
    }

    final Vector2f direction = new Vector2f(p2);
    direction.sub(p1);
    direction.normalise();
    direction.scale(20);

    final Body bodies[] = new Body[N];
    final Vector2f pos = new Vector2f(p1);
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

    }

    // Box B faces
    Vector2f faceB = MathUtil.abs(dB);
    faceB.sub(MathUtil.mul(absCT,hA));
    faceB.sub(hB);
    //MathUtil.sub(MathUtil.sub(MathUtil.abs(dB),MathUtil.mul(absCT,hA)),hB);
    if (faceB.x > 0.0f || faceB.y > 0.0f) {
      return 0;
    }
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

      vertsA[1] = tmp;
    }
   
    // we use the line's normal for our sweepline projection
    Vector2f normal = new Vector2f(vertsA[1]);
    normal.sub(vertsA[0]);
    normal.set(normal.y, -normal.x);
    EdgeSweep sweep = new EdgeSweep(normal);
    sweep.insert(0, true, vertsA[0].dot(normal));
    sweep.insert(0, true, vertsA[1].dot(normal));
    sweep.addVerticesToSweep(false, vertsB);
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

   * @param vertsB The polygon's vertices
   */
  public void setLineEndContact(Contact contact, Intersection intersection, Vector2f[] vertsA, Vector2f[] vertsB) {
    Vector2f separation = new Vector2f(intersection.position);
    if ( intersection.isIngoing )
      separation.sub(vertsA[1]);
    else
      separation.sub(vertsA[0]);
   
    float depthA = 0;//separation.length();
   
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

  public void setLineEndContact(Contact contact, Intersection intersection, Vector2f[] vertsA, Vector2f[] vertsB) {
    Vector2f separation = new Vector2f(intersection.position);
    if ( intersection.isIngoing )
      separation.sub(vertsA[1]);
    else
      separation.sub(vertsA[0]);
   
    float depthA = 0;//separation.length();
   
    contact.setSeparation(-depthA);
    contact.setNormal(MathUtil.getNormal(vertsB[(intersection.edgeB + 1) % vertsB.length], vertsB[intersection.edgeB]));
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

    Vector2f[] vertsB = box.getPoints(bodyB.getPosition(), bodyB.getRotation());
   
    // TODO: use a sweepline that has the smallest projection of the box
    // now we use just an arbitrary one
    Vector2f sweepline = new Vector2f(vertsB[1]);
    sweepline.sub(vertsB[2]);
   
    EdgeSweep sweep = new EdgeSweep(sweepline);
   
    sweep.addVerticesToSweep(true, vertsA);
    sweep.addVerticesToSweep(false, vertsB);
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

   * @param vertsB The vertices of polygon B
   * @return the maximum penetration depth along the given normal
   */
  public static float getPenetrationDepth(Intersection in, Intersection out, Vector2f normal, Vector2f[] vertsA, Vector2f[] vertsB) {
    Vector2f sweepdir = new Vector2f(out.position);
    sweepdir.sub(in.position);
   
    PenetrationSweep ps = new PenetrationSweep(normal, sweepdir, in.position, out.position);

    //TODO: most penetrations are very simple, similar to:
    // \               +       |       
View Full Code Here

Examples of net.phys2d.math.Vector2f.sub()

    // the line A's normal passing through the origin of B
    Vector2f startA = vertsA[0];
    Vector2f endA = vertsA[1];
    ROVector2f startB = bodyB.getPosition();
    Vector2f endB = new Vector2f(endA);
    endB.sub(startA);
    endB.set(endB.y, -endB.x);
//    endB.add(startB);// TODO: inline endB into equations below, this last operation will be useless..
   
    //TODO: reuse mathutil.intersect
//    float d = (endB.y - startB.getY()) * (endA.x - startA.x);
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.