Package net.phys2d.math

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


    Vector2f localVector2f3 = MathUtil.mul(localMatrix2f4, localVector2f1);
    Matrix2f localMatrix2f5 = MathUtil.mul(localMatrix2f3, localMatrix2f2);
    Matrix2f localMatrix2f6 = MathUtil.abs(localMatrix2f5);
    Matrix2f localMatrix2f7 = localMatrix2f6.transpose();
    Vector2f localVector2f4 = MathUtil.abs(localVector2f2);
    localVector2f4.sub(hA);
    localVector2f4.sub(MathUtil.mul(localMatrix2f6, hB));
    if ((localVector2f4.x > 0.0F) || (localVector2f4.y > 0.0F))
      return 0;
    Vector2f localVector2f5 = MathUtil.abs(localVector2f3);
    localVector2f5.sub(MathUtil.mul(localMatrix2f7, hA));
View Full Code Here


    Matrix2f localMatrix2f5 = MathUtil.mul(localMatrix2f3, localMatrix2f2);
    Matrix2f localMatrix2f6 = MathUtil.abs(localMatrix2f5);
    Matrix2f localMatrix2f7 = localMatrix2f6.transpose();
    Vector2f localVector2f4 = MathUtil.abs(localVector2f2);
    localVector2f4.sub(hA);
    localVector2f4.sub(MathUtil.mul(localMatrix2f6, hB));
    if ((localVector2f4.x > 0.0F) || (localVector2f4.y > 0.0F))
      return 0;
    Vector2f localVector2f5 = MathUtil.abs(localVector2f3);
    localVector2f5.sub(MathUtil.mul(localMatrix2f7, hA));
    localVector2f5.sub(hB);
View Full Code Here

    localVector2f4.sub(hA);
    localVector2f4.sub(MathUtil.mul(localMatrix2f6, hB));
    if ((localVector2f4.x > 0.0F) || (localVector2f4.y > 0.0F))
      return 0;
    Vector2f localVector2f5 = MathUtil.abs(localVector2f3);
    localVector2f5.sub(MathUtil.mul(localMatrix2f7, hA));
    localVector2f5.sub(hB);
    if ((localVector2f5.x > 0.0F) || (localVector2f5.y > 0.0F))
      return 0;
    int i = 1;
    float f5 = localVector2f4.x;
View Full Code Here

    localVector2f4.sub(MathUtil.mul(localMatrix2f6, hB));
    if ((localVector2f4.x > 0.0F) || (localVector2f4.y > 0.0F))
      return 0;
    Vector2f localVector2f5 = MathUtil.abs(localVector2f3);
    localVector2f5.sub(MathUtil.mul(localMatrix2f7, hA));
    localVector2f5.sub(hB);
    if ((localVector2f5.x > 0.0F) || (localVector2f5.y > 0.0F))
      return 0;
    int i = 1;
    float f5 = localVector2f4.x;
    Vector2f localVector2f6 = localVector2f2.x > 0.0F ? localMatrix2f1.col1 : MathUtil.scale(localMatrix2f1.col1, -1.0F);
View Full Code Here

      localVector2f2 = arrayOfVector2f1[0];
      arrayOfVector2f1[0] = arrayOfVector2f1[1];
      arrayOfVector2f1[1] = localVector2f2;
    }
    Vector2f localVector2f2 = new Vector2f(arrayOfVector2f1[1]);
    localVector2f2.sub(arrayOfVector2f1[0]);
    localVector2f2.set(localVector2f2.y, -localVector2f2.x);
    EdgeSweep localEdgeSweep = new EdgeSweep(localVector2f2);
    localEdgeSweep.insert(0, true, arrayOfVector2f1[0].dot(localVector2f2));
    localEdgeSweep.insert(0, true, arrayOfVector2f1[1].dot(localVector2f2));
    localEdgeSweep.addVerticesToSweep(false, arrayOfVector2f2);
View Full Code Here

  public void setLineEndContact(Contact paramContact, Intersection paramIntersection, Vector2f[] paramArrayOfVector2f1, Vector2f[] paramArrayOfVector2f2)
  {
    Vector2f localVector2f = new Vector2f(paramIntersection.position);
    if (paramIntersection.isIngoing)
      localVector2f.sub(paramArrayOfVector2f1[1]);
    else
      localVector2f.sub(paramArrayOfVector2f1[0]);
    float f = 0.0F;
    paramContact.setSeparation(-f);
    paramContact.setNormal(MathUtil.getNormal(paramArrayOfVector2f2[((paramIntersection.edgeB + 1) % paramArrayOfVector2f2.length)], paramArrayOfVector2f2[paramIntersection.edgeB]));
View Full Code Here

  {
    Vector2f localVector2f = new Vector2f(paramIntersection.position);
    if (paramIntersection.isIngoing)
      localVector2f.sub(paramArrayOfVector2f1[1]);
    else
      localVector2f.sub(paramArrayOfVector2f1[0]);
    float f = 0.0F;
    paramContact.setSeparation(-f);
    paramContact.setNormal(MathUtil.getNormal(paramArrayOfVector2f2[((paramIntersection.edgeB + 1) % paramArrayOfVector2f2.length)], paramArrayOfVector2f2[paramIntersection.edgeB]));
    paramContact.setPosition(paramIntersection.position);
    paramContact.setFeature(new FeaturePair(0, 0, paramIntersection.edgeA, paramIntersection.edgeB));
View Full Code Here

    Polygon localPolygon = (Polygon)paramBody1.getShape();
    Box localBox = (Box)paramBody2.getShape();
    Vector2f[] arrayOfVector2f1 = localPolygon.getVertices(paramBody1.getPosition(), paramBody1.getRotation());
    Vector2f[] arrayOfVector2f2 = localBox.getPoints(paramBody2.getPosition(), paramBody2.getRotation());
    Vector2f localVector2f = new Vector2f(arrayOfVector2f2[1]);
    localVector2f.sub(arrayOfVector2f2[2]);
    EdgeSweep localEdgeSweep = new EdgeSweep(localVector2f);
    localEdgeSweep.addVerticesToSweep(true, arrayOfVector2f1);
    localEdgeSweep.addVerticesToSweep(false, arrayOfVector2f2);
    int[][] arrayOfInt = localEdgeSweep.getOverlappingEdges();
    Intersection[][] arrayOfIntersection = getIntersectionPairs(arrayOfVector2f1, arrayOfVector2f2, arrayOfInt);
View Full Code Here

  }

  public static float getPenetrationDepth(Intersection paramIntersection1, Intersection paramIntersection2, Vector2f paramVector2f, Vector2f[] paramArrayOfVector2f1, Vector2f[] paramArrayOfVector2f2)
  {
    Vector2f localVector2f = new Vector2f(paramIntersection2.position);
    localVector2f.sub(paramIntersection1.position);
    PenetrationSweep localPenetrationSweep = new PenetrationSweep(paramVector2f, localVector2f, paramIntersection1.position, paramIntersection2.position);
    PenetrationSweep tmp48_46 = localPenetrationSweep;
    tmp48_46.getClass();
    ContourWalker localContourWalker1 = new ContourWalker(paramArrayOfVector2f1, paramIntersection1.edgeA, paramIntersection2.edgeA, false);
    PenetrationSweep tmp74_72 = localPenetrationSweep;
View Full Code Here

      if (f1 < f2)
      {
        Vector2f localVector2f4 = new Vector2f();
        localLine.getClosestPoint(paramBody2.getPosition(), localVector2f4);
        Vector2f localVector2f5 = new Vector2f(paramBody2.getPosition());
        localVector2f5.sub(localVector2f4);
        float f3 = localCircle.getRadius() - localVector2f5.length();
        localVector2f5.normalise();
        paramArrayOfContact[i].setSeparation(-f3);
        paramArrayOfContact[i].setPosition(localVector2f4);
        paramArrayOfContact[i].setNormal(localVector2f5);
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.