|
|
@ -1062,7 +1062,10 @@ public final class Quaternion implements Savable, Cloneable { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <code>normalize</code> normalizes the current <code>Quaternion</code> |
|
|
|
* <code>normalize</code> normalizes the current <code>Quaternion</code> |
|
|
|
|
|
|
|
* @deprecated The naming of this method doesn't follow convention. |
|
|
|
|
|
|
|
* Please use {@link Quaternion#normalizeLocal() } instead. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Deprecated |
|
|
|
public void normalize() { |
|
|
|
public void normalize() { |
|
|
|
float n = FastMath.invSqrt(norm()); |
|
|
|
float n = FastMath.invSqrt(norm()); |
|
|
|
x *= n; |
|
|
|
x *= n; |
|
|
@ -1071,6 +1074,17 @@ public final class Quaternion implements Savable, Cloneable { |
|
|
|
w *= n; |
|
|
|
w *= n; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* <code>normalize</code> normalizes the current <code>Quaternion</code> |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void normalizeLocal(){ |
|
|
|
|
|
|
|
float n = FastMath.invSqrt(norm()); |
|
|
|
|
|
|
|
x *= n; |
|
|
|
|
|
|
|
y *= n; |
|
|
|
|
|
|
|
z *= n; |
|
|
|
|
|
|
|
w *= n; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <code>inverse</code> returns the inverse of this quaternion as a new |
|
|
|
* <code>inverse</code> returns the inverse of this quaternion as a new |
|
|
|
* quaternion. If this quaternion does not have an inverse (if its normal is |
|
|
|
* quaternion. If this quaternion does not have an inverse (if its normal is |
|
|
|