Refactor builder store and related components: update DecalInstance to manage selectedFloor state, enhance FloorInstance with improved material handling and texture application, and modify FloorGroup to remove unnecessary console log. Update Wall component for better shadow handling and adjust useBuilderStore to change default material values.
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
import * as THREE from 'three';
|
||||
import { Base } from '@react-three/csg';
|
||||
import { useMemo, useRef, useState } from 'react';
|
||||
import { Decal, MeshDiscardMaterial } from '@react-three/drei';
|
||||
import { MeshDiscardMaterial } from '@react-three/drei';
|
||||
import { useFrame, useThree } from '@react-three/fiber';
|
||||
|
||||
import defaultMaterial from '../../../../../assets/textures/floor/wall-tex.png';
|
||||
import material1 from '../../../../../assets/textures/floor/factory wall texture.jpg';
|
||||
|
||||
import useModuleStore from '../../../../../store/useModuleStore';
|
||||
import { useSceneContext } from '../../../../scene/sceneContext';
|
||||
import { useWallClassification } from './helpers/useWallClassification';
|
||||
import { useToggleView, useWallVisibility } from '../../../../../store/builder/store';
|
||||
import { useBuilderStore } from '../../../../../store/builder/useBuilderStore';
|
||||
import * as Constants from '../../../../../types/world/worldConstants';
|
||||
|
||||
import DecalInstance from '../../../Decal/decalInstance';
|
||||
|
||||
import defaultMaterial from '../../../../../assets/textures/floor/wall-tex.png';
|
||||
import material1 from '../../../../../assets/textures/floor/factory wall texture.jpg';
|
||||
|
||||
|
||||
function Wall({ wall }: { readonly wall: Wall }) {
|
||||
const { wallStore } = useSceneContext();
|
||||
const { walls, addDecal } = wallStore();
|
||||
@@ -116,6 +117,7 @@ function Wall({ wall }: { readonly wall: Wall }) {
|
||||
</Base>
|
||||
<mesh
|
||||
castShadow
|
||||
receiveShadow
|
||||
geometry={geometry}
|
||||
position={[centerX, centerY, centerZ]}
|
||||
rotation={[0, -angle, 0]}
|
||||
|
||||
Reference in New Issue
Block a user