/** * FIXME: This seems to have singularity type issues with angle == 0, possibly others such as PI. * @param store * A Quaternion to store our result in. If null, a new one is * created. * @return The store quaternion (or a new Quaternion, if store is null) that * describes a rotation that would point you in the exact opposite * direction of this Quaternion. */ public Quaternion opposite(Quaternion store) { if (store == null) { store = new Quaternion(); } Vector3f axis = new Vector3f(); float angle = toAngleAxis(axis); store.fromAngleAxis(FastMath.PI + angle, axis); return store; }
public void multLocal(Quaternion rotation) { Vector3f axis = new Vector3f(); float angle = rotation.toAngleAxis(axis); Matrix4f matrix4f = new Matrix4f(); matrix4f.fromAngleAxis(angle, axis); multLocal(matrix4f); }
private Quaternion desfase(Quaternion ini, Quaternion end) { Quaternion result = null; Vector3f endAngles = new Vector3f(); end.toAngleAxis(endAngles); Vector3f iniAngles = new Vector3f(); ini.toAngleAxis(iniAngles); Vector3f angles = endAngles.subtract(iniAngles); float[] buffer = new float[3]; result = new Quaternion(angles.toArray(buffer)); return result; }
/** * FIXME: This seems to have singularity type issues with angle == 0, possibly others such as PI. * @param store * A Quaternion to store our result in. If null, a new one is * created. * @return The store quaternion (or a new Quaterion, if store is null) that * describes a rotation that would point you in the exact opposite * direction of this Quaternion. */ public Quaternion opposite(Quaternion store) { if (store == null) { store = new Quaternion(); } Vector3f axis = new Vector3f(); float angle = toAngleAxis(axis); store.fromAngleAxis(FastMath.PI + angle, axis); return store; }
public void multLocal(Quaternion rotation) { Vector3f axis = new Vector3f(); float angle = rotation.toAngleAxis(axis); Matrix4f matrix4f = new Matrix4f(); matrix4f.fromAngleAxis(angle, axis); multLocal(matrix4f); }
/** * FIXME: This seems to have singularity type issues with angle == 0, possibly others such as PI. * @param store * A Quaternion to store our result in. If null, a new one is * created. * @return The store quaternion (or a new Quaternion, if store is null) that * describes a rotation that would point you in the exact opposite * direction of this Quaternion. */ public Quaternion opposite(Quaternion store) { if (store == null) { store = new Quaternion(); } Vector3f axis = new Vector3f(); float angle = toAngleAxis(axis); store.fromAngleAxis(FastMath.PI + angle, axis); return store; }
public void multLocal(Quaternion rotation) { Vector3f axis = new Vector3f(); float angle = rotation.toAngleAxis(axis); Matrix4f matrix4f = new Matrix4f(); matrix4f.fromAngleAxis(angle, axis); multLocal(matrix4f); }