mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-13 20:56:11 +01:00
feat: code split
This commit is contained in:
1 parent
2cf0bda352
commit
0a4e696bc1
15 files changed
+308
-121
No files matched your search
@@ -3,15 +3,16 @@ import { useThree } from '@react-three/fiber';
|
||||
import { RefObject, useEffect, useRef } from 'react';
|
||||
import { Box3, Object3D } from 'three';
|
||||
import { OrbitControls as OrbitControlsClass } from 'three-stdlib';
|
||||
import { useTankopedia } from '../../../../../stores/tankopedia';
|
||||
|
||||
interface ControlsProps {
|
||||
enabled: boolean;
|
||||
fit: RefObject<Object3D>;
|
||||
}
|
||||
|
||||
export function Controls({ enabled, fit }: ControlsProps) {
|
||||
export function Controls({ fit }: ControlsProps) {
|
||||
const camera = useThree((state) => state.camera);
|
||||
const orbitControls = useRef<OrbitControlsClass>(null);
|
||||
const enabled = useTankopedia((state) => state.model.controlsEnabled);
|
||||
|
||||
useEffect(() => {
|
||||
const box = new Box3().setFromObject(fit.current!);
|
||||
|
||||
Reference in new issue
Block a user