fix: Update animation reset logic and frame update speed based on active module
This commit is contained in:
@@ -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));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user