Skip to content

Commit

Permalink
Fixed Roll/Pitch/Yaw Gimbal Lock
Browse files Browse the repository at this point in the history
  • Loading branch information
TechTastic committed Nov 22, 2024
1 parent 9121565 commit 418a8a8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ open class ShipAPI(val ship: ServerShip, val level: ServerLevel) : ILuaAPI {

@LuaFunction
fun getRoll(): Double =
this.ship.transform.shipToWorldRotation.getEulerAnglesXYZ(Vector3d()).x
this.ship.transform.shipToWorldRotation.getEulerAnglesZYX(Vector3d()).x

@LuaFunction
fun getYaw(): Double =
this.ship.transform.shipToWorldRotation.getEulerAnglesXYZ(Vector3d()).y
this.ship.transform.shipToWorldRotation.getEulerAnglesZXY(Vector3d()).y

@LuaFunction
fun getPitch(): Double =
this.ship.transform.shipToWorldRotation.getEulerAnglesXYZ(Vector3d()).z
this.ship.transform.shipToWorldRotation.getEulerAnglesYXZ(Vector3d()).z

@LuaFunction
fun getScale(): Map<String, Double> =
Expand Down

0 comments on commit 418a8a8

Please sign in to comment.