Fix typos
This commit is contained in:
parent
0039e746d8
commit
32d86f31ba
|
@ -240,7 +240,7 @@ class SocketClient {
|
|||
}
|
||||
} catch (err) {
|
||||
console.log(
|
||||
`An error occured while parsing websocket message ${message}`,
|
||||
`An error occurred while parsing websocket message ${message}`,
|
||||
err,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@ class Chunk {
|
|||
// if chunk receives updates via websocket
|
||||
recUpdates = false;
|
||||
// timestamp of last touch,
|
||||
// mustbe regularly updated for GC,
|
||||
// must be regularly updated for GC,
|
||||
// either by touch() or by setting directly
|
||||
timestamp;
|
||||
// coordiantes
|
||||
// coordinates
|
||||
z;
|
||||
i;
|
||||
j;
|
||||
|
|
|
@ -5,7 +5,7 @@ import Chunk from './Chunk';
|
|||
class Chunk2D extends Chunk {
|
||||
// HTMLCanvasElement of chunk
|
||||
image;
|
||||
// boolean if chunk loeaded (request done)
|
||||
// boolean if chunk loaded (request done)
|
||||
ready;
|
||||
// boolean if chunk is empty
|
||||
isEmpty;
|
||||
|
|
|
@ -116,7 +116,7 @@ class Chunk3D extends Chunk {
|
|||
}
|
||||
|
||||
/*
|
||||
// Test Sin encironment creation for load tests
|
||||
// Test Sin environment creation for load tests
|
||||
async generateSin() {
|
||||
let cnt = 0;
|
||||
this.buffer = new Uint8Array(THREE_TILE_SIZE * THREE_TILE_SIZE * THREE_CANVAS_HEIGHT);
|
||||
|
@ -156,13 +156,13 @@ class Chunk3D extends Chunk {
|
|||
let faceCnt = 0;
|
||||
for (let z = THREE_TILE_SIZE - 1; z >= 0; --z) {
|
||||
for (let x = THREE_TILE_SIZE - 1; x >= 0; --x) {
|
||||
let heighestPixel = 0;
|
||||
let highestPixel = 0;
|
||||
const startOffset = x + z * THREE_TILE_SIZE;
|
||||
let u = startOffset;
|
||||
for (let y = 0; y < THREE_CANVAS_HEIGHT; ++y) {
|
||||
if (buffer[u] !== 0) {
|
||||
// heighest pixel fo x,z in heightmap
|
||||
heighestPixel = y;
|
||||
// highest pixel fo x,z in heightmap
|
||||
highestPixel = y;
|
||||
// number of faces to render
|
||||
if (x === 0
|
||||
|| buffer[u - 1] === 0) {
|
||||
|
@ -191,11 +191,11 @@ class Chunk3D extends Chunk {
|
|||
}
|
||||
u += rowVolume;
|
||||
}
|
||||
heightMap[startOffset] = heighestPixel;
|
||||
if (heighestPixel > totalHeight) {
|
||||
heightMap[startOffset] = highestPixel;
|
||||
if (highestPixel > totalHeight) {
|
||||
// last total pixel
|
||||
totalHeight = heighestPixel;
|
||||
lastPixel = Chunk3D.getOffsetOfVoxel(x, heighestPixel, z);
|
||||
totalHeight = highestPixel;
|
||||
lastPixel = Chunk3D.getOffsetOfVoxel(x, highestPixel, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ class Chunk3D extends Chunk {
|
|||
const colors = new Uint8Array(faceCnt * 4 * 3);
|
||||
const indices = new Uint32Array(faceCnt * 6);
|
||||
const { rgb } = this.palette;
|
||||
// just render faces that do not have an adjescent voxel
|
||||
// just render faces that do not have an adjacent voxel
|
||||
for (let z = 0; z < THREE_TILE_SIZE; ++z) {
|
||||
for (let x = 0; x < THREE_TILE_SIZE; ++x) {
|
||||
const startOffset = x + z * THREE_TILE_SIZE;
|
||||
|
|
|
@ -56,7 +56,7 @@ class ChunkLoader {
|
|||
|
||||
cset(key, chunk) {
|
||||
/*
|
||||
* chunks are not neccessarily fully loaded here,
|
||||
* chunks are not necessarily fully loaded here,
|
||||
* but they are in bcRecChunk
|
||||
*/
|
||||
this.#chunks.set(key, chunk);
|
||||
|
|
|
@ -404,7 +404,7 @@ class Renderer2D extends Renderer {
|
|||
|
||||
|
||||
// keep in mind that everything we got here gets executed 60 times per second
|
||||
// avoiding unneccessary stuff is important
|
||||
// avoiding unnecessary stuff is important
|
||||
renderMain(
|
||||
state,
|
||||
) {
|
||||
|
@ -620,7 +620,7 @@ class Renderer2D extends Renderer {
|
|||
} else {
|
||||
context.fillRect(x, y, TILE_SIZE, TILE_SIZE);
|
||||
}
|
||||
// incremential chunks
|
||||
// incremental chunks
|
||||
if (historicalTime === '0000') continue;
|
||||
chunk = this.chunkLoader
|
||||
.getHistoricalChunk(cx, cy, true, historicalDate, historicalTime);
|
||||
|
@ -655,7 +655,7 @@ class Renderer2D extends Renderer {
|
|||
|
||||
|
||||
// keep in mind that everything we got here gets executed 60 times per second
|
||||
// avoiding unneccessary stuff is important
|
||||
// avoiding unnecessary stuff is important
|
||||
renderHistorical(
|
||||
state,
|
||||
) {
|
||||
|
|
|
@ -495,7 +495,7 @@ class Renderer3D extends Renderer {
|
|||
|
||||
switch (multitap) {
|
||||
case 1: {
|
||||
// singel tap
|
||||
// single tap
|
||||
// Place Voxel
|
||||
if (this.rollOverMesh.position.y < 0) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user