Browse Source

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

kb/add-usage-guide
Trent Larson 2 years ago
parent
commit
f603882d42
  1. 2
      src/components/World/World.js
  2. 2
      src/components/World/components/camera.js
  3. 2
      src/components/World/components/lights.js
  4. 6
      src/components/World/components/objects/terrain.js
  5. 1
      src/components/World/systems/renderer.js
  6. 5
      vue.config.js

2
src/components/World/World.js

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

2
src/components/World/components/camera.js

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

2
src/components/World/components/lights.js

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

6
src/components/World/components/objects/terrain.js

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

1
src/components/World/systems/renderer.js

@ -4,6 +4,7 @@ function createRenderer() {
const renderer = new WebGLRenderer({ antialias: true });
// 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;
return renderer;

5
vue.config.js

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

Loading…
Cancel
Save