diff --git a/data/assets/scene/solarsystem/missions/jwst/point_jwst.asset b/data/assets/scene/solarsystem/missions/jwst/point_jwst.asset index 3f148a78f3..6dca49dff5 100644 --- a/data/assets/scene/solarsystem/missions/jwst/point_jwst.asset +++ b/data/assets/scene/solarsystem/missions/jwst/point_jwst.asset @@ -50,6 +50,8 @@ local point_jwst = { local D0 = math.rad(27.1284) -- Galactic longitude of the equatorial north pole local L0 = math.rad(122.9320) + -- distance = 9.2E15 m (set to size of view sphere) + local distance = 9.2E15 -- (Ra, Dec) -> (a, d) local a = math.rad(ra) @@ -64,9 +66,9 @@ local point_jwst = { -- Convert to cartesian local rGalactic = { - math.cos(b) * math.cos(l), - math.cos(b) * math.sin(l), - math.sin(b) + distance * math.cos(b) * math.cos(l), + distance * math.cos(b) * math.sin(l), + distance * math.sin(b) } return rGalactic @@ -103,11 +105,9 @@ local point_jwst = { end local coordinates = convertRaDec(ra, dec) - local JWSTPosition = openspace.worldPosition('JWSTModel') local JWSTRotation = openspace.worldRotation('JWSTRotation') - openspace.printInfo(JWSTPosition) - openspace.printInfo(JWSTRotation) + local JWSTtoCoord = { coordinates[1] - JWSTPosition[1], coordinates[2] - JWSTPosition[2], @@ -117,11 +117,6 @@ local point_jwst = { local JWSTtoCoordRotated = applyMatrix(JWSTRotation, JWSTtoCoord) local JWSTAngles = calculateJWSTAngles(JWSTtoCoordRotated) - -- Check non 0 - if JWSTAngles[1] == 0 and JWSTAngles[2] == 0 then - return - end - -- Check if the new angle violate the sunshield -- -45 deg to 5 deg is valid in x rotation if JWSTAngles[1] < math.rad(-45) or JWSTAngles[1] > math.rad(5) then