/** Sets the matrix to the given matrix. * * @param matrix The matrix that is to be copied. (The given matrix is not modified) * @return This matrix for the purpose of chaining methods together. */ public Matrix4 set (Matrix4 matrix) { return this.set(matrix.val); }
/** Calculates the local transform based on the translation, scale and rotation * @return the local transform */ public Matrix4 calculateLocalTransform () { if (!isAnimated) localTransform.set(translation, rotation, scale); return localTransform; }
/** For dynamic and static bodies this method is called by bullet once to get the initial state of the body. For kinematic * bodies this method is called on every update, unless the body is deactivated. */ @Override public void getWorldTransform (final Matrix4 worldTrans) { worldTrans.set(transform); }
/** Sets the projection matrix to be used for rendering. Usually this will be set to {@link Camera#combined}. * @param matrix */ public void setProjectionMatrix (Matrix4 matrix) { projectionMatrix.set(matrix); matrixDirty = true; }
/** Construct a matrix from the given translation, rotation and scale. * @param position The translation * @param rotation The rotation, must be normalized * @param scale The scale */ public Matrix4 (Vector3 position, Quaternion rotation, Vector3 scale) { set(position, rotation, scale); }
/** Sets the matrix to the given matrix. * * @param matrix The matrix that is to be copied. (The given matrix is not modified) * @return This matrix for the purpose of chaining methods together. */ public Matrix4 set (Matrix4 matrix) { return this.set(matrix.val); }
/** Sets the matrix to a rotation matrix representing the quaternion. * * @param quaternion The quaternion that is to be used to set this matrix. * @return This matrix for the purpose of chaining methods together. */ public Matrix4 set (Quaternion quaternion) { return set(quaternion.x, quaternion.y, quaternion.z, quaternion.w); }
/** Set this matrix to the specified translation and rotation. * @param position The translation * @param orientation The rotation, must be normalized * @return This matrix for chaining */ public Matrix4 set (Vector3 position, Quaternion orientation) { return set(position.x, position.y, position.z, orientation.x, orientation.y, orientation.z, orientation.w); }
/** 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; }
/** Sets the current transformation to the given one. * @param transform the new transform matrix */ public void setTransform (Matrix4 transform) { this.transform.set(transform); transform.getScale(scale); }
/** Sets the current transformation to the given one. * @param transform the new transform matrix */ public void setTransform (Matrix4 transform) { this.transform.set(transform); transform.getScale(scale); }
/** Sets the current transformation. */ public void setTransform (float x, float y, float z, float qx, float qy, float qz, float qw, float scale) { transform.set(x, y, z, qx, qy, qz, qw, scale, scale, scale); this.scale.set(scale, scale, scale); }
public Renderable set (Renderable renderable) { worldTransform.set(renderable.worldTransform); material = renderable.material; meshPart.set(renderable.meshPart); bones = renderable.bones; environment = renderable.environment; shader = renderable.shader; userData = renderable.userData; return this; } }
/** Sets this matrix to a rotation matrix from the given euler angles. * @param yaw the yaw in degrees * @param pitch the pitch in degrees * @param roll the roll in degrees * @return This matrix */ public Matrix4 setFromEulerAngles (float yaw, float pitch, float roll) { quat.setEulerAngles(yaw, pitch, roll); return set(quat); }
/** Set the shape renderer transformation matrix, often with the result of {@link #computeTransform()}. Note this causes the * shape renderer to be flushed. {@link #resetTransform(ShapeRenderer)} will restore the transform to what it was before this * call. */ protected void applyTransform (ShapeRenderer shapes, Matrix4 transform) { oldTransform.set(shapes.getTransformMatrix()); shapes.setTransformMatrix(transform); }
@Override public void setTransformMatrix (Matrix4 transform) { if (drawing) flush(); transformMatrix.set(transform); if (drawing) setupMatrices(); }
@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 setTransformMatrix (Matrix4 transform) { if (drawing) flush(); transformMatrix.set(transform); if (drawing) setupMatrices(); }
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 setToWorld (Vector3 position, Vector3 forward, Vector3 up) { tmpForward.set(forward).nor(); right.set(tmpForward).crs(up).nor(); tmpUp.set(right).crs(tmpForward).nor(); this.set(right, tmpUp, tmpForward.scl(-1), position); return this; }