diff --git a/src/components/Avatar/Avatar.component.tsx b/src/components/Avatar/Avatar.component.tsx index bc81a013..84f1b0eb 100644 --- a/src/components/Avatar/Avatar.component.tsx +++ b/src/components/Avatar/Avatar.component.tsx @@ -10,6 +10,7 @@ import { HalfBodyModel, StaticModel, PoseModel } from 'src/components/Models'; import { isValidGlbUrl } from 'src/services'; import Capture, { CaptureType } from '../Capture/Capture.component'; import Box, { Background } from '../Background/Box/Box.component'; +import Shadow from '../Shadow/Shadow.components'; export const CAMERA = { TARGET: { @@ -91,7 +92,7 @@ export interface AvatarProps extends LightingProps { */ emotion?: Emotion; /** - * Applies Box background for canvas. + * Applies Box background for canvas, make sure that image is loadable to prevent bg errors. */ background?: Background; /** @@ -174,14 +175,7 @@ export const Avatar: FC = ({ updateCameraTargetOnZoom={!halfBody} /> {AvatarModel} - {shadows && ( - - - - - - - )} + {shadows && } {background?.src && } {capture && } diff --git a/src/components/Background/Box/Box.component.tsx b/src/components/Background/Box/Box.component.tsx index 5540940e..956fe92f 100644 --- a/src/components/Background/Box/Box.component.tsx +++ b/src/components/Background/Box/Box.component.tsx @@ -1,6 +1,6 @@ import React, { FC, useRef } from 'react'; import { Mesh, TextureLoader } from 'three'; -import { useFrame, useLoader } from '@react-three/fiber'; +import { useLoader } from '@react-three/fiber'; import { MeshProps } from '@react-three/fiber/dist/declarations/src/three-types'; export type Background = { src?: string } & MeshProps; @@ -9,17 +9,10 @@ const Box: FC = ({ src = '', ...baseProps }) => { const ref = useRef(); const texture = useLoader(TextureLoader, src); - useFrame(() => { - if (ref.current?.rotation.y) { - ref.current.rotation.y += 0.01; - } - }); - return ( - ); }; diff --git a/src/components/Shadow/Shadow.components.tsx b/src/components/Shadow/Shadow.components.tsx new file mode 100644 index 00000000..6e23ba23 --- /dev/null +++ b/src/components/Shadow/Shadow.components.tsx @@ -0,0 +1,12 @@ +import React, { FC } from 'react'; + +const Shadow: FC = () => ( + + + + + + +); + +export default Shadow;