mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-20 04:14:12 +01:00
feat: optimize rendering
This commit is contained in:
1 parent
b2ee97b3d4
commit
9f15ded0c9
6 files changed
+40
-50
No files matched your search
-3
@@ -1,4 +1,3 @@
|
||||
import { invalidate } from '@react-three/fiber';
|
||||
import type { QuicklimeEvent } from 'quicklime';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import type { Group } from 'three';
|
||||
@@ -19,8 +18,6 @@ export function CanvasContent() {
|
||||
if (!gun.current) return;
|
||||
|
||||
gun.current.rotation.x = event.data.pitch;
|
||||
|
||||
invalidate();
|
||||
}
|
||||
|
||||
modelTransformEvent.on(handleModelTransformEvent);
|
||||
|
||||
+3
-10
@@ -1,19 +1,12 @@
|
||||
import { Canvas } from '@react-three/fiber';
|
||||
import { SmartCanvas } from '../../../../../../../SmartCanvas';
|
||||
import { CameraPositioner, zoom } from './CameraPositioner';
|
||||
import { CanvasContent } from './CanvasContent';
|
||||
|
||||
export function FlexibilityCanvas() {
|
||||
return (
|
||||
<Canvas
|
||||
frameloop="demand"
|
||||
orthographic
|
||||
camera={{
|
||||
zoom,
|
||||
rotation: [0, Math.PI / 2, 0],
|
||||
}}
|
||||
>
|
||||
<SmartCanvas orthographic camera={{ zoom, rotation: [0, Math.PI / 2, 0] }}>
|
||||
<CanvasContent />
|
||||
<CameraPositioner />
|
||||
</Canvas>
|
||||
</SmartCanvas>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user