Package net.phys2d.math

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


  {
    int i = 0;
    Line localLine1 = (Line)paramBody1.getShape();
    Box localBox = (Box)paramBody2.getShape();
    Vector2f localVector2f1 = new Vector2f(localLine1.getDX(), localLine1.getDY());
    localVector2f1.normalise();
    Vector2f localVector2f2 = new Vector2f(-localLine1.getDY(), localLine1.getDX());
    localVector2f2.normalise();
    Vector2f localVector2f3 = new Vector2f();
    localLine1.getStart().projectOntoUnit(localVector2f2, localVector2f3);
    float f1 = getProp(localVector2f3, localVector2f2);
View Full Code Here


    Line localLine1 = (Line)paramBody1.getShape();
    Box localBox = (Box)paramBody2.getShape();
    Vector2f localVector2f1 = new Vector2f(localLine1.getDX(), localLine1.getDY());
    localVector2f1.normalise();
    Vector2f localVector2f2 = new Vector2f(-localLine1.getDY(), localLine1.getDX());
    localVector2f2.normalise();
    Vector2f localVector2f3 = new Vector2f();
    localLine1.getStart().projectOntoUnit(localVector2f2, localVector2f3);
    float f1 = getProp(localVector2f3, localVector2f2);
    Vector2f localVector2f4 = MathUtil.sub(paramBody2.getPosition(), paramBody1.getPosition());
    localVector2f4.projectOntoUnit(localVector2f2, localVector2f3);
View Full Code Here

      float f7 = (float)Math.sqrt(f6);
      paramArrayOfContact[0].setSeparation(f7 - localCircle.getRadius());
      Vector2f localVector2f1 = new Vector2f();
      arrayOfLine[i].getClosestPoint(paramBody2.getPosition(), localVector2f1);
      Vector2f localVector2f2 = MathUtil.sub(paramBody2.getPosition(), localVector2f1);
      localVector2f2.normalise();
      paramArrayOfContact[0].setNormal(localVector2f2);
      paramArrayOfContact[0].setPosition(localVector2f1);
      paramArrayOfContact[0].setFeature(new FeaturePair());
      return 1;
    }
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.