feat: Implement wall asset management features including creation, instances, and rendering; enhance wall properties input validation

This commit is contained in:
2025-06-30 16:21:54 +05:30
parent 943ad3ba49
commit 997775c27e
15 changed files with 313 additions and 47 deletions

View File

@@ -154,7 +154,7 @@ function Wall({ wall }: { readonly wall: Wall }) {
<MeshDiscardMaterial />
{wall.decals.map((decal) => (
<DecalInstance visible={visible} key={decal.decalUuid} decal={decal} />
<DecalInstance zPosition={wall.wallThickness / 2 + 0.001} visible={visible} key={decal.decalUuid} decal={decal} />
))}
</mesh>
</mesh>

View File

@@ -1,6 +1,5 @@
import React, { useEffect, useMemo } from 'react';
import { DoubleSide, RepeatWrapping, Shape, SRGBColorSpace, TextureLoader, Vector2, Vector3 } from 'three';
import { Geometry } from '@react-three/csg';
import { Html, Extrude } from '@react-three/drei';
import { useLoader } from '@react-three/fiber';
import { useSceneContext } from '../../../scene/sceneContext';
@@ -44,13 +43,9 @@ function WallInstances() {
<>
{!toggleView && walls.length > 1 && (
<>
<mesh name='Walls-Group'>
<Geometry useGroups>
{walls.map((wall) => (
<WallInstance key={wall.wallUuid} wall={wall} />
))}
</Geometry>
</mesh>
{walls.map((wall) => (
<WallInstance key={wall.wallUuid} wall={wall} />
))}
<group name='Wall-Floors-Group'>
{rooms.map((room, index) => (