2025-11-26 20:48:25 -06:00
|
|
|
import { Box, Text } from "@radix-ui/themes";
|
|
|
|
|
import { Html } from "@react-three/drei";
|
2025-09-27 16:07:45 -05:00
|
|
|
import { memo, type ComponentProps } from "react";
|
2025-08-28 17:59:31 -05:00
|
|
|
|
2025-09-27 16:07:45 -05:00
|
|
|
interface Props extends ComponentProps<"spotLight"> {
|
2025-08-28 17:59:31 -05:00
|
|
|
debug?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-29 13:21:41 -05:00
|
|
|
export const HelpingSpotLight = memo<Props>(({ debug, ...props }) => {
|
2025-08-28 17:59:31 -05:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{debug && (
|
2025-11-26 20:48:25 -06:00
|
|
|
<group position={props.position}>
|
|
|
|
|
<mesh>
|
|
|
|
|
<icosahedronGeometry args={[0.1, 2]} />
|
|
|
|
|
<meshBasicMaterial color={props.color} />
|
|
|
|
|
</mesh>
|
|
|
|
|
|
|
|
|
|
<Html center>
|
|
|
|
|
<Box pb="9">
|
|
|
|
|
<Text wrap="nowrap">
|
|
|
|
|
{props.intensity} @ {JSON.stringify(props.userData)}
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Html>
|
|
|
|
|
</group>
|
2025-08-28 17:59:31 -05:00
|
|
|
)}
|
|
|
|
|
|
2025-08-29 22:51:24 -05:00
|
|
|
<spotLight {...props} />
|
2025-08-28 17:59:31 -05:00
|
|
|
</>
|
|
|
|
|
);
|
2025-08-29 13:21:41 -05:00
|
|
|
});
|