Examples of lengthSquared()


Examples of org.jbox2d.common.Vec2.lengthSquared()

      if(dc.isDestroyed()){
        contentCreations.remove(i);
      }else{
       
        v=center.sub(dc.getBody().getPosition());
        float lengthS=v.lengthSquared();
       
        if(lengthS>ASBOTXConfigs.E_SQUARE){
          v.normalize();
          v.mulLocal((float)radius*K*dc.getBody().getMass());
          dc.getBody().applyForce(v, dc.getBody().getWorldCenter());
View Full Code Here

Examples of org.jbox2d.common.Vec2.lengthSquared()

        if (c < 0.0f) {
          ie = j;
        }

        // Collinearity check
        if (c == 0.0f && v.lengthSquared() > r.lengthSquared()) {
          ie = j;
        }
      }

      ++m;
View Full Code Here

Examples of org.jbox2d.common.Vec2.lengthSquared()

    for (int i = 0; i < m_count; ++i) {
      final int i1 = i;
      final int i2 = i + 1 < m_count ? i + 1 : 0;
      edge.set(m_vertices[i2]).subLocal(m_vertices[i1]);

      assert (edge.lengthSquared() > Settings.EPSILON * Settings.EPSILON);
      Vec2.crossToOutUnsafe(edge, 1f, m_normals[i]);
      m_normals[i].normalize();
    }

    // Compute the polygon centroid.
View Full Code Here

Examples of org.jbox2d.common.Vec2.lengthSquared()

    for (int i = 0; i < bodies.length; ++i) {
      final int next = (i == bodies.length - 1) ? 0 : i + 1;
      delta.set(toExtrude * (normals[i].x + normals[next].x), toExtrude
          * (normals[i].y + normals[next].y));
      // sumdeltax += dx;
      float normSqrd = delta.lengthSquared();
      if (normSqrd > Settings.maxLinearCorrection * Settings.maxLinearCorrection) {
        delta.mulLocal(Settings.maxLinearCorrection / MathUtils.sqrt(normSqrd));
      }
      if (normSqrd > Settings.linearSlop * Settings.linearSlop) {
        done = false;
View Full Code Here

Examples of org.jbox2d.common.Vec2.lengthSquared()

        if (c < 0.0f) {
          ie = j;
        }

        // Collinearity check
        if (c == 0.0f && v.lengthSquared() > r.lengthSquared()) {
          ie = j;
        }
      }

      ++m;
View Full Code Here

Examples of org.jbox2d.common.Vec2.lengthSquared()

    for (int i = 0; i < m_count; ++i) {
      final int i1 = i;
      final int i2 = i + 1 < m_count ? i + 1 : 0;
      edge.set(m_vertices[i2]).subLocal(m_vertices[i1]);

      assert (edge.lengthSquared() > Settings.EPSILON * Settings.EPSILON);
      Vec2.crossToOutUnsafe(edge, 1f, m_normals[i]);
      m_normals[i].normalize();
    }

    // Compute the polygon centroid.
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.lengthSquared()

          center.scaleLocal(quantity);

          float maxRadiusSqr = 0;
          for (int i = 0; i < points.length; i++) {
              Vector3D diff = points[i].getSubtracted(center);
              float radiusSqr = diff.lengthSquared();
              if (radiusSqr > maxRadiusSqr) {
                  maxRadiusSqr = radiusSqr;
              }
          }
View Full Code Here

Examples of org.osm2world.core.math.VectorXZ.lengthSquared()

   
    VectorXYZ endDir = lastV.subtract(slastV).normalize();
    VectorXYZ headStart = lastV.subtract(endDir.mult(headLength));
   
    VectorXZ endDirXZ = endDir.xz();
    if (endDirXZ.lengthSquared() < 0.01) { //(almost) vertical vector
      endDirXZ = VectorXZ.X_UNIT;
    } else {
      endDirXZ = endDirXZ.normalize();
    }
    VectorXZ endNormalXZ = endDirXZ.rightNormal();
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.