/** Constructs a matrix from the given float array. The array must have at least 9 elements; the first 9 will be copied. * @param values The float array to copy. Remember that this matrix is in <a * href="http://en.wikipedia.org/wiki/Row-major_order#Column-major_order">column major</a> order. (The float array is * not modified.) */ public Matrix3 (float[] values) { this.set(values); }
checkEqual(mat1.set(afn1), new float[] {1, shear.y, 0, shear.x, 1, 0, 0, 0, 1}); mat1.idt().scale(scl).rotate(rot).translate(trn).mul(mat2.set(afn2.setToShearing(shear))); afn1.idt().scale(scl).rotate(rot).translate(trn).shear(shear); checkEqual(mat1, afn1); .preMul(afn2.setToScaling(scl)); checkEqual(mat1, afn1); mat1.set(afn2.setToShearing(shear)).trn(trn).mulLeft(mat2.setToRotation(rot)).mulLeft(mat2.setToScaling(scl)); checkEqual(mat1, afn1);
/** Constructs a matrix from the given float array. The array must have at least 9 elements; the first 9 will be copied. * @param values The float array to copy. Remember that this matrix is in <a * href="http://en.wikipedia.org/wiki/Row-major_order#Column-major_order">column major</a> order. (The float array is * not modified.) */ public Matrix3 (float[] values) { this.set(values); }
public Matrix3 (Matrix3 matrix) { set(matrix); }
public Matrix3 (Matrix3 matrix) { set(matrix); }
private static void checkEqual (Matrix3 matrix, Affine2 affine) { checkEqual(matrix, new Matrix3().set(affine)); }
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, tmpM.set(renderable.worldTransform).inv().transpose()); } };
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, tmpM.set(renderable.worldTransform).inv().transpose()); } };
@Override public void setVertexTransform (Matrix4 transform) { vertexTransformationEnabled = transform != null; if (vertexTransformationEnabled) { positionTransform.set(transform); normalTransform.set(transform).inv().transpose(); } else { positionTransform.idt(); normalTransform.idt(); } }
@Override public void setVertexTransform (Matrix4 transform) { vertexTransformationEnabled = transform != null; if (vertexTransformationEnabled) { positionTransform.set(transform); normalTransform.set(transform).inv().transpose(); } else { positionTransform.idt(); normalTransform.idt(); } }
@Override public void render (Renderable renderable) { Material material = renderable.material; TextureAttribute diffuseTexture = (TextureAttribute)material.get(TextureAttribute.Diffuse); TextureAttribute normalTexture = (TextureAttribute)material.get(TextureAttribute.Normal); TextureAttribute specTexture = (TextureAttribute)material.get(TextureAttribute.Specular); if (diffuseTexture != null) { shaderProgram.setUniformi("u_diffuseTexture", context.textureBinder.bind(diffuseTexture.textureDescription.texture)); } if (normalTexture != null) { shaderProgram.setUniformi("u_normalTexture", context.textureBinder.bind(normalTexture.textureDescription.texture)); } if (specTexture != null) { shaderProgram.setUniformi("u_specularTexture", context.textureBinder.bind(specTexture.textureDescription.texture)); } shaderProgram.setUniformMatrix("u_worldTrans", renderable.worldTransform); shaderProgram.setUniformMatrix("u_normalMatrix", matrix3.set(renderable.worldTransform).inv().transpose()); renderable.meshPart.render(shaderProgram); }
curr1.hasUV = curr1.hasPosition = curr1.hasNormal = true; normalTransform.set(transform);
curr1.hasUV = curr1.hasPosition = curr1.hasNormal = true; normalTransform.set(transform);
/** Constructs a matrix from the given float array. The array must have at least 9 elements; the first 9 will be copied. * @param values The float array to copy. Remember that this matrix is in <a * href="http://en.wikipedia.org/wiki/Row-major_order#Column-major_order">column major</a> order. (The float array is * not modified.) */ public Matrix3 (float[] values) { this.set(values); }
/** Constructs a matrix from the given float array. The array must have at least 9 elements; the first 9 will be copied. * @param values The float array to copy. Remember that this matrix is in <a * href="http://en.wikipedia.org/wiki/Row-major_order#Column-major_order">column major</a> order. (The float array is * not modified.) */ public Matrix3 (float[] values) { this.set(values); }
public Matrix3 (Matrix3 matrix) { set(matrix); }
public Matrix3 (Matrix3 matrix) { set(matrix); }
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, tmpM.set(renderable.worldTransform).inv().transpose()); } };
@Override public void setVertexTransform (Matrix4 transform) { vertexTransformationEnabled = transform != null; if (vertexTransformationEnabled) { positionTransform.set(transform); normalTransform.set(transform).inv().transpose(); } else { positionTransform.idt(); normalTransform.idt(); } }