Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BarthPaleologue committed Jan 28, 2024
1 parent 59fe055 commit b8157e7
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/ts/architecture/stellarObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ export interface StellarObject extends CelestialBody {
export interface StellarObjectModel extends CelestialBodyModel {
readonly temperature: number;
readonly color: Color3;
}
}
1 change: 0 additions & 1 deletion src/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ document.addEventListener("keydown", (e) => {

if (e.key === "y") {
if (starSystemView.scene.getActiveController() === shipControls) {

console.log("disembark");

characterController.getTransform().setEnabled(true);
Expand Down
2 changes: 1 addition & 1 deletion src/ts/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Settings = {
export const CollisionMask = {
GROUND: 0b00000001,
SPACESHIP: 0b00000010,
LANDING_PADS: 0b00000100,
LANDING_PADS: 0b00000100
};

const seedableRNG = seededSquirrelNoise(Settings.UNIVERSE_SEED);
Expand Down
8 changes: 1 addition & 7 deletions src/ts/spaceship/shipControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
import { Scene } from "@babylonjs/core/scene";
import { Vector3 } from "@babylonjs/core/Maths/math.vector";
import { LOCAL_DIRECTION } from "../uberCore/localDirections";
import {
getForwardDirection,
getUpwardDirection,
pitch,
roll,
translate
} from "../uberCore/transforms/basicTransform";
import { getForwardDirection, getUpwardDirection, pitch, roll, translate } from "../uberCore/transforms/basicTransform";
import { TransformNode } from "@babylonjs/core/Meshes";
import { Controls } from "../uberCore/controls";
import { Input, InputType } from "../inputs/input";
Expand Down
2 changes: 1 addition & 1 deletion src/ts/spaceship/spaceship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class Spaceship implements Transformable {
this.warpDrive.update(currentForwardSpeed, this.closestObject.distance, this.closestObject.radius, deltaTime);

// the warp throttle goes from 0.1 to 1 smoothly using an inverse function
if(this.warpDrive.isEnabled()) this.warpTunnel.setThrottle(1 - 1 / (1.1 * (1 + 1e-6 * this.warpDrive.getWarpSpeed())));
if (this.warpDrive.isEnabled()) this.warpTunnel.setThrottle(1 - 1 / (1.1 * (1 + 1e-6 * this.warpDrive.getWarpSpeed())));
else this.warpTunnel.setThrottle(0);

for (const thruster of this.mainThrusters) thruster.update();
Expand Down
4 changes: 2 additions & 2 deletions src/ts/starSystem/StarSystemView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export class StarSystemView {

const activeController = this.scene.getActiveController();
let controllerDistanceFactor = 5;
if(firstBody instanceof BlackHole) controllerDistanceFactor = 7;
else if(firstBody instanceof NeutronStar) controllerDistanceFactor = 100_000;
if (firstBody instanceof BlackHole) controllerDistanceFactor = 7;
else if (firstBody instanceof NeutronStar) controllerDistanceFactor = 100_000;
positionNearObjectBrightSide(activeController, firstBody, this.getStarSystem(), controllerDistanceFactor);

this.getStarSystem()
Expand Down
3 changes: 2 additions & 1 deletion src/ts/starSystem/starSystemController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ export class StarSystemController {
this.postProcessManager.addOcean(object as TelluricPlanet, this.stellarObjects);
break;
case PostProcessType.VOLUMETRIC_LIGHT:
if (!(object instanceof Star) && !(object instanceof NeutronStar)) throw new Error("Volumetric light post process can only be added to stars and neutron stars. Source:" + object.name);
if (!(object instanceof Star) && !(object instanceof NeutronStar))
throw new Error("Volumetric light post process can only be added to stars and neutron stars. Source:" + object.name);
this.postProcessManager.addVolumetricLight(object);
break;
case PostProcessType.MANDELBULB:
Expand Down
8 changes: 4 additions & 4 deletions src/ts/starmap/starMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export class StarMap {
default:
throw new Error("Unknown stellar object type!");
}
if(starModel === null) throw new Error("Star model is null!");
if (starModel === null) throw new Error("Star model is null!");

let instance: InstancedMesh | null = null;
let recycled = false;
Expand Down Expand Up @@ -447,11 +447,11 @@ export class StarMap {
text += `Distance: ${distance.toFixed(2)}ly\n`;
}

if(starModel === null) throw new Error("Star model is null!");
if (starModel === null) throw new Error("Star model is null!");

let typeString = "";
if(starModel.bodyType === BODY_TYPE.BLACK_HOLE) typeString = "Black hole";
else if(starModel.bodyType === BODY_TYPE.NEUTRON_STAR) typeString = "Neutron star";
if (starModel.bodyType === BODY_TYPE.BLACK_HOLE) typeString = "Black hole";
else if (starModel.bodyType === BODY_TYPE.NEUTRON_STAR) typeString = "Neutron star";
else typeString = getStellarTypeString(starModel.stellarType);
text += `Type: ${typeString}\n`;

Expand Down
2 changes: 1 addition & 1 deletion src/ts/stellarObjects/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export enum STELLAR_TYPE {
/** 3,500 - 5,000 K */
K,
/** 2,700 - 3,500 K */
M,
M
}

export function getStellarTypeString(type: STELLAR_TYPE): string {
Expand Down
1 change: 0 additions & 1 deletion src/ts/stellarObjects/neutronStar/neutronStar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export class NeutronStar implements StellarObject, Cullable {
return "Neutron Star";
}


getRotationAxis(): Vector3 {
return this.getTransform().up;
}
Expand Down
1 change: 0 additions & 1 deletion src/ts/stellarObjects/neutronStar/neutronStarModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,5 @@ export class NeutronStarModel implements StellarObjectModel {
} else {
this.ringsUniforms = null;
}

}
}
2 changes: 1 addition & 1 deletion src/ts/uberCore/postProcesses/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export enum UniformEnumType {
/**
* An array of Color3. Shader code: vec3[]
*/
Color3Array,
Color3Array
}

export enum SamplerEnumType {
Expand Down
2 changes: 1 addition & 1 deletion src/ts/utils/wheelOfFortune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ export function wheelOfFortune<T>(options: [T, number][], randomValue: number):
if (choice < current) return option;
}
throw new Error("Wheel of fortune failed");
}
}

0 comments on commit b8157e7

Please sign in to comment.