From 5862a965bf04c6fe2b5b01cd9f1ad637419c10ee Mon Sep 17 00:00:00 2001 From: Florian Mauracher Date: Tue, 4 Feb 2025 15:18:31 +0100 Subject: [PATCH] Add poc sat model rotation --- src/modules/SatelliteComponentCollection.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/SatelliteComponentCollection.js b/src/modules/SatelliteComponentCollection.js index c72dab8d..48b275ff 100644 --- a/src/modules/SatelliteComponentCollection.js +++ b/src/modules/SatelliteComponentCollection.js @@ -133,6 +133,17 @@ export class SatelliteComponentCollection extends CesiumComponentCollection { const hpr = new Cesium.HeadingPitchRoll(0, Cesium.Math.toRadians(180), 0); return Cesium.Transforms.headingPitchRollQuaternion(position, hpr); }, false); + } else if (type === "3D model") { + component.position = fixed; + // Add a constant 2deg/s orientation to the model + console.log("3D Model", component.orientation); + component.orientation = new Cesium.CallbackProperty((time) => { + const position = this.props.position(time); + // ADCS frame -z, -x, y + //const hpr = new Cesium.HeadingPitchRoll(0, 0, -Cesium.Math.toRadians(2) * time.secondsOfDay); + const hpr = new Cesium.HeadingPitchRoll(0, -Cesium.Math.toRadians(30) * time.secondsOfDay, 0); + return Cesium.Transforms.headingPitchRollQuaternion(position, hpr); + }, false); } else { component.position = fixed; component.orientation = new Cesium.VelocityOrientationProperty(fixed);