Matrix4d.rotateTowards
- Matrix4d rotateTowards(Vector3d direction, Vector3d up, Matrix4d dest)
- Matrix4d rotateTowards(Vector3d direction, Vector3d up)
struct Matrix4d
ref public return
rotateTowards
- Matrix4d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ)
- Matrix4d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Matrix4d dest)
doml matrix_4d Matrix4d
constructorsfunctionsstatic variablesvariables
Apply a model transformation to this matrix for a right-handed coordinate system, that aligns the local <code>+Z</code> axis with <code>direction</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix, then the new matrix will be <code>M * L</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * L * v</code>, the lookat transformation will be applied first! <p> In order to set the matrix to a rotation transformation without post-multiplying it, use {@link #rotationTowards(ref Vector3d, Vector3d) rotationTowards()}. <p> This method is equivalent to calling: <code>mulAffine(new Matrix4d().lookAt(new Vector3d(), new Vector3d(dir).negate(), up).invertAffine())</code>
@see #rotateTowards(double, double, double, double, double, double) @see #rotationTowards(ref Vector3d, Vector3d)
@param direction the direction to orient towards @param up the up vector @return this