Files
blitzkit/packages/website/src/components/HelpingSpotLight.tsx
T

27 lines
659 B
TypeScript
Raw Normal View History

2025-08-28 18:23:02 -05:00
import type { SpotLightProps } from '@react-three/fiber';
2025-08-29 13:21:41 -05:00
import { memo } from 'react';
import { Color } from 'three';
import { isHalloween } from '../core/blitzkit/isHalloween';
2025-08-28 17:59:31 -05:00
2025-08-28 18:23:02 -05:00
interface Props extends SpotLightProps {
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 }) => {
const color = new Color();
if (isHalloween()) color.set(1, 0.25, 0.25);
2025-08-28 17:59:31 -05:00
return (
<>
{debug && (
<mesh position={props.position}>
<icosahedronGeometry args={[0.1, 2]} />
<meshBasicMaterial color={props.color} />
</mesh>
)}
2025-08-29 13:21:41 -05:00
<spotLight color={color} {...props} />
2025-08-28 17:59:31 -05:00
</>
);
2025-08-29 13:21:41 -05:00
});