/** * Sets this to a matrix that first rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation) { return setToRotation(rotation).setTranslation(translation); }
/** * Sets this to a matrix that first rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation) { return setToRotation(rotation).setTranslation(translation); }
/** * Sets this to a rotation matrix. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToRotation (float angle, IVector3 axis) { return setToRotation(angle, axis.x(), axis.y(), axis.z()); }
/** * Sets this to a matrix that first scales, then rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation, float scale) { return setToRotation(rotation).set(m00 * scale, m10 * scale, translation.x(), m01 * scale, m11 * scale, translation.y(), 0f, 0f, 1f); }
/** * Sets this to a matrix that first scales, then rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation, float scale) { return setToRotation(rotation).set(m00 * scale, m10 * scale, translation.x(), m01 * scale, m11 * scale, translation.y(), 0f, 0f, 1f); }
/** * Sets this to a rotation matrix. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToRotation (float angle, IVector3 axis) { return setToRotation(angle, axis.x(), axis.y(), axis.z()); }
/** * Sets this to a rotation matrix that rotates one vector onto another. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToRotation (IVector3 from, IVector3 to) { float angle = from.angle(to); return (angle < 0.0001f) ? setToIdentity() : setToRotation(angle, from.cross(to).normalizeLocal()); }
/** * Sets this to a rotation matrix that rotates one vector onto another. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToRotation (IVector3 from, IVector3 to) { float angle = from.angle(to); return (angle < 0.0001f) ? setToIdentity() : setToRotation(angle, from.cross(to).normalizeLocal()); }
/** * Sets this to a matrix that first scales, then rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation, IVector scale) { float sx = scale.x(), sy = scale.y(); return setToRotation(rotation).set(m00 * sx, m10 * sy, translation.x(), m01 * sx, m11 * sy, translation.y(), 0f, 0f, 1f); }
/** * Sets this to a matrix that first scales, then rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation, IVector scale) { float sx = scale.x(), sy = scale.y(); return setToRotation(rotation).set(m00 * sx, m10 * sy, translation.x(), m01 * sx, m11 * sy, translation.y(), 0f, 0f, 1f); }