congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Vector4.subtractLocal
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.ardor3d/ardor3d-math

/**
 * Decrements the values of this vector by the x, y, z and w values from the given source vector.
 * 
 * @param source
 * @return this vector for chaining
 * @throws NullPointerException
 *             if source is null.
 */
public Vector4 subtractLocal(final ReadOnlyVector4 source) {
  return subtractLocal(source.getX(), source.getY(), source.getZ(), source.getW());
}
origin: Renanse/Ardor3D

/**
 * Decrements the values of this vector by the x, y, z and w values from the given source vector.
 * 
 * @param source
 * @return this vector for chaining
 * @throws NullPointerException
 *             if source is null.
 */
public Vector4 subtractLocal(final ReadOnlyVector4 source) {
  return subtractLocal(source.getX(), source.getY(), source.getZ(), source.getW());
}
origin: com.ardor3d/ardor3d-effects

private void calculateIntersection(final double planeHeight, final ReadOnlyVector2 screenPosition,
    final ReadOnlyMatrix4 modelViewProjectionInverseMatrix) {
  origin.set(screenPosition.getX() * 2 - 1, screenPosition.getY() * 2 - 1, -1, 1);
  direction.set(screenPosition.getX() * 2 - 1, screenPosition.getY() * 2 - 1, 1, 1);
  modelViewProjectionInverseMatrix.applyPre(origin, origin);
  modelViewProjectionInverseMatrix.applyPre(direction, direction);
  direction.subtractLocal(origin);
  // final double t = (planeHeight * origin.getW() - origin.getY())
  // / (direction.getY() - planeHeight * direction.getW());
  if (Math.abs(direction.getY()) > MathUtils.EPSILON) {
    final double t = (planeHeight - origin.getY()) / direction.getY();
    direction.multiplyLocal(t);
  } else {
    direction.normalizeLocal();
    direction.multiplyLocal(mainCamera.getFrustumFar());
  }
  origin.addLocal(direction);
}
origin: Renanse/Ardor3D

private void calculateIntersection(final double planeHeight, final ReadOnlyVector2 screenPosition,
    final ReadOnlyMatrix4 modelViewProjectionInverseMatrix) {
  origin.set(screenPosition.getX() * 2 - 1, screenPosition.getY() * 2 - 1, -1, 1);
  direction.set(screenPosition.getX() * 2 - 1, screenPosition.getY() * 2 - 1, 1, 1);
  modelViewProjectionInverseMatrix.applyPre(origin, origin);
  modelViewProjectionInverseMatrix.applyPre(direction, direction);
  direction.subtractLocal(origin);
  // final double t = (planeHeight * origin.getW() - origin.getY())
  // / (direction.getY() - planeHeight * direction.getW());
  if (Math.abs(direction.getY()) > MathUtils.EPSILON) {
    final double t = (planeHeight - origin.getY()) / direction.getY();
    direction.multiplyLocal(t);
  } else {
    direction.normalizeLocal();
    direction.multiplyLocal(mainCamera.getFrustumFar());
  }
  origin.addLocal(direction);
}
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);
}
com.ardor3d.mathVector4subtractLocal

Javadoc

Decrements the values of this vector by the given x, y, z and w values.

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

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • getSystemService (Context)
  • startActivity (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • 21 Best IntelliJ Plugins
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