Examples of lengthSquared()


Examples of com.ardor3d.math.Vector3.lengthSquared()

        _center.multiplyLocal(quantity);

        double maxRadiusSqr = 0;
        for (int i = 0; i < points.length; i++) {
            final Vector3 diff = points[i].subtract(_center, _compVect1);
            final double radiusSqr = diff.lengthSquared();
            if (radiusSqr > maxRadiusSqr) {
                maxRadiusSqr = radiusSqr;
            }
        }
View Full Code Here

Examples of com.flansmod.common.vector.Vector3f.lengthSquared()

    {
      Vector3f motVec = new Vector3f(motionX, motionY, motionZ);
      List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox);
      for(Object obj : list)
      {
        if(obj == thrower && ticksExisted < 10 || motVec.lengthSquared() < 0.01D)
          continue;
        if(obj instanceof EntityLivingBase)
          ((EntityLivingBase)obj).attackEntityFrom(getGrenadeDamage(), type.damageVsLiving * motVec.lengthSquared() * 3);
      }
    }
 
View Full Code Here

Examples of com.jme3.math.Vector3f.lengthSquared()

            float triangleHeight = 2 * field / h.length();// the base of the height is the h vector
            // now calculate the distance between v1 vertex and the point where
            // the above calculated height 'touches' the base line (it can be
            // settled outside the h vector)
            float x = Math.abs((float) Math.sqrt(FastMath.clamp(temp.lengthSquared() - triangleHeight * triangleHeight, 0, Float.MAX_VALUE))) * Math.signum(cosAlpha);
            // now get the height base point
            Vector3f xPoint = v1.add(h.normalize().multLocal(x));

            // get the minimum point of the envelope
            Vector3f min = x < 0 ? xPoint : v1;
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.types.Vector3.lengthSquared()

            Primitive prim = e.getValue();
            if (prim.Joint.equals(JointType.Invalid))
            {
              //region Angular Velocity
              Vector3 angVel = prim.AngularVelocity;
              float omega = angVel.lengthSquared();

              if (omega > 0.00001f)
              {
                omega = (float)Math.sqrt(omega);
                float angle = omega * adjSeconds;
 
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.lengthSquared()

    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(),r1));
      dv.scale(-1);
      dv.add(bias); // TODO: is this baumgarte stabilization?
     
      if (dv.lengthSquared() == 0) {
        return;
      }
     
    Vector2f impulse = MathUtil.mul(M, dv);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.lengthSquared()

    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(),r1));
      dv.scale(-1);
      dv.add(bias);
     
      if (dv.lengthSquared() == 0) {
        return;
      }
     
    Vector2f impulse = MathUtil.mul(M, dv);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.lengthSquared()

    }
   
    Vector2f normal = endB; // reuse of vector object
    normal.set(startB);
    normal.sub(position);
    float distSquared = normal.lengthSquared();
    float radiusSquared = circle.getRadius() * circle.getRadius();
   
    if ( distSquared < radiusSquared ) {
      contacts[0].setPosition(position);
      contacts[0].setFeature(new FeaturePair());
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.lengthSquared()

    }
   
    Vector2f normal = endB; // reuse of vector object
    normal.set(startB);
    normal.sub(position);
    float distSquared = normal.lengthSquared();
    float radiusSquared = circle.getRadius() * circle.getRadius();
   
    if ( distSquared < radiusSquared ) {
      contacts[0].setPosition(position);
      contacts[0].setFeature(new FeaturePair());
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.lengthSquared()

    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(),r1));
      dv.scale(-1);
      dv.add(bias); // TODO: is this baumgarte stabilization?
     
      if (dv.lengthSquared() == 0) {
        return;
      }
     
    Vector2f impulse = MathUtil.mul(M, dv);
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.lengthSquared()

    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(),r1));
      dv.scale(-1);
      dv.add(bias);
     
      if (dv.lengthSquared() == 0) {
        return;
      }
     
    Vector2f impulse = MathUtil.mul(M, dv);
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.