Codota Logo
Vector4.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.ardor3d.math.Vector4
constructor

Best Java code snippets using com.ardor3d.math.Vector4.<init> (Showing top 20 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

@Override
public Vector4 clone() {
  return new Vector4(this);
}
origin: Renanse/Ardor3D

public BMTextBackground(final String name, final BMText text, final Texture texture) {
  this(name, text, texture, new Vector4(0.25, 0.25, 0.25, 0.25));
}
origin: com.ardor3d/ardor3d-math

@Override
public Vector4 clone() {
  return new Vector4(this);
}
origin: com.ardor3d/ardor3d-core

public void setEnvPlaneR(final ReadOnlyVector4 plane) {
  if (plane == null) {
    _envPlaneR = null;
    return;
  } else if (_envPlaneR == null) {
    _envPlaneR = new Vector4(plane);
  } else {
    _envPlaneR.set(plane);
  }
}
origin: com.ardor3d/ardor3d-core

public void setEnvPlaneQ(final ReadOnlyVector4 plane) {
  if (plane == null) {
    _envPlaneQ = null;
    return;
  } else if (_envPlaneQ == null) {
    _envPlaneQ = new Vector4(plane);
  } else {
    _envPlaneQ.set(plane);
  }
}
origin: com.ardor3d/ardor3d-core

public void setEnvPlaneT(final ReadOnlyVector4 plane) {
  if (plane == null) {
    _envPlaneT = null;
    return;
  } else if (_envPlaneT == null) {
    _envPlaneT = new Vector4(plane);
  } else {
    _envPlaneT.set(plane);
  }
}
origin: com.ardor3d/ardor3d-core

public void setEnvPlaneS(final ReadOnlyVector4 plane) {
  if (plane == null) {
    _envPlaneS = null;
    return;
  } else if (_envPlaneS == null) {
    _envPlaneS = new Vector4(plane);
  } else {
    _envPlaneS.set(plane);
  }
}
origin: com.ardor3d/ardor3d-math

/**
 * @return An instance of Vector4 that is intended for temporary use in calculations and so forth. Multiple calls to
 *         the method should return instances of this class that are not currently in use.
 */
public final static Vector4 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Vector4.VEC_POOL.fetch();
  } else {
    return new Vector4();
  }
}
origin: Renanse/Ardor3D

/**
 * @return An instance of Vector4 that is intended for temporary use in calculations and so forth. Multiple calls to
 *         the method should return instances of this class that are not currently in use.
 */
public final static Vector4 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Vector4.VEC_POOL.fetch();
  } else {
    return new Vector4();
  }
}
origin: Renanse/Ardor3D

@Override
public ResultSample doScaleTest(final int count, final int maxCount, final long timeOutMS) {
  final Matrix4 m1 = a3dMatrixRandom();
  final Vector4 vec = new Vector4(1.0, 2.0, 3.0, 1.0);
  final long start = System.currentTimeMillis();
  int loopCount = 0;
  while (System.currentTimeMillis() - start < timeOutMS && loopCount != maxCount) {
    ++loopCount;
    for (int i = 0; i < count; ++i) {
      m1.scaleLocal(vec);
    }
  }
  return populateResult(System.currentTimeMillis() - start, loopCount, m1.toArray(null));
}
origin: Renanse/Ardor3D

@Test
public void testScaleAdd() {
  final Vector4 vec1 = new Vector4(1, 1, 1, 1);
  final Vector4 vec2 = vec1.scaleAdd(2.0, new Vector4(1, 2, 3, 4), null);
  final Vector4 vec2B = vec1.scaleAdd(2.0, new Vector4(1, 2, 3, 4), new Vector4());
  assertEquals(new Vector4(3.0, 4.0, 5.0, 6.0), vec2);
  assertEquals(new Vector4(3.0, 4.0, 5.0, 6.0), vec2B);
  vec1.scaleAddLocal(2.0, new Vector4(1, 2, 3, 4));
  assertEquals(vec2, vec1);
}
origin: Renanse/Ardor3D

@Override
public void write(final OutputCapsule capsule) throws IOException {
  super.write(capsule);
  capsule.write(_tintColor, "tintColor", new ColorRGBA(ColorRGBA.WHITE));
  capsule.write(_textureBorderOffsets, "borderCoords", new Vector4(0.25, 0.25, 0.25, 0.25));
  capsule.write(_contentPadding, "contentPadding", new Vector4());
  capsule.write(_borderScale, "borderScale", 1f);
}
origin: Renanse/Ardor3D

  @Override
  public void read(final InputCapsule capsule) throws IOException {
    super.read(capsule);
    _tintColor = (ColorRGBA) capsule.readSavable("tintColor", new ColorRGBA(ColorRGBA.WHITE));
    _textureBorderOffsets = (Vector4) capsule.readSavable("borderCoords", new Vector4(0.25, 0.25, 0.25, 0.25));
    _contentPadding = (Vector4) capsule.readSavable("contentPadding", new Vector4());
    _borderScale = capsule.readFloat("borderScale", 1f);
    final TextureState ts = ((TextureState) getLocalRenderState(StateType.Texture));
    if (ts != null) {
      _texture = ts.getTexture();
    }
  }
}
origin: Renanse/Ardor3D

  @Test
  public void testSimpleHash() {
    // Just a simple sanity check.
    final Vector4 vec1 = new Vector4(1, 2, 3, 4);
    final Vector4 vec2 = new Vector4(1, 2, 3, 4);
    final Vector4 vec3 = new Vector4(2, 2, 2, 2);

    assertTrue(vec1.hashCode() == vec2.hashCode());
    assertTrue(vec1.hashCode() != vec3.hashCode());
  }
}
origin: Renanse/Ardor3D

@Test
public void testNegate() {
  final Vector4 vec1 = new Vector4(3, 2, -1, 1);
  final Vector4 vec2 = vec1.negate(null);
  assertEquals(new Vector4(-3, -2, 1, -1), vec2);
  vec1.negateLocal();
  assertEquals(vec2, vec1);
}
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: Renanse/Ardor3D

@Test
public void testApplyVector4() {
  final Matrix4 mat4 = new Matrix4().applyRotationX(MathUtils.HALF_PI);
  final Vector4 vec4 = new Vector4(0, 1, 0, 1);
  final Vector4 result = mat4.applyPost(vec4, null);
  assertTrue(Math.abs(new Vector4(0, 0, 1, 1).distance(result)) <= MathUtils.EPSILON);
  vec4.set(0, 1, 1, 1);
  mat4.applyPost(vec4, result);
  assertTrue(Math.abs(new Vector4(0, -1, 1, 1).distance(result)) <= MathUtils.EPSILON);
  vec4.set(0, 1, 1, 1);
  mat4.applyPre(vec4, result);
  assertTrue(Math.abs(new Vector4(0, 1, -1, 1).distance(result)) <= MathUtils.EPSILON);
  vec4.set(1, 1, 1, 1);
  assertTrue(Math.abs(new Vector4(1, 1, -1, 1).distance(mat4.applyPre(vec4, null))) <= MathUtils.EPSILON);
}
origin: Renanse/Ardor3D

@Test
public void testClone() {
  final Vector4 vec1 = new Vector4(0, 0, 0, 0);
  final Vector4 vec2 = vec1.clone();
  assertEquals(vec1, vec2);
  assertNotSame(vec1, vec2);
}
origin: Renanse/Ardor3D

@Test
public void testDistance() {
  final Vector4 vec1 = new Vector4(0, 0, 0, 0);
  assertTrue(4.0 == vec1.distance(4, 0, 0, 0));
  assertTrue(3.0 == vec1.distance(0, 3, 0, 0));
  assertTrue(2.0 == vec1.distance(0, 0, 2, 0));
  assertTrue(1.0 == vec1.distance(0, 0, 0, 1));
  final Vector4 vec2 = new Vector4(1, 1, 1, 1);
  assertTrue(Math.sqrt(4) == vec1.distance(vec2));
}
origin: Renanse/Ardor3D

@Test
public void testTranslation() {
  final Matrix4 src = new Matrix4();
  src.applyRotation(MathUtils.QUARTER_PI, 1, 0, 0);
  final Matrix4 trans = new Matrix4();
  trans.setColumn(3, new Vector4(1, 2, 3, 1));
  final Matrix4 transThenRotate = trans.multiply(src, null);
  final Matrix4 rotateThenTrans = src.multiply(trans, null);
  final Matrix4 pre1 = new Matrix4(src).applyTranslationPre(1, 2, 3);
  final Matrix4 post1 = new Matrix4(src).applyTranslationPost(1, 2, 3);
  assertEquals(transThenRotate, pre1);
  assertEquals(rotateThenTrans, post1);
}
com.ardor3d.mathVector4<init>

Javadoc

Constructs a new vector set to (0, 0, 0, 0).

Popular methods of Vector4

  • 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.
  • 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

  • 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