modify some things to remove warnings on server and in browser console

This commit is contained in:
2023-05-16 06:39:36 -06:00
parent a9844e6e78
commit f603882d42
6 changed files with 12 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ class World {
const controls = createControls(camera, renderer.domElement); const controls = createControls(camera, renderer.domElement);
// Light Instance, with optional light helper // Light Instance, with optional light helper
const { light, lightHelper } = createLights(color); const { light } = createLights(color);
// Random values for terrain vertices // Random values for terrain vertices
// We could do this on the terrain.js file, // We could do this on the terrain.js file,

View File

@@ -11,7 +11,7 @@ function createCamera() {
// move the camera back so we can view the scene // move the camera back so we can view the scene
camera.position.set(0, 10, 30); camera.position.set(0, 10, 30);
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function
camera.tick = (delta) => {}; camera.tick = () => {};
return camera; return camera;
} }

View File

@@ -6,7 +6,7 @@ function createLights(color) {
light.position.set(0, 30, 30); light.position.set(0, 30, 30);
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function
light.tick = (delta) => {}; light.tick = () => {};
return { light, lightHelper }; return { light, lightHelper };
} }

View File

@@ -1,5 +1,5 @@
import { import {
PlaneBufferGeometry, PlaneGeometry,
MeshStandardMaterial, MeshStandardMaterial,
Mesh, Mesh,
TextureLoader, TextureLoader,
@@ -9,7 +9,7 @@ export default function createTerrain(props) {
const loader = new TextureLoader(); const loader = new TextureLoader();
const height = loader.load("img/textures/height.png"); const height = loader.load("img/textures/height.png");
// w h // w h
const geometry = new PlaneBufferGeometry(150, 150, 64, 64); const geometry = new PlaneGeometry(150, 150, 64, 64);
const material = new MeshStandardMaterial({ const material = new MeshStandardMaterial({
color: props.color, color: props.color,
@@ -35,7 +35,7 @@ export default function createTerrain(props) {
plane.geometry.attributes.position.randomValues = props.randVertexArr; plane.geometry.attributes.position.randomValues = props.randVertexArr;
let frame = 0; let frame = 0;
plane.tick = (delta) => { plane.tick = () => {
frame += 0.01; frame += 0.01;
// destructuring of the random values, the original position and the current vertex position // destructuring of the random values, the original position and the current vertex position
const { array, originalPosition, randomValues } = const { array, originalPosition, randomValues } =

View File

@@ -4,6 +4,7 @@ function createRenderer() {
const renderer = new WebGLRenderer({ antialias: true }); const renderer = new WebGLRenderer({ antialias: true });
// turn on the physically correct lighting model // turn on the physically correct lighting model
// (The browser complains: "THREE.WebGLRenderer: .physicallyCorrectLights has been removed. Set enderer.useLegacyLights instead." However, that changes the lighting in a way that doesn't look better.)
renderer.physicallyCorrectLights = true; renderer.physicallyCorrectLights = true;
return renderer; return renderer;

View File

@@ -7,4 +7,9 @@ module.exports = defineConfig({
topLevelAwait: true, topLevelAwait: true,
}, },
}, },
pwa: {
iconPaths: {
faviconSVG: 'img/icons/safari-pinned-tab.svg',
}
}
}); });