Package net.phys2d.raw.shapes

Examples of net.phys2d.raw.shapes.Circle


    float f4 = paramBody2.getPosition().getY();
    boolean bool = paramBody1.getShape().getBounds().touches(f1, f2, paramBody2.getShape().getBounds(), f3, f4);
    if (!bool)
      return 0;
    Box localBox = (Box)paramBody1.getShape();
    Circle localCircle = (Circle)paramBody2.getShape();
    Vector2f[] arrayOfVector2f = localBox.getPoints(paramBody1.getPosition(), paramBody1.getRotation());
    Line[] arrayOfLine = new Line[4];
    arrayOfLine[0] = new Line(arrayOfVector2f[0], arrayOfVector2f[1]);
    arrayOfLine[1] = new Line(arrayOfVector2f[1], arrayOfVector2f[2]);
    arrayOfLine[2] = new Line(arrayOfVector2f[2], arrayOfVector2f[3]);
    arrayOfLine[3] = new Line(arrayOfVector2f[3], arrayOfVector2f[0]);
    float f5 = localCircle.getRadius() * localCircle.getRadius();
    int i = -1;
    float f6 = 3.4028235E+38F;
    for (int j = 0; j < 4; j++)
    {
      float f8 = arrayOfLine[j].distanceSquared(paramBody2.getPosition());
      if ((f8 < f5) && (f6 > f8))
      {
        f6 = f8;
        i = j;
      }
    }
    if (i > -1)
    {
      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);
View Full Code Here

TOP

Related Classes of net.phys2d.raw.shapes.Circle

Copyright © 2018 www.massapicom. 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.