can place draft
This commit is contained in:
@@ -70,12 +70,6 @@ export class SpatialGridManager {
|
||||
item.asset.dimensions,
|
||||
item.rotation,
|
||||
);
|
||||
console.log(
|
||||
"inserting floor item",
|
||||
item.id,
|
||||
item.position,
|
||||
item.asset.dimensions,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,13 +135,7 @@ export class SpatialGridManager {
|
||||
ignoreIds?: string[],
|
||||
) {
|
||||
const grid = this.getFloorGrid(levelId);
|
||||
console.log("canPlaceOnFloor - grid item count:", grid.getItemCount());
|
||||
return grid.canPlace(
|
||||
position,
|
||||
dimensions,
|
||||
rotation,
|
||||
ignoreIds,
|
||||
);
|
||||
return grid.canPlace(position, dimensions, rotation, ignoreIds);
|
||||
}
|
||||
|
||||
canPlaceOnWall(
|
||||
|
||||
@@ -10,10 +10,14 @@ function resolveLevelId(node: AnyNode, nodes: Record<string, AnyNode>): string {
|
||||
// This assumes you track parentId or can derive it
|
||||
let current: AnyNode | undefined = node;
|
||||
|
||||
while (current && current.parentId) {
|
||||
while (current) {
|
||||
if (current.type === "level") return current.id;
|
||||
// Find parent (you might need to add parentId to your schema or derive it)
|
||||
current = nodes[current.parentId];
|
||||
if (!current.parentId) {
|
||||
current = undefined;
|
||||
} else {
|
||||
current = nodes[current.parentId];
|
||||
}
|
||||
}
|
||||
|
||||
return "default"; // fallback for orphaned items
|
||||
|
||||
@@ -117,7 +117,6 @@ export class SpatialGrid {
|
||||
const cellKeys = this.getItemCells(position, dimensions, rotation);
|
||||
const ignoreSet = new Set(ignoreIds);
|
||||
const conflicts = new Set<string>();
|
||||
console.log("checking cells", cellKeys);
|
||||
|
||||
for (const key of cellKeys) {
|
||||
const cell = this.cells.get(key);
|
||||
|
||||
@@ -11,6 +11,7 @@ export function useSpatialQuery() {
|
||||
rotation: [number, number, number],
|
||||
ignoreIds?: string[],
|
||||
) => {
|
||||
console.log("spatialGridManager in useSpatialQuery:", spatialGridManager);
|
||||
return spatialGridManager.canPlaceOnFloor(
|
||||
levelId,
|
||||
position,
|
||||
|
||||
Reference in New Issue
Block a user