Skip to content

Commit

Permalink
Quaternion: delete 2 deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jan 17, 2024
1 parent 7066fb6 commit 8cd7450
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 81 deletions.
77 changes: 1 addition & 76 deletions src/main/java/com/jme3/math/Quaternion.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2023 jMonkeyEngine
* Copyright (c) 2009-2024 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -606,38 +606,6 @@ public Quaternion fromAxes(Vector3f xAxis, Vector3f yAxis, Vector3f zAxis) {
zAxis.y, xAxis.z, yAxis.z, zAxis.z);
}

/**
* Rotates the argument vector. Despite the name, the current instance is
* unaffected.
*
* <p>The quaternion is assumed to be normalized (norm=1). No error checking
* is performed; the caller must ensure that the norm is approximately equal
* to 1.
*
* <p>Despite the name, the result differs from the mathematical definition
* of vector-quaternion multiplication.
*
* @param v the vector to rotate (not null)
* @return the (modified) vector {@code v}
* @deprecated use {@link
* jme3utilities.math.MyQuaternion#rotate(com.jme3.math.Quaternion,
* com.jme3.math.Vector3f, com.jme3.math.Vector3f)}
*/
@Deprecated
public Vector3f multLocal(Vector3f v) {
float tempX, tempY;
tempX = w * w * v.x + 2 * y * w * v.z - 2 * z * w * v.y + x * x * v.x
+ 2 * y * x * v.y + 2 * z * x * v.z - z * z * v.x - y * y * v.x;
tempY = 2 * x * y * v.x + y * y * v.y + 2 * z * y * v.z + 2 * w * z
* v.x - z * z * v.y + w * w * v.y - 2 * x * w * v.z - x * x
* v.y;
v.z = 2 * x * z * v.x + 2 * y * z * v.y + z * z * v.z - 2 * w * y * v.x
- y * y * v.z + 2 * w * x * v.y - x * x * v.z + w * w * v.z;
v.x = tempX;
v.y = tempY;
return v;
}

/**
* Multiplies by the argument and returns the (modified) current instance.
*
Expand Down Expand Up @@ -682,49 +650,6 @@ public Quaternion multLocal(float qx, float qy, float qz, float qw) {
return this;
}

/**
* Rotates a specified vector and returns the result in another vector. The
* current instance is unaffected.
*
* <p>The quaternion is assumed to be normalized (norm=1). No error checking
* is performed; the caller must ensure that the norm is approximately equal
* to 1.
*
* <p>It is safe for {@code v} and {@code store} to be the same object.
*
* <p>Despite the name, the result differs from the mathematical definition
* of vector-quaternion multiplication.
*
* @param v the vector to rotate (not null, unaffected unless it's
* {@code store})
* @param store storage for the result, or null for a new Vector3f
* @return the rotated vector (either {@code store} or a new Vector3f)
* @deprecated use {@link
* jme3utilities.math.MyQuaternion#rotate(com.jme3.math.Quaternion,
* com.jme3.math.Vector3f, com.jme3.math.Vector3f)}
*/
@Deprecated
public Vector3f mult(Vector3f v, Vector3f store) {
if (store == null) {
store = new Vector3f();
}
if (v.x == 0 && v.y == 0 && v.z == 0) {
store.set(0, 0, 0);
} else {
float vx = v.x, vy = v.y, vz = v.z;
store.x = w * w * vx + 2 * y * w * vz - 2 * z * w * vy + x * x
* vx + 2 * y * x * vy + 2 * z * x * vz - z * z * vx - y
* y * vx;
store.y = 2 * x * y * vx + y * y * vy + 2 * z * y * vz + 2 * w
* z * vx - z * z * vy + w * w * vy - 2 * x * w * vz - x
* x * vy;
store.z = 2 * x * z * vx + 2 * y * z * vy + z * z * vz - 2 * w
* y * vx - y * y * vz + 2 * w * x * vy - x * x * vz + w
* w * vz;
}
return store;
}

/**
* Multiplies by the scalar argument and returns the (modified) current
* instance.
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/jme3utilities/math/MyQuaternion.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2017-2023, Stephen Gold
Copyright (c) 2017-2024, Stephen Gold
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -432,10 +432,8 @@ public static Quaternion pow(
/**
* Rotate the input vector using the specified quaternion.
* <p>
* Unlike {@link com.jme3.math.Quaternion#mult(com.jme3.math.Vector3f,
* com.jme3.math.Vector3f)}, this method doesn't assume the quaternion is
* normalized. Instead, rotation is performed using a normalized version of
* the quaternion.
* This method doesn't assume the quaternion is normalized. Instead,
* rotation is performed using a normalized version of the quaternion.
*
* @param rotation the desired rotation (not null, not zero, unaffected)
* @param input the vector to rotate (not null, finite, unaffected unless
Expand Down

0 comments on commit 8cd7450

Please sign in to comment.