Skip to content

Commit

Permalink
fix: remove fade in and introduce a bug with existing spawn animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaehiel committed Oct 9, 2023
1 parent b3877e7 commit 97d7c5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, FC, useMemo } from 'react';
import React, { useRef, FC, useMemo, useState } from 'react';
import { useFrame, useGraph } from '@react-three/fiber';
import { AnimationMixer, Group } from 'three';
import { Model } from 'src/components/Models/Model';
Expand Down Expand Up @@ -29,7 +29,7 @@ export const AnimationModel: FC<AnimationModelProps> = ({
bloom
}) => {
const ref = useRef<Group>(null);
const [animationRunning, setAnimationRunning] = React.useState(true);
const [animationRunning, setAnimationRunning] = useState(true);
const onSpawnAnimationFinish = () => {
setAnimationRunning(false);
};
Expand All @@ -46,7 +46,7 @@ export const AnimationModel: FC<AnimationModelProps> = ({
}

const animation = mixer.clipAction(await animationClip);
animation.fadeIn(0.5);
animation.fadeIn(0);
animation.play();

mixer.update(0);
Expand Down
4 changes: 4 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export type EffectConfiguration = {
* Enables ambient occlusion for the current scene.
*/
ambientOcclusion?: boolean;
/**
* Bloom post-processing effect.
*/
bloom?: BloomConfiguration;
};

export interface SpawnState {
Expand Down

0 comments on commit 97d7c5a

Please sign in to comment.