Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieali committed Jun 8, 2022
1 parent 00563e1 commit b995e62
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/WorldFacad.js → src/WorldFacade.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const defaultOptions = {
suspendSimulation: false
}

class WorldFacad {
class WorldFacade {
rollCollectionData = {}
rollGroupData = {}
rollDiceData = {}
Expand Down Expand Up @@ -67,7 +67,7 @@ class WorldFacad {
// Load the BabylonJS World
async #loadWorld(){

// set up a promise to be fullfilled when a message comes back from DiceWorld indicating init is complete
// set up a promise to be fulfilled when a message comes back from DiceWorld indicating init is complete
this.#diceWorldPromise = new Promise((resolve, reject) => {
this.#diceWorldResolve = resolve
})
Expand All @@ -78,7 +78,7 @@ class WorldFacad {
}

if ("OffscreenCanvas" in window && "transferControlToOffscreen" in this.canvas && this.config.offscreen) {
// Ok to use offscreen canvas - transfer controll offscreen
// Ok to use offscreen canvas - transfer control offscreen
const WorldOffscreen = await import('./components/world.offscreen').then(module => module.default)
// WorldOffscreen is just a container class that passes all method calls to the Offscreen Canvas worker
this.#DiceWorld = new WorldOffscreen({
Expand All @@ -91,7 +91,7 @@ class WorldFacad {
console.warn("This browser does not support OffscreenCanvas. Using standard canvas fallback.")
this.config.offscreen = false
}
// code splitting out WorldOnscreen. It's esentially the same as offscreenCanvas.worker.js but communicates with the main thread differently
// code splitting out WorldOnscreen. It's essentially the same as offscreenCanvas.worker.js but communicates with the main thread differently
const WorldOnscreen = await import('./components/world.onscreen').then(module => module.default)
this.#DiceWorld = new WorldOnscreen({
canvas: this.canvas,
Expand All @@ -105,7 +105,7 @@ class WorldFacad {
#loadPhysics(){
// initialize physics world in which AmmoJS runs
this.#DicePhysics = new physicsWorker()
// set up a promise to be fullfilled when a message comes back from physics.worker indicating init is complete
// set up a promise to be fulfilled when a message comes back from physics.worker indicating init is complete
this.#dicePhysicsPromise = new Promise((resolve, reject) => {
this.#dicePhysicsResolve = resolve
})
Expand All @@ -130,7 +130,7 @@ class WorldFacad {
// create message channel for the visual world and the physics world to communicate through
this.#DiceWorld.connect(channel.port1)

// create message channel for this WorldFacad class to communicate with physics world
// create message channel for this WorldFacade class to communicate with physics world
this.#DicePhysics.postMessage({
action: "connect"
},[ channel.port2 ])
Expand Down Expand Up @@ -607,7 +607,7 @@ class WorldFacad {
}

// verify that the rollId is unique. If not then increment it by .1
// rollIds become keys in the rollDiceData object, so they must be unique or they will overright another entry
// rollIds become keys in the rollDiceData object, so they must be unique or they will overwrite another entry
const verifyRollId = ( object ) => {
if(object.hasOwnProperty('rollId')){
if(this.rollDiceData.hasOwnProperty(object.rollId)){
Expand Down Expand Up @@ -731,4 +731,4 @@ class Collection{
}
}

export default WorldFacad
export default WorldFacade
2 changes: 1 addition & 1 deletion src/components/Dice.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Dice {
model.freezeWorldMatrix()
model.isPickable = false
model.doNotSyncBoundingInfo = true
// prefix all the meshs ids from this file with the file name so we can find them later e.g.: 'default-dice_d10' and 'default-dice_d10_collider'
// prefix all the meshes ids from this file with the file name so we can find them later e.g.: 'default-dice_d10' and 'default-dice_d10_collider'
// model.id = meshName + '_' + model.id
model.name = meshName + '_' + model.name
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/world.offscreen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import worldWorker from './offscreenCanvas.worker?worker&inline' // using vits.js worker import - this will be compiled away
import worldWorker from './offscreenCanvas.worker?worker&inline' // using vite.js worker import - this will be compiled away

class WorldOffScreen {
initialized = false
Expand Down Expand Up @@ -30,7 +30,7 @@ class WorldOffScreen {

// initialize the babylon scene
async #initScene(config) {
// initalize the offscreen worker
// initialize the offscreen worker
this.#OffscreenWorker.postMessage({
action: "init",
canvas: this.#offscreenCanvas,
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from "./WorldFacad"
export { default } from "./WorldFacade"

0 comments on commit b995e62

Please sign in to comment.