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

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

Best Java code snippets using com.ardor3d.math.Vector4.dot (Showing top 5 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: com.ardor3d/ardor3d-math

/**
 * @param vec
 * @return the dot product of this vector with the x, y, z, w values of the given vector.
 * @throws NullPointerException
 *             if vec is null.
 */
@Override
public double dot(final ReadOnlyVector4 vec) {
  return dot(vec.getX(), vec.getY(), vec.getZ(), vec.getW());
}
origin: Renanse/Ardor3D

/**
 * @param vec
 * @return the dot product of this vector with the x, y, z, w values of the given vector.
 * @throws NullPointerException
 *             if vec is null.
 */
@Override
public double dot(final ReadOnlyVector4 vec) {
  return dot(vec.getX(), vec.getY(), vec.getZ(), vec.getW());
}
origin: Renanse/Ardor3D

@Test
public void testDot() {
  final Vector4 vec1 = new Vector4(7, 2, 5, -1);
  assertTrue(35.0 == vec1.dot(3, 1, 2, -2));
  assertTrue(-11.0 == vec1.dot(new Vector4(-1, 1, -1, 1)));
}
origin: com.ardor3d/ardor3d-effects

private void modifyProjectionMatrix(final Vector4 clipPlane) {
  // Get the current projection matrix
  projectionMatrix = cam.getProjectionMatrix().toArray(projectionMatrix);
  // Get the inverse transpose of the current modelview matrix
  final ReadOnlyMatrix4 modelViewMatrixInvTrans = tRenderer.getCamera().getModelViewMatrix().invert(tmpMatrix)
      .transposeLocal();
  modelViewMatrixInvTrans.applyPre(clipPlane, clipPlane);
  // Calculate the clip-space corner point opposite the clipping plane
  // as (sgn(clipPlane.x), sgn(clipPlane.y), 1, 1) and
  // transform it into camera space by multiplying it
  // by the inverse of the projection matrix
  cornerPoint.setX((sign(clipPlane.getX()) + projectionMatrix[8]) / projectionMatrix[0]);
  cornerPoint.setY((sign(clipPlane.getY()) + projectionMatrix[9]) / projectionMatrix[5]);
  cornerPoint.setZ(-1.0);
  cornerPoint.setW((1.0 + projectionMatrix[10]) / projectionMatrix[14]);
  // Calculate the scaled plane vector
  final Vector4 scaledPlaneVector = clipPlane.multiply((2.0 / clipPlane.dot(cornerPoint)), cornerPoint);
  // Replace the third row of the projection matrix
  projectionMatrix[2] = scaledPlaneVector.getX();
  projectionMatrix[6] = scaledPlaneVector.getY();
  projectionMatrix[10] = scaledPlaneVector.getZ() + 1.0;
  projectionMatrix[14] = scaledPlaneVector.getW();
  // Load it back into OpenGL
  final Matrix4 newProjectionMatrix = tmpMatrix.fromArray(projectionMatrix);
  tRenderer.getCamera().setProjectionMatrix(newProjectionMatrix);
}
origin: Renanse/Ardor3D

private void modifyProjectionMatrix(final Vector4 clipPlane) {
  // Get the current projection matrix
  projectionMatrix = cam.getProjectionMatrix().toArray(projectionMatrix);
  // Get the inverse transpose of the current modelview matrix
  final ReadOnlyMatrix4 modelViewMatrixInvTrans = tRenderer.getCamera().getViewMatrix().invert(tmpMatrix)
      .transposeLocal();
  modelViewMatrixInvTrans.applyPre(clipPlane, clipPlane);
  // Calculate the clip-space corner point opposite the clipping plane
  // as (sgn(clipPlane.x), sgn(clipPlane.y), 1, 1) and
  // transform it into camera space by multiplying it
  // by the inverse of the projection matrix
  cornerPoint.setX((sign(clipPlane.getX()) + projectionMatrix[8]) / projectionMatrix[0]);
  cornerPoint.setY((sign(clipPlane.getY()) + projectionMatrix[9]) / projectionMatrix[5]);
  cornerPoint.setZ(-1.0);
  cornerPoint.setW((1.0 + projectionMatrix[10]) / projectionMatrix[14]);
  // Calculate the scaled plane vector
  final Vector4 scaledPlaneVector = clipPlane.multiply((2.0 / clipPlane.dot(cornerPoint)), cornerPoint);
  // Replace the third row of the projection matrix
  projectionMatrix[2] = scaledPlaneVector.getX();
  projectionMatrix[6] = scaledPlaneVector.getY();
  projectionMatrix[10] = scaledPlaneVector.getZ() + 1.0;
  projectionMatrix[14] = scaledPlaneVector.getW();
  // Load it back into OpenGL
  final Matrix4 newProjectionMatrix = tmpMatrix.fromArray(projectionMatrix);
  tRenderer.getCamera().setProjectionMatrix(newProjectionMatrix);
}
com.ardor3d.mathVector4dot

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,
  • fetchTempInstance,
  • getWf,
  • multiply,
  • normalizeLocal

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • JComboBox (javax.swing)
  • JLabel (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