Codota Logo
Vector4.lengthSquared
Code IndexAdd Codota to your IDE (free)

How to use
lengthSquared
method
in
com.ardor3d.math.Vector4

Best Java code snippets using com.ardor3d.math.Vector4.lengthSquared (Showing top 6 results out of 315)

  • Common ways to obtain Vector4
private void myMethod () {
Vector4 v =
  • Codota Iconnew Vector4()
  • Codota IconVector4.fetchTempInstance()
  • Codota IconReadOnlyVector4 src;new Vector4(src)
  • Smart code suggestions by Codota
}
origin: Renanse/Ardor3D

/**
 * @return the magnitude or distance between the origin (0, 0, 0, 0) and the point described by this vector (x, y,
 *         z, w). Effectively the square root of the value returned by {@link #lengthSquared()}.
 */
@Override
public double length() {
  return MathUtils.sqrt(lengthSquared());
}
origin: com.ardor3d/ardor3d-math

/**
 * @return the magnitude or distance between the origin (0, 0, 0, 0) and the point described by this vector (x, y,
 *         z, w). Effectively the square root of the value returned by {@link #lengthSquared()}.
 */
@Override
public double length() {
  return MathUtils.sqrt(lengthSquared());
}
origin: com.ardor3d/ardor3d-math

/**
 * Converts this vector into a unit vector by dividing it internally by its length. If the length is 0, (ie, if the
 * vector is 0, 0, 0, 0) then no action is taken.
 * 
 * @return this vector for chaining
 */
public Vector4 normalizeLocal() {
  final double lengthSq = lengthSquared();
  if (Math.abs(lengthSq) > MathUtils.EPSILON) {
    return multiplyLocal(MathUtils.inverseSqrt(lengthSq));
  }
  return this;
}
origin: Renanse/Ardor3D

/**
 * Converts this vector into a unit vector by dividing it internally by its length. If the length is 0, (ie, if the
 * vector is 0, 0, 0, 0) then no action is taken.
 * 
 * @return this vector for chaining
 */
public Vector4 normalizeLocal() {
  final double lengthSq = lengthSquared();
  if (Math.abs(lengthSq) > MathUtils.EPSILON) {
    return multiplyLocal(MathUtils.inverseSqrt(lengthSq));
  }
  return this;
}
origin: com.ardor3d/ardor3d-math

/**
 * Creates a new unit length vector from this one by dividing by length. If the length is 0, (ie, if the vector is
 * 0, 0, 0, 0) then a new vector (0, 0, 0, 0) is returned.
 * 
 * @param store
 *            the vector to store the result in for return. If null, a new vector object is created and returned.
 * @return a new unit vector (or 0, 0, 0, 0 if this unit is 0 length)
 */
@Override
public Vector4 normalize(final Vector4 store) {
  final double lengthSq = lengthSquared();
  if (Math.abs(lengthSq) > MathUtils.EPSILON) {
    return multiply(MathUtils.inverseSqrt(lengthSq), store);
  }
  return store != null ? store.set(Vector4.ZERO) : new Vector4(Vector4.ZERO);
}
origin: Renanse/Ardor3D

/**
 * Creates a new unit length vector from this one by dividing by length. If the length is 0, (ie, if the vector is
 * 0, 0, 0, 0) then a new vector (0, 0, 0, 0) is returned.
 * 
 * @param store
 *            the vector to store the result in for return. If null, a new vector object is created and returned.
 * @return a new unit vector (or 0, 0, 0, 0 if this unit is 0 length)
 */
@Override
public Vector4 normalize(final Vector4 store) {
  final double lengthSq = lengthSquared();
  if (Math.abs(lengthSq) > MathUtils.EPSILON) {
    return multiply(MathUtils.inverseSqrt(lengthSq), store);
  }
  return store != null ? store.set(Vector4.ZERO) : new Vector4(Vector4.ZERO);
}
com.ardor3d.mathVector4lengthSquared

Popular methods of Vector4

  • <init>
    Constructs a new vector set to the (x, y, z, w) values of the given source vector.
  • set
    Sets the value of this vector to the (x, y, z, w) values of the provided source vector.
  • getW
  • getX
  • getY
  • getZ
  • addLocal
    Increments the values of this vector with the x, y, z and w values of the given vector.
  • getXf
  • getYf
  • getZf
  • multiplyLocal
    Internally modifies the values of this vector by multiplying them each by the given scale values.
  • setW
    Sets the fourth component of this vector to the given double value.
  • multiplyLocal,
  • setW,
  • setX,
  • setY,
  • setZ,
  • dot,
  • fetchTempInstance,
  • getWf,
  • multiply,
  • normalizeLocal

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JComboBox (javax.swing)
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now