fix: Update animation reset logic and frame update speed based on active module

This commit is contained in:
2025-07-04 17:29:19 +05:30
parent 508c88dce2
commit 2feedc7dcb

View File

@@ -57,7 +57,7 @@ function Model({ asset }: { readonly asset: Asset }) {
useEffect(() => {
setDeletableFloorItem(null);
if (selectedFloorItem === null) {
if (selectedFloorItem === null || selectedFloorItem.modelUuid !== asset.modelUuid) {
resetAnimation(asset.modelUuid);
}
}, [activeModule, toolMode, selectedFloorItem])
@@ -291,7 +291,7 @@ function Model({ asset }: { readonly asset: Asset }) {
useFrame((_, delta) => {
if (mixerRef.current) {
mixerRef.current.update(delta * speed);
mixerRef.current.update(delta * (activeModule === 'simulation' ? speed : 1));
}
});