|
|
@ -38,21 +38,8 @@ class World { |
|
|
|
// Light Instance, with optional light helper
|
|
|
|
const { light } = createLights(color); |
|
|
|
|
|
|
|
// Random values for terrain vertices
|
|
|
|
// We could do this on the terrain.js file,
|
|
|
|
// but if we want to have a single random
|
|
|
|
// number array for more than one terrain
|
|
|
|
// instance, then we would be in trouble.
|
|
|
|
const randomVals = []; |
|
|
|
for (let i = 0; i < 12675; i++) { |
|
|
|
randomVals.push(Math.random() - 0.5); |
|
|
|
} |
|
|
|
|
|
|
|
// Terrain Instance
|
|
|
|
const terrain = createTerrain({ |
|
|
|
color: color, |
|
|
|
randVertexArr: randomVals, |
|
|
|
}); |
|
|
|
const terrain = createTerrain({ color: color }); |
|
|
|
|
|
|
|
loop.updatables.push(controls); |
|
|
|
loop.updatables.push(light); |
|
|
|