feat: Enhance conveyor and material handling with pause functionality and state management

This commit is contained in:
2025-05-06 19:12:58 +05:30
parent 815a9a94ca
commit 53912b2597
17 changed files with 202 additions and 69 deletions

View File

@@ -39,12 +39,12 @@ function MaterialInstance({ material }: { material: MaterialSchema }) {
const point = getPointByUuid(selectedProduct.productId, modelUuid, material.current.pointUuid);
if (!point) {
return { position: new THREE.Vector3(0, 0, 0), rotation: new THREE.Vector3(0, 0, 0), currentSpeed: 1 };
return { position: new THREE.Vector3(0, 0, 0), rotation: new THREE.Vector3(0, 0, 0), currentSpeed: currentSpeed || 1 };
}
const position = getWorldPositionFromScene(point.uuid);
if (position) {
return { position: position, rotation: new THREE.Vector3(0, 0, 0), currentSpeed: 1 };
return { position: position, rotation: new THREE.Vector3(0, 0, 0), currentSpeed: currentSpeed || 1 };
}
return {
@@ -54,6 +54,7 @@ function MaterialInstance({ material }: { material: MaterialSchema }) {
};
}, [material, getPointByUuid]);
function getCurrentSpeed(productId: string, modelUuid: string) {
const event = getEventByModelUuid(productId, modelUuid)
if (event) {