mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: more lighting
This commit is contained in:
1 parent
5d397de766
commit
5c2e49453e
4 files changed
+17
-8
No files matched your search
@@ -16,6 +16,7 @@ import {
|
||||
Path,
|
||||
Quaternion,
|
||||
} from 'three';
|
||||
import { isHalloween } from '../../../core/blitzkit/isHalloween';
|
||||
import { LocaleProvider, useLocale } from '../../../hooks/useLocale';
|
||||
import {
|
||||
TankopediaEphemeral,
|
||||
@@ -72,11 +73,8 @@ export function ShotDisplay() {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const data = new Date();
|
||||
const isHalloween = data.getMonth() === 9 && data.getDate() === 31;
|
||||
|
||||
if (
|
||||
isHalloween &&
|
||||
isHalloween() &&
|
||||
shot?.splashRadius !== undefined &&
|
||||
shot.in.status === 'penetration'
|
||||
) {
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
import type { SpotLightProps } from '@react-three/fiber';
|
||||
import { memo } from 'react';
|
||||
import { Color } from 'three';
|
||||
import { isHalloween } from '../core/blitzkit/isHalloween';
|
||||
|
||||
interface Props extends SpotLightProps {
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
export function HelpingSpotLight({ debug, ...props }: Props) {
|
||||
export const HelpingSpotLight = memo<Props>(({ debug, ...props }) => {
|
||||
const color = new Color();
|
||||
|
||||
if (isHalloween()) color.set(1, 0.25, 0.25);
|
||||
|
||||
return (
|
||||
<>
|
||||
{debug && (
|
||||
@@ -14,7 +21,7 @@ export function HelpingSpotLight({ debug, ...props }: Props) {
|
||||
</mesh>
|
||||
)}
|
||||
|
||||
<spotLight {...props} />
|
||||
<spotLight color={color} {...props} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
});
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { clamp } from 'lodash-es';
|
||||
import { useRef } from 'react';
|
||||
import { MeshStandardMaterial } from 'three';
|
||||
|
||||
const SIZE = 2 ** 6;
|
||||
const SIZE = 2 ** 5;
|
||||
|
||||
export function SceneProps() {
|
||||
const material = useRef<MeshStandardMaterial>(null);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export function isHalloween() {
|
||||
const data = new Date();
|
||||
return data.getMonth() === 9 && data.getDate() === 31;
|
||||
}
|
||||
Reference in new issue
Block a user