/** * Checks to see if the given Vector3 is equals to the data stored in the buffer at the given data index. * * @param check * the vector to check against - null will return false. * @param buf * the buffer to compare data with * @param index * the position (in terms of vectors, not floats) of the vector in the buffer to check against * @return */ public static boolean equals(final ReadOnlyVector4 check, final FloatBuffer buf, final int index) { final Vector4 temp = Vector4.fetchTempInstance(); populateFromBuffer(temp, buf, index); final boolean equals = temp.equals(check); Vector4.releaseTempInstance(temp); return equals; }
/** * Checks to see if the given Vector3 is equals to the data stored in the buffer at the given data index. * * @param check * the vector to check against - null will return false. * @param buf * the buffer to compare data with * @param index * the position (in terms of vectors, not floats) of the vector in the buffer to check against * @return */ public static boolean equals(final ReadOnlyVector4 check, final FloatBuffer buf, final int index) { final Vector4 temp = Vector4.fetchTempInstance(); populateFromBuffer(temp, buf, index); final boolean equals = temp.equals(check); Vector4.releaseTempInstance(temp); return equals; }
/** * Multiply and store a Vector3 in-buffer. * * @param toMult * the vector to multiply against * @param buf * the buffer to find the Vector3 within * @param index * the position (in terms of vectors, not floats) of the vector to multiply */ public static void multInBuffer(final ReadOnlyVector4 toMult, final FloatBuffer buf, final int index) { final Vector4 temp = Vector4.fetchTempInstance(); populateFromBuffer(temp, buf, index); temp.multiplyLocal(toMult); setInBuffer(temp, buf, index); Vector4.releaseTempInstance(temp); }
/** * Normalize a Vector4 in-buffer. * * @param buf * the buffer to find the Vector4 within * @param index * the position (in terms of vectors, not floats) of the vector to normalize */ public static void normalizeVector4(final FloatBuffer buf, final int index) { final Vector4 temp = Vector4.fetchTempInstance(); populateFromBuffer(temp, buf, index); temp.normalizeLocal(); setInBuffer(temp, buf, index); Vector4.releaseTempInstance(temp); }
/** * Multiply and store a Vector3 in-buffer. * * @param toMult * the vector to multiply against * @param buf * the buffer to find the Vector3 within * @param index * the position (in terms of vectors, not floats) of the vector to multiply */ public static void multInBuffer(final ReadOnlyVector4 toMult, final FloatBuffer buf, final int index) { final Vector4 temp = Vector4.fetchTempInstance(); populateFromBuffer(temp, buf, index); temp.multiplyLocal(toMult); setInBuffer(temp, buf, index); Vector4.releaseTempInstance(temp); }
/** * Normalize a Vector4 in-buffer. * * @param buf * the buffer to find the Vector4 within * @param index * the position (in terms of vectors, not floats) of the vector to normalize */ public static void normalizeVector4(final FloatBuffer buf, final int index) { final Vector4 temp = Vector4.fetchTempInstance(); populateFromBuffer(temp, buf, index); temp.normalizeLocal(); setInBuffer(temp, buf, index); Vector4.releaseTempInstance(temp); }
/** * 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); }
/** * 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); }
public Vector3 getNormalizedDeviceCoordinates(final ReadOnlyVector3 worldPosition, Vector3 store) { if (store == null) { store = new Vector3(); } checkModelViewProjection(); final Vector4 position = Vector4.fetchTempInstance(); position.set(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), 1); _modelViewProjection.applyPre(position, position); position.multiplyLocal(1.0 / position.getW()); store.setX(position.getX()); store.setY(position.getY()); store.setZ(position.getZ()); Vector4.releaseTempInstance(position); return store; }
public Vector3 getNormalizedDeviceCoordinates(final ReadOnlyVector3 worldPosition, Vector3 store) { if (store == null) { store = new Vector3(); } checkModelViewProjection(); final Vector4 position = Vector4.fetchTempInstance(); position.set(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), 1); _modelViewProjection.applyPre(position, position); position.multiplyLocal(1.0 / position.getW()); store.setX(position.getX()); store.setY(position.getY()); store.setZ(position.getZ()); Vector4.releaseTempInstance(position); return store; }
Vector4.releaseTempInstance(position);
Vector4.releaseTempInstance(position);
Vector4.releaseTempInstance(pointTop); Vector4.releaseTempInstance(pointFinal); Vector4.releaseTempInstance(pointBottom);
store.setZ(position.getZ()); Vector4.releaseTempInstance(position); return store;
store.setZ(position.getZ()); Vector4.releaseTempInstance(position); return store;
optimalCameraFar = Math.max(-position.getZ(), optimalCameraFar); Vector4.releaseTempInstance(position);
optimalCameraFar = Math.max(-position.getZ(), optimalCameraFar); Vector4.releaseTempInstance(position);
optimalCameraFar = Math.max(-position.getZ(), optimalCameraFar); Vector4.releaseTempInstance(position);
optimalCameraFar = Math.max(-position.getZ(), optimalCameraFar); Vector4.releaseTempInstance(position);
assertEquals(vec1, vec6); assertNotSame(vec1, vec6); Vector4.releaseTempInstance(vec6);