refactor: change floor and wall props
This commit is contained in:
BIN
app/src/assets/textures/floor/blue.png
Normal file
BIN
app/src/assets/textures/floor/blue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
BIN
app/src/assets/textures/floor/white1.png
Normal file
BIN
app/src/assets/textures/floor/white1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -2,7 +2,7 @@ import * as THREE from 'three';
|
||||
import * as Types from "../../../../types/world/worldTypes";
|
||||
import * as CONSTANTS from "../../../../types/world/worldConstants";
|
||||
|
||||
import texturePath from "../../../../assets/textures/floor/white.png";
|
||||
import texturePath from "../../../../assets/textures/floor/white1.png";
|
||||
import texturePathDark from "../../../../assets/textures/floor/black.png";
|
||||
|
||||
// Cache for materials
|
||||
|
||||
@@ -3,6 +3,9 @@ import * as turf from '@turf/turf';
|
||||
import * as CONSTANTS from '../../../../types/world/worldConstants';
|
||||
import * as Types from "../../../../types/world/worldTypes";
|
||||
|
||||
// temp
|
||||
import blueFloorImage from "../../../../assets/textures/floor/blue.png"
|
||||
|
||||
function loadOnlyFloors(
|
||||
floorGroup: Types.RefGroup,
|
||||
linesByLayer: any,
|
||||
@@ -160,18 +163,22 @@ function loadOnlyFloors(
|
||||
shape.closePath();
|
||||
|
||||
const extrudeSettings = {
|
||||
depth: CONSTANTS.floorConfig.height,
|
||||
depth: 0.3,
|
||||
bevelEnabled: false
|
||||
};
|
||||
|
||||
const texture = new THREE.TextureLoader().load(blueFloorImage);
|
||||
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
||||
texture.colorSpace = THREE.SRGBColorSpace;
|
||||
|
||||
const geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
|
||||
const material = new THREE.MeshStandardMaterial({ color: CONSTANTS.floorConfig.defaultColor, side: THREE.DoubleSide });
|
||||
const material = new THREE.MeshStandardMaterial({ color: CONSTANTS.floorConfig.defaultColor, side: THREE.DoubleSide, map: texture });
|
||||
const mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
|
||||
mesh.position.y = (floor[0][0][2] - 1) * CONSTANTS.wallConfig.height;
|
||||
mesh.position.y = (floor[0][0][2] - 0.99) * CONSTANTS.wallConfig.height;
|
||||
mesh.rotateX(Math.PI / 2);
|
||||
mesh.name = `Only_Floor_Line_${floor[0][0][2]}`;
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ export const lineConfig: LineConfig = {
|
||||
|
||||
export const wallConfig: WallConfig = {
|
||||
defaultColor: "#f2f2f2", // Default color of the walls
|
||||
height: 7, // Height of the walls
|
||||
height: 7.5, // Height of the walls
|
||||
width: 0.05, // Width of the walls
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user