refactor: change floor and wall props

This commit is contained in:
2025-07-01 13:01:03 +05:30
parent 0c8d822dc5
commit e3d13be8dd
6 changed files with 12 additions and 5 deletions

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -2,7 +2,7 @@ import * as THREE from 'three';
import * as Types from "../../../../types/world/worldTypes"; import * as Types from "../../../../types/world/worldTypes";
import * as CONSTANTS from "../../../../types/world/worldConstants"; 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"; import texturePathDark from "../../../../assets/textures/floor/black.png";
// Cache for materials // Cache for materials

View File

@@ -3,6 +3,9 @@ import * as turf from '@turf/turf';
import * as CONSTANTS from '../../../../types/world/worldConstants'; import * as CONSTANTS from '../../../../types/world/worldConstants';
import * as Types from "../../../../types/world/worldTypes"; import * as Types from "../../../../types/world/worldTypes";
// temp
import blueFloorImage from "../../../../assets/textures/floor/blue.png"
function loadOnlyFloors( function loadOnlyFloors(
floorGroup: Types.RefGroup, floorGroup: Types.RefGroup,
linesByLayer: any, linesByLayer: any,
@@ -160,18 +163,22 @@ function loadOnlyFloors(
shape.closePath(); shape.closePath();
const extrudeSettings = { const extrudeSettings = {
depth: CONSTANTS.floorConfig.height, depth: 0.3,
bevelEnabled: false 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 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); const mesh = new THREE.Mesh(geometry, material);
mesh.castShadow = true; mesh.castShadow = true;
mesh.receiveShadow = 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.rotateX(Math.PI / 2);
mesh.name = `Only_Floor_Line_${floor[0][0][2]}`; mesh.name = `Only_Floor_Line_${floor[0][0][2]}`;

View File

@@ -331,7 +331,7 @@ export const lineConfig: LineConfig = {
export const wallConfig: WallConfig = { export const wallConfig: WallConfig = {
defaultColor: "#f2f2f2", // Default color of the walls 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 width: 0.05, // Width of the walls
}; };