mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: optimize normalization
This commit is contained in:
1 parent
4584490b0d
commit
81e7f78e55
2 files changed
+11
-7
No files matched your search
+10
-6
@@ -163,19 +163,20 @@ export function CustomShellButton() {
|
|||||||
minWidth="8rem"
|
minWidth="8rem"
|
||||||
>
|
>
|
||||||
<Text color="gray">
|
<Text color="gray">
|
||||||
{customShell.normalization ?? 0}°
|
{Math.round(customShell.normalization ?? 0)}°
|
||||||
</Text>
|
</Text>
|
||||||
<Slider
|
<Slider
|
||||||
min={0}
|
min={0}
|
||||||
max={90}
|
max={90}
|
||||||
value={[customShell.normalization ?? 0]}
|
step={Number.EPSILON}
|
||||||
onValueChange={throttle(([value]) => {
|
defaultValue={[customShell.normalization ?? 0]}
|
||||||
|
onValueChange={([value]) => {
|
||||||
console.log('asd');
|
console.log('asd');
|
||||||
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
mutateTankopediaEphemeral((draft) => {
|
||||||
draft.customShell!.normalization = value;
|
draft.customShell!.normalization = value;
|
||||||
});
|
});
|
||||||
}, 1000)}
|
}}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
@@ -184,11 +185,14 @@ export function CustomShellButton() {
|
|||||||
<Text>Ricochet</Text>
|
<Text>Ricochet</Text>
|
||||||
|
|
||||||
<Flex align="center" gap="2" flexGrow="1" maxWidth="15rem">
|
<Flex align="center" gap="2" flexGrow="1" maxWidth="15rem">
|
||||||
<Text color="gray">{customShell.ricochet ?? 90}°</Text>
|
<Text color="gray">
|
||||||
|
{Math.round(customShell.ricochet ?? 90)}°
|
||||||
|
</Text>
|
||||||
<Slider
|
<Slider
|
||||||
min={0}
|
min={0}
|
||||||
max={90}
|
max={90}
|
||||||
value={[customShell.ricochet ?? 90]}
|
step={Number.EPSILON}
|
||||||
|
defaultValue={[customShell.ricochet ?? 90]}
|
||||||
onValueChange={throttle(([value]) => {
|
onValueChange={throttle(([value]) => {
|
||||||
mutateTankopediaEphemeral((draft) => {
|
mutateTankopediaEphemeral((draft) => {
|
||||||
draft.customShell!.ricochet = value;
|
draft.customShell!.ricochet = value;
|
||||||
|
|||||||
+1
-1
@@ -161,7 +161,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Canvas
|
<Canvas
|
||||||
frameloop={onScreen ? 'demand' : 'never'}
|
// frameloop={onScreen ? 'demand' : 'never'}
|
||||||
gl={{
|
gl={{
|
||||||
clippingPlanes: [],
|
clippingPlanes: [],
|
||||||
localClippingEnabled: true,
|
localClippingEnabled: true,
|
||||||
|
|||||||
Reference in new issue
Block a user