feat: Enhance wall asset interaction and management; implement position updates and add closest point calculation utility
This commit is contained in:
@@ -6,6 +6,7 @@ interface WallAssetStore {
|
||||
setWallAssets: (assets: WallAsset[]) => void;
|
||||
addWallAsset: (asset: WallAsset) => void;
|
||||
updateWallAsset: (uuid: string, updated: Partial<WallAsset>) => void;
|
||||
setWallAssetPosition: (uuid: string, position: [number, number, number]) => void;
|
||||
removeWallAsset: (uuid: string) => void;
|
||||
clearWallAssets: () => void;
|
||||
|
||||
@@ -37,6 +38,13 @@ export const createWallAssetStore = () => {
|
||||
}
|
||||
}),
|
||||
|
||||
setWallAssetPosition: (uuid, position) => set(state => {
|
||||
const asset = state.wallAssets.find(a => a.modelUuid === uuid);
|
||||
if (asset) {
|
||||
asset.position = position;
|
||||
}
|
||||
}),
|
||||
|
||||
removeWallAsset: (uuid) => set(state => {
|
||||
state.wallAssets = state.wallAssets.filter(a => a.modelUuid !== uuid);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user