/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation) { return rotation.setFromMatrix(this); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @param normalizeAxes True to normalize the axes, necessary when the matrix might also include scaling. * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation, boolean normalizeAxes) { return rotation.setFromMatrix(normalizeAxes, this); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation) { return rotation.setFromMatrix(this); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @param normalizeAxes True to normalize the axes, necessary when the matrix might also include scaling. * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation, boolean normalizeAxes) { return rotation.setFromMatrix(normalizeAxes, this); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix4 matrix) { return setFromMatrix(false, matrix); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix4 matrix) { return setFromMatrix(false, matrix); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix3 matrix) { return setFromMatrix(false, matrix); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix3 matrix) { return setFromMatrix(false, matrix); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @param normalizeAxes True to normalize the axes, necessary when the matrix might also include scaling. * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation, boolean normalizeAxes) { return rotation.setFromMatrix(normalizeAxes, this); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix3 matrix) { return setFromMatrix(false, matrix); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation) { return rotation.setFromMatrix(this); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @param normalizeAxes True to normalize the axes, necessary when the matrix might also include scaling. * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation, boolean normalizeAxes) { return rotation.setFromMatrix(normalizeAxes, this); }
/** Gets the rotation of this matrix. * @param rotation The {@link Quaternion} to receive the rotation * @return The provided {@link Quaternion} for chaining. */ public Quaternion getRotation (Quaternion rotation) { return rotation.setFromMatrix(this); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix3 matrix) { return setFromMatrix(false, matrix); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix4 matrix) { return setFromMatrix(false, matrix); }
/** Sets the Quaternion from the given rotation matrix, which must not contain scaling. */ public Quaternion setFromMatrix (Matrix4 matrix) { return setFromMatrix(false, matrix); }
public Quaternion calculateQuaternion() { Quaternion quaternion = new Quaternion(); quaternion.setFromMatrix(matrix); return quaternion; }
/** * Set the rotation of the model and collision body for this Steerable, around the Y-axis. * <p> * When orientation is 0, character faces positive X axis. * Rotating [0:PI] makes the character turn to the left from its perspective. * Rotating [0:-PI] turns it right. * * @param orientation */ @Override public void setOrientation(float orientation) { position = getPosition(); BulletSteeringUtils.angleToVector(tmpVec, -orientation); modelTransform.setToLookAt(tmpVec, Constants.V3_UP).setTranslation(position); body.setWorldTransform(modelTransform); currentOrientation.setFromMatrix(modelTransform); }
body.setWorldTransform(modelTransform); targetOrientation.setFromMatrix(true, tmpMatrix.setToLookAt(targetOrientationVector, Constants.V3_UP));