Tabnine Logo
Vector4.subtract
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.ardor3d/ardor3d-math

/**
 * Subtracts the values of the given source vector from those of this vector and returns them in store.
 * 
 * @param source
 * @param store
 *            the vector to store the result in for return. If null, a new vector object is created and returned.
 * @return (this.x - source.x, this.y - source.y, this.z - source.z, this.w - source.w)
 * @throws NullPointerException
 *             if source is null.
 */
@Override
public Vector4 subtract(final ReadOnlyVector4 source, final Vector4 store) {
  return subtract(source.getX(), source.getY(), source.getZ(), source.getW(), store);
}
origin: Renanse/Ardor3D

@Test
public void testSubtract() {
  final Vector4 vec1 = new Vector4();
  final Vector4 vec2 = new Vector4(Vector4.ONE);
  vec1.subtractLocal(1, 2, 3, 4);
  assertEquals(new Vector4(-1, -2, -3, -4), vec1);
  vec1.subtractLocal(-1, -2, -3, -4);
  assertEquals(Vector4.ZERO, vec1);
  vec1.zero();
  vec1.subtractLocal(vec2);
  assertEquals(Vector4.NEG_ONE, vec1);
  vec1.zero();
  final Vector4 vec3 = vec1.subtract(vec2, new Vector4());
  assertEquals(Vector4.ZERO, vec1);
  assertEquals(Vector4.NEG_ONE, vec3);
  final Vector4 vec4 = vec1.subtract(0, 0, 0, 1, null);
  assertEquals(Vector4.ZERO, vec1);
  assertEquals(Vector4.NEG_UNIT_W, vec4);
}
origin: Renanse/Ardor3D

/**
 * Subtracts the values of the given source vector from those of this vector and returns them in store.
 * 
 * @param source
 * @param store
 *            the vector to store the result in for return. If null, a new vector object is created and returned.
 * @return (this.x - source.x, this.y - source.y, this.z - source.z, this.w - source.w)
 * @throws NullPointerException
 *             if source is null.
 */
@Override
public Vector4 subtract(final ReadOnlyVector4 source, final Vector4 store) {
  return subtract(source.getX(), source.getY(), source.getZ(), source.getW(), store);
}
com.ardor3d.mathVector4subtract

Javadoc

Subtracts the given values from those of this vector and returns them in store.

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

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now