Skip to content

Commit

Permalink
rename to PlanetTech
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmyers8 committed Apr 3, 2024
1 parent cee23a7 commit 180675f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export {QuadTrees} from './src/engine/quadtree.js'
export {Planet} from './src/celestialBodies/planet.js';
export {Moon} from './src/celestialBodies/moon.js';
export {Space} from './src/postProcessing/space.js';
export {CelestialBodies,container,CelestialContainer} from './src/celestialBodies/celestialbodies.js';
export {CelestialBodies} from './src/celestialBodies/celestialbodies.js';
export {frontsetData,backsetData,rightsetData,leftsetData,topsetData,bottomsetData} from './src/engine/quadTreeFunctions.js'
37 changes: 0 additions & 37 deletions src/celestialBodies/celestialbodies.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,6 @@ import * as NODE from 'three/nodes';
import * as THREE from 'three';
import {Sphere} from '../sphere/sphere.js';

export class CelestialContainer {
constructor(){
this.bodies = {}
}

add(body){
this.bodies[body.name] = body
}

onEachBody(callBack){
for (const [key, value] of Object.entries(this.bodies)) {
callBack(key, value)
}
}

/* will break if encounters a nested point */
update(player){
this.onEachBody((name,body)=>{
if (body.orbits===undefined ||body.orbits.length===0)
throw new Error(`no orbits declared for ${name}`)

let lastOrbit = body.orbits[body.orbits.length-1]
let containspoint = lastOrbit.containsPoint(player.position)
if(containspoint){
/*dPlanet .subVectors(player, new THREE.Vector3(...body.metaData().center) );
dPlanet_ = dPlanet.length();
d = ( dPlanet_ - body.metaData().radius * 1.0 );
console.log(d)*/
//body.update(player)
}
})
}
}

export const container = new CelestialContainer()

export class CelestialBodies extends Sphere{
constructor(params,name,type){
super(
Expand All @@ -58,7 +22,6 @@ export class CelestialBodies extends Sphere{
this.params = params
this.type = type
this.name = name ? name : crypto.randomUUID()
container.add(this)
}

textuers(N,D,isTiles=false){
Expand Down

0 comments on commit 180675f

Please sign in to comment.