From 8cd745092fa10c1526faf495ec0aff7222d4ecc7 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Tue, 16 Jan 2024 16:20:40 -0800 Subject: [PATCH] Quaternion: delete 2 deprecated methods --- src/main/java/com/jme3/math/Quaternion.java | 77 +------------------ .../java/jme3utilities/math/MyQuaternion.java | 8 +- 2 files changed, 4 insertions(+), 81 deletions(-) diff --git a/src/main/java/com/jme3/math/Quaternion.java b/src/main/java/com/jme3/math/Quaternion.java index 290c7f7a..9b519d69 100644 --- a/src/main/java/com/jme3/math/Quaternion.java +++ b/src/main/java/com/jme3/math/Quaternion.java @@ -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 @@ -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. - * - *

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. - * - *

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. * @@ -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. - * - *

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. - * - *

It is safe for {@code v} and {@code store} to be the same object. - * - *

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. diff --git a/src/main/java/jme3utilities/math/MyQuaternion.java b/src/main/java/jme3utilities/math/MyQuaternion.java index 5cf23600..e595ef3e 100644 --- a/src/main/java/jme3utilities/math/MyQuaternion.java +++ b/src/main/java/jme3utilities/math/MyQuaternion.java @@ -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 @@ -432,10 +432,8 @@ public static Quaternion pow( /** * Rotate the input vector using the specified quaternion. *

- * 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