Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an option for chairs to set the player and armour stand to face…
… the correct direction.
- Loading branch information
Showing
4 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
craftbook-sponge/src/test/java/com/sk89q/craftbook/sponge/util/LocationUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.sk89q.craftbook.sponge.util; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import com.flowpowered.math.vector.Vector3d; | ||
import org.junit.Test; | ||
|
||
public class LocationUtilTest { | ||
|
||
@Test | ||
public void testCartesianToEuler() { | ||
Vector3d cartesian = new Vector3d(1.0, 0.0, 0.0); | ||
Vector3d euler = LocationUtil.cartesianToEuler(cartesian); | ||
assertEquals(euler, new Vector3d(-0.0, 270.0, 0.0)); | ||
|
||
cartesian = new Vector3d(1.0, 0.0, 1.0); | ||
euler = LocationUtil.cartesianToEuler(cartesian); | ||
assertEquals(euler, new Vector3d(-0.0, 315.0, 0.0)); | ||
|
||
cartesian = new Vector3d(1.0, 0.0, -1.0); | ||
euler = LocationUtil.cartesianToEuler(cartesian); | ||
assertEquals(euler, new Vector3d(-0.0, 225.0, 0.0)); | ||
|
||
cartesian = new Vector3d(1.0, -1.0, 0.0); | ||
euler = LocationUtil.cartesianToEuler(cartesian); | ||
assertEquals(euler, new Vector3d(45.0, 270.0, 0.0)); | ||
} | ||
} |