fix build issues
This commit is contained in:
@@ -93,7 +93,7 @@ export function SlabPanel() {
|
|||||||
setEditingHoleIndex(null)
|
setEditingHoleIndex(null)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[node?.holes, handleUpdate, editingHoleIndex],
|
[node?.holes, handleUpdate, editingHoleIndex, setEditingHoleIndex],
|
||||||
)
|
)
|
||||||
|
|
||||||
// Only show if exactly one slab is selected
|
// Only show if exactly one slab is selected
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export function AudioSettingsDialog() {
|
|||||||
</div>
|
</div>
|
||||||
<Slider
|
<Slider
|
||||||
value={[masterVolume]}
|
value={[masterVolume]}
|
||||||
onValueChange={(value) => setMasterVolume(value[0])}
|
onValueChange={(value) => value[0] !== undefined && setMasterVolume(value[0])}
|
||||||
max={100}
|
max={100}
|
||||||
step={1}
|
step={1}
|
||||||
disabled={muted}
|
disabled={muted}
|
||||||
@@ -49,7 +49,7 @@ export function AudioSettingsDialog() {
|
|||||||
</div>
|
</div>
|
||||||
<Slider
|
<Slider
|
||||||
value={[radioVolume]}
|
value={[radioVolume]}
|
||||||
onValueChange={(value) => setRadioVolume(value[0])}
|
onValueChange={(value) => value[0] !== undefined && setRadioVolume(value[0])}
|
||||||
max={100}
|
max={100}
|
||||||
step={1}
|
step={1}
|
||||||
disabled={muted}
|
disabled={muted}
|
||||||
@@ -64,7 +64,7 @@ export function AudioSettingsDialog() {
|
|||||||
</div>
|
</div>
|
||||||
<Slider
|
<Slider
|
||||||
value={[sfxVolume]}
|
value={[sfxVolume]}
|
||||||
onValueChange={(value) => setSfxVolume(value[0])}
|
onValueChange={(value) => value[0] !== undefined && setSfxVolume(value[0])}
|
||||||
max={100}
|
max={100}
|
||||||
step={1}
|
step={1}
|
||||||
disabled={muted}
|
disabled={muted}
|
||||||
|
|||||||
@@ -468,14 +468,12 @@ export class SpatialGridManager {
|
|||||||
if (slab.polygon.length >= 3 && pointInPolygon(x, z, slab.polygon)) {
|
if (slab.polygon.length >= 3 && pointInPolygon(x, z, slab.polygon)) {
|
||||||
// Check if point is in any hole
|
// Check if point is in any hole
|
||||||
let inHole = false
|
let inHole = false
|
||||||
if (slab.holes && slab.holes.length > 0) {
|
|
||||||
for (const hole of slab.holes) {
|
for (const hole of slab.holes) {
|
||||||
if (hole.length >= 3 && pointInPolygon(x, z, hole)) {
|
if (hole.length >= 3 && pointInPolygon(x, z, hole)) {
|
||||||
inHole = true
|
inHole = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!inHole) {
|
if (!inHole) {
|
||||||
const elevation = slab.elevation ?? 0.05
|
const elevation = slab.elevation ?? 0.05
|
||||||
@@ -508,7 +506,6 @@ export class SpatialGridManager {
|
|||||||
// Check if item is entirely within a hole (if so, ignore this slab)
|
// Check if item is entirely within a hole (if so, ignore this slab)
|
||||||
// We consider it entirely in a hole if the item center is in the hole
|
// We consider it entirely in a hole if the item center is in the hole
|
||||||
let inHole = false
|
let inHole = false
|
||||||
if (slab.holes && slab.holes.length > 0) {
|
|
||||||
const [cx, , cz] = position
|
const [cx, , cz] = position
|
||||||
for (const hole of slab.holes) {
|
for (const hole of slab.holes) {
|
||||||
if (hole.length >= 3 && pointInPolygon(cx, cz, hole)) {
|
if (hole.length >= 3 && pointInPolygon(cx, cz, hole)) {
|
||||||
@@ -516,7 +513,6 @@ export class SpatialGridManager {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!inHole) {
|
if (!inHole) {
|
||||||
const elevation = slab.elevation ?? 0.05
|
const elevation = slab.elevation ?? 0.05
|
||||||
@@ -548,7 +544,6 @@ export class SpatialGridManager {
|
|||||||
if (wallOverlapsPolygon(start, end, slab.polygon)) {
|
if (wallOverlapsPolygon(start, end, slab.polygon)) {
|
||||||
// Check if wall midpoint is in a hole (if so, ignore this slab)
|
// Check if wall midpoint is in a hole (if so, ignore this slab)
|
||||||
let inHole = false
|
let inHole = false
|
||||||
if (slab.holes && slab.holes.length > 0) {
|
|
||||||
const midX = (start[0] + end[0]) / 2
|
const midX = (start[0] + end[0]) / 2
|
||||||
const midZ = (start[1] + end[1]) / 2
|
const midZ = (start[1] + end[1]) / 2
|
||||||
for (const hole of slab.holes) {
|
for (const hole of slab.holes) {
|
||||||
@@ -557,7 +552,6 @@ export class SpatialGridManager {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!inHole) {
|
if (!inHole) {
|
||||||
const elevation = slab.elevation ?? 0.05
|
const elevation = slab.elevation ?? 0.05
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ export function generateSlabGeometry(slabNode: SlabNode): THREE.BufferGeometry {
|
|||||||
shape.closePath()
|
shape.closePath()
|
||||||
|
|
||||||
// Add holes to the shape
|
// Add holes to the shape
|
||||||
if (slabNode.holes && slabNode.holes.length > 0) {
|
|
||||||
for (const holePolygon of slabNode.holes) {
|
for (const holePolygon of slabNode.holes) {
|
||||||
if (holePolygon.length < 3) continue
|
if (holePolygon.length < 3) continue
|
||||||
|
|
||||||
@@ -140,7 +139,6 @@ export function generateSlabGeometry(slabNode: SlabNode): THREE.BufferGeometry {
|
|||||||
|
|
||||||
shape.holes.push(holePath)
|
shape.holes.push(holePath)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Extrude the shape by elevation
|
// Extrude the shape by elevation
|
||||||
const geometry = new THREE.ExtrudeGeometry(shape, {
|
const geometry = new THREE.ExtrudeGeometry(shape, {
|
||||||
|
|||||||
Reference in New Issue
Block a user