MCPcopy Create free account
hub / github.com/SurceBeats/Atlas / update

Method update

atlas-ui/react/static/js/3DComponents/MoonSystem.tsx:1201–1236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1199 }
1200
1201 public update(): void {
1202 if (!this.moonData) return;
1203
1204 if (this.detectCameraMovement()) {
1205 this.onCameraMovement();
1206 }
1207 this.updateOrbitalLinesFade();
1208
1209 const currentTime = Date.now() / 1000;
1210
1211 if (!isFinite(this.cosmicOriginTime)) {
1212 return;
1213 }
1214
1215 const cosmicTimeElapsed = currentTime - this.cosmicOriginTime + this.timeOffset;
1216
1217 if (!isFinite(cosmicTimeElapsed)) {
1218 return;
1219 }
1220
1221 if (cosmicTimeElapsed < 0) {
1222 return;
1223 }
1224
1225 this.moonData.moons.forEach((moonData, index) => {
1226 if (index < this.moonMeshes.length) {
1227 this.updateMoonPosition(this.moonMeshes[index], moonData, cosmicTimeElapsed, index);
1228
1229 if (Math.floor(cosmicTimeElapsed) % 30 === 0) {
1230 this.updateMoonSurfaceRelaxation(this.moonMeshes[index], moonData);
1231 }
1232 }
1233 });
1234
1235 this.updateLOD();
1236 }
1237
1238 private updateMoonPosition(moonGroup: THREE.Group, moonData: MoonData, elapsedTimeSeconds: number, index: number = 0): void {
1239 if (!isFinite(elapsedTimeSeconds)) {

Callers 11

get_local_ipsMethod · 0.45
animateFunction · 0.45
animateFunction · 0.45
animateFunction · 0.45
animateFunction · 0.45
animateFunction · 0.45
animateFunction · 0.45
UniversalPlanet3DWrapperFunction · 0.45

Calls 6

detectCameraMovementMethod · 0.95
onCameraMovementMethod · 0.95
updateMoonPositionMethod · 0.95
updateLODMethod · 0.95

Tested by

no test coverage detected