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

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

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

origin: Renanse/Ardor3D

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

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

/**
 * Add to a Vector4 in-buffer.
 * 
 * @param toAdd
 *            the vector to add from
 * @param buf
 *            the buffer to find the Vector4 within
 * @param index
 *            the position (in terms of vectors, not floats) of the vector to add to
 */
public static void addInBuffer(final ReadOnlyVector4 toAdd, final FloatBuffer buf, final int index) {
  final Vector4 temp = Vector4.fetchTempInstance();
  populateFromBuffer(temp, buf, index);
  temp.addLocal(toAdd);
  setInBuffer(temp, buf, index);
  Vector4.releaseTempInstance(temp);
}
origin: Renanse/Ardor3D

/**
 * Add to a Vector4 in-buffer.
 * 
 * @param toAdd
 *            the vector to add from
 * @param buf
 *            the buffer to find the Vector4 within
 * @param index
 *            the position (in terms of vectors, not floats) of the vector to add to
 */
public static void addInBuffer(final ReadOnlyVector4 toAdd, final FloatBuffer buf, final int index) {
  final Vector4 temp = Vector4.fetchTempInstance();
  populateFromBuffer(temp, buf, index);
  temp.addLocal(toAdd);
  setInBuffer(temp, buf, index);
  Vector4.releaseTempInstance(temp);
}
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 testAdd() {
  final Vector4 vec1 = new Vector4();
  final Vector4 vec2 = new Vector4(Vector4.ONE);
  vec1.addLocal(1, 2, 3, 4);
  assertEquals(new Vector4(1, 2, 3, 4), vec1);
  vec1.addLocal(-1, -2, -3, -4);
  assertEquals(Vector4.ZERO, vec1);
  vec1.zero();
  vec1.addLocal(vec2);
  assertEquals(Vector4.ONE, vec1);
  vec1.zero();
  final Vector4 vec3 = vec1.add(vec2, new Vector4());
  assertEquals(Vector4.ZERO, vec1);
  assertEquals(Vector4.ONE, vec3);
  final Vector4 vec4 = vec1.add(0, 0, 0, 1, null);
  assertEquals(Vector4.ZERO, vec1);
  assertEquals(Vector4.UNIT_W, vec4);
}
com.ardor3d.mathVector4addLocal

Javadoc

Increments the values of this vector with 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
  • 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.
  • setX
    Sets the first component of this vector to the given double value.
  • setW,
  • setX,
  • setY,
  • setZ,
  • dot,
  • fetchTempInstance,
  • getWf,
  • multiply,
  • normalizeLocal

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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