Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions jme3-core/src/main/java/com/jme3/math/FastMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ public static Vector3f cartesianToSpherical(Vector3f cartCoords,
* Z as up) and stores the results in the store var.
*
* @param sphereCoords the input spherical coordinates: x=distance from
* origin, y=longitude in radians, z=latitude in radians (not null,
* origin, y=latitude in radians, z=longitude in radians (not null,
* unaffected)
* @param store storage for the result (modified if not null)
* @return the Cartesian coordinates (either store or a new vector)
Expand All @@ -943,10 +943,10 @@ public static Vector3f sphericalToCartesianZ(Vector3f sphereCoords,
if (store == null) {
store = new Vector3f();
}
store.z = sphereCoords.x * FastMath.sin(sphereCoords.z);
float a = sphereCoords.x * FastMath.cos(sphereCoords.z);
store.x = a * FastMath.cos(sphereCoords.y);
store.y = a * FastMath.sin(sphereCoords.y);
store.y = sphereCoords.x * FastMath.sin(sphereCoords.y);
float a = sphereCoords.x * FastMath.cos(sphereCoords.y);
store.x = a * FastMath.cos(sphereCoords.z);
store.z = a * FastMath.sin(sphereCoords.z);

return store;
}
Expand Down
1 change: 0 additions & 1 deletion jme3-core/src/test/java/com/jme3/math/FastMathTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ public void testCartesianToSpherical() {
assertEquals(in0.z, out0.z, 1e-5f);
}

@Ignore // test fails due to issue #1349
@Test
public void testCartesianZToSpherical() {
final Vector3f cartCoords = new Vector3f(1.1f, 5.8f, 8.1f);
Expand Down