/** Postmultiplies this matrix with the given matrix, storing the result in this matrix. For example: * * <pre> * A.mul(B) results in A := AB. * </pre> * * @param matrix The other matrix to multiply by. * @return This matrix for the purpose of chaining operations together. */ public Matrix4 mul (Matrix4 matrix) { mul(val, matrix.val); return this; }
/** Postmultiplies the current transformation with the given matrix. */ public void mul (Matrix4 transform) { this.transform.mul(transform); this.transform.getScale(scale); }
/** Postmultiplies this matrix with a (counter-clockwise) rotation matrix. Postmultiplication is also used by OpenGL ES' 1.x * glTranslate/glRotate/glScale. * * @param rotation * @return This matrix for the purpose of chaining methods together. */ public Matrix4 rotate (Quaternion rotation) { rotation.toMatrix(tmp); mul(val, tmp); return this; }
/** Postmultiplies this matrix with a (counter-clockwise) rotation matrix. Postmultiplication is also used by OpenGL ES' 1.x * glTranslate/glRotate/glScale. * * @param rotation * @return This matrix for the purpose of chaining methods together. */ public Matrix4 rotate (Quaternion rotation) { rotation.toMatrix(tmp); mul(val, tmp); return this; }
/** Postmultiplies the current transformation with the given matrix. */ public void mul (Matrix4 transform) { this.transform.mul(transform); this.transform.getScale(scale); }
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, temp.set(shader.camera.view).mul(renderable.worldTransform)); } };
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, temp.set(shader.camera.combined).mul(renderable.worldTransform)); } };
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, temp.set(shader.camera.view).mul(renderable.worldTransform)); } };
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, temp.set(shader.camera.view).mul(renderable.worldTransform)); } };
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, temp.set(shader.camera.view).mul(renderable.worldTransform)); } };
@Override public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) { shader.set(inputID, temp.set(shader.camera.combined).mul(renderable.worldTransform)); } };
/** Calculates the world transform; the product of local transform and the parent's world transform. * @return the world transform */ public Matrix4 calculateWorldTransform () { if (inheritTransform && parent != null) globalTransform.set(parent.globalTransform).mul(localTransform); else globalTransform.set(localTransform); return globalTransform; }
public Renderable getRenderable (final Renderable out, final Node node, final NodePart nodePart) { nodePart.setRenderable(out); if (nodePart.bones == null && transform != null) out.worldTransform.set(transform).mul(node.globalTransform); else if (transform != null) out.worldTransform.set(transform); else out.worldTransform.idt(); out.userData = userData; return out; }
/** Sets this matrix to a look at matrix with the given position, target and up vector. * * @param position the position * @param target the target * @param up the up vector * @return This matrix */ public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(-position.x, -position.y, -position.z)); return this; }
public Renderable getRenderable (final Renderable out, final Node node, final NodePart nodePart) { nodePart.setRenderable(out); if (nodePart.bones == null && transform != null) out.worldTransform.set(transform).mul(node.globalTransform); else if (transform != null) out.worldTransform.set(transform); else out.worldTransform.idt(); out.userData = userData; return out; }
/** Sets this matrix to a look at matrix with the given position, target and up vector. * * @param position the position * @param target the target * @param up the up vector * @return This matrix */ public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(-position.x, -position.y, -position.z)); return this; }
@Override public boolean act (float delta) { emitter.getTransform(tmpMatrix); tmpQuaternion.set(axis, angle*delta).toMatrix(tmpMatrix4.val); tmpMatrix4.mul(tmpMatrix); emitter.setTransform(tmpMatrix4); return false; } }
private void setupMatrices () { combinedMatrix.set(projectionMatrix).mul(transformMatrix); if (customShader != null) { customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); } else { shader.setUniformMatrix("u_projTrans", combinedMatrix); shader.setUniformi("u_texture", 0); } }
private void setupMatrices () { combinedMatrix.set(projectionMatrix).mul(transformMatrix); if (customShader != null) { customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); } else { shader.setUniformMatrix("u_projTrans", combinedMatrix); shader.setUniformi("u_texture", 0); } }
public Matrix4 calculateParallaxMatrix (float parallaxX, float parallaxY) { update(); tmp.set(position); tmp.x *= parallaxX; tmp.y *= parallaxY; parallaxView.setToLookAt(tmp, tmp2.set(tmp).add(direction), up); parallaxCombined.set(projection); Matrix4.mul(parallaxCombined.val, parallaxView.val); return parallaxCombined; } }