1
0
star/solar/js/animation.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-04-27 09:21:41 +00:00
function remain(objKey) {
if (celestialBodies[objKey].parent == null)
return true;
if ((calculateParams[celestialBodies[objKey].parent.name] && celestialBodies[objKey].parent.name != "Sun") ||
calculateParams[objKey])
return true;
return false;
}
function render() {
for (var objKey in celestialBodies) {
if (firstflag || remain(objKey)) {
celestialBodies[objKey].update(globalTime.getRelative());
if (orbitParams[objKey]) {
scene.add(orbitDraw[objKey]);
} else {
scene.remove(orbitDraw[objKey]);
}
}
}
if (firstflag) {
$(function () {
setTimeout(function () {
$("#prompt").fadeOut(500);
container.appendChild(stats.domElement);
container.appendChild(renderer.domElement);
gui.open();
}, 2000);
});
}
firstflag = false;
if (needSet) {
renderCamera.setCamera();
}
renderer.render(scene, renderCamera.camera);
}