/** * Applies the given scale to this matrix values internally * * @param scale * @return this matrix for chaining. * @throws NullPointerException * if scale is null. */ public Matrix4 scaleLocal(final ReadOnlyVector4 scale) { return scale(scale, this); }
@Test public void testScale() { final Matrix4 mat4A = new Matrix4( // 0.01, 0.1, 0.2, 0.3, // 1.0, 1.1, 1.2, 1.3, // 2.0, 2.1, 2.2, 2.3, // 3.0, 3.1, 3.2, 3.3); final Matrix4 result = mat4A.scale(new Vector4(-1, 2, 3, 4), null); assertEquals(new Matrix4( // 0.01 * -1, 0.1 * 2, 0.2 * 3, 0.3 * 4, // 1.0 * -1, 1.1 * 2, 1.2 * 3, 1.3 * 4, // 2.0 * -1, 2.1 * 2, 2.2 * 3, 2.3 * 4, // 3.0 * -1, 3.1 * 2, 3.2 * 3, 3.3 * 4), result); result.scaleLocal(new Vector4(-1, 0.5, 1 / 3., .25)); assertEquals(mat4A, result); }
/** * Applies the given scale to this matrix values internally * * @param scale * @return this matrix for chaining. * @throws NullPointerException * if scale is null. */ public Matrix4 scaleLocal(final ReadOnlyVector4 scale) { return scale(scale, this); }
workingMat.scale(new Vector4(array[0], array[1], array[2], 1), workingMat); finalMat.multiplyLocal(workingMat); } else if ("matrix".equals(transform.getName())) {
workingMat.scale(new Vector4(array[0], array[1], array[2], 1), workingMat); finalMat.multiplyLocal(workingMat); } else if (type == TransformElementType.Matrix) {