Skip to content

Commit

Permalink
Moon paths
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGough committed Jul 28, 2023
1 parent ad67428 commit 5da4bd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/setup/planetary-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ export class PlanetaryObject {

this.loadTextures(body.textures);

if (type === "planet") {
this.mesh = this.createMesh();

if (this.orbits) {
this.path = createPath(this.distance);
}

this.mesh = this.createMesh();

if (this.atmosphere.map) {
this.mesh.add(this.createAtmosphereMesh());
}
Expand Down Expand Up @@ -148,8 +148,7 @@ export class PlanetaryObject {
}

const sphere = new THREE.Mesh(geometry, material);
sphere.rotation.x += this.tilt;

sphere.rotation.x = this.tilt;
sphere.castShadow = true;
sphere.receiveShadow = true;

Expand Down
2 changes: 1 addition & 1 deletion src/setup/solar-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const createSolarSystem = (
if (object.orbits) {
const parentMesh = solarSystem[object.orbits].mesh;
parentMesh.add(object.mesh);
object.path && scene.add(object.path);
object.path && parentMesh.add(object.path);
}

if (planet.labels) {
Expand Down

0 comments on commit 5da4bd1

Please sign in to comment.