Minor fixes
This commit is contained in:
parent
ed43c9ea5c
commit
612f8a223e
4
index.js
4
index.js
@ -377,8 +377,6 @@ async function main() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const worldGl = await initWorldGl(gl);
|
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
projMatrix: se3.perspective(Math.PI / 3, canvas.clientWidth / canvas.clientHeight, 0.1, 100.0),
|
projMatrix: se3.perspective(Math.PI / 3, canvas.clientWidth / canvas.clientHeight, 0.1, 100.0),
|
||||||
camera: {
|
camera: {
|
||||||
@ -392,7 +390,7 @@ async function main() {
|
|||||||
flying: false,
|
flying: false,
|
||||||
isOnGround: false,
|
isOnGround: false,
|
||||||
world: makeWorld(),
|
world: makeWorld(),
|
||||||
worldGl,
|
worldGl: await initWorldGl(gl),
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelector('#lightx').oninput = e => {
|
document.querySelector('#lightx').oninput = e => {
|
||||||
|
10
world.js
10
world.js
@ -98,7 +98,7 @@ export function blockLookup(world, x, y, z) {
|
|||||||
if (chunk === undefined) {
|
if (chunk === undefined) {
|
||||||
return {
|
return {
|
||||||
type: BlockType.STONE,
|
type: BlockType.STONE,
|
||||||
x, y, z,
|
centerPosition: [x, y, z],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,9 +108,11 @@ export function blockLookup(world, x, y, z) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
type: chunk.data[256 * (16*i + j) + k],
|
type: chunk.data[256 * (16*i + j) + k],
|
||||||
x: j,
|
centerPosition: [
|
||||||
y: k,
|
Math.floor(midx),
|
||||||
z: i,
|
k,
|
||||||
|
Math.floor(midz),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user