feat: Implement human event handling in copy and duplication controls

- Added support for handling "Human" type events in the copy and duplication controls.
- Created a new HumanEventSchema to manage human-related events, including position, rotation, and action details.
- Updated the HumanAnimator to improve rotation handling using quaternions for smoother transitions.
- Enhanced the HumanInstance to ensure proper synchronization of human positions and rotations.
- Integrated human event handling in the trigger handler for various interactions, including vehicle and machine actions.
- Introduced material drop functionality from vehicles to humans, allowing for dynamic interactions in the simulation.
This commit is contained in:
2025-07-04 17:15:10 +05:30
parent ff02f01430
commit 508c88dce2
9 changed files with 821 additions and 86 deletions

View File

@@ -16,6 +16,7 @@ import { getUserData } from '../../../../../functions/getUserData';
import { useSceneContext } from '../../../../scene/sceneContext';
import { useVersionContext } from '../../../version/versionContext';
import { SkeletonUtils } from 'three-stdlib';
import { useAnimationPlaySpeed } from '../../../../../store/usePlayButtonStore';
function Model({ asset }: { readonly asset: Asset }) {
const { camera, controls, gl } = useThree();
@@ -23,6 +24,7 @@ function Model({ asset }: { readonly asset: Asset }) {
const { toggleView } = useToggleView();
const { subModule } = useSubModuleStore();
const { activeModule } = useModuleStore();
const { speed } = useAnimationPlaySpeed();
const { assetStore, eventStore, productStore } = useSceneContext();
const { removeAsset, setAnimations, resetAnimation, setAnimationComplete, setCurrentAnimation: setAnmationAnimation } = assetStore();
const { setTop } = useTopData();
@@ -289,7 +291,7 @@ function Model({ asset }: { readonly asset: Asset }) {
useFrame((_, delta) => {
if (mixerRef.current) {
mixerRef.current.update(delta);
mixerRef.current.update(delta * speed);
}
});