Favivon - Correção

This commit is contained in:
2026-05-30 19:59:39 -03:00
parent 76ddaa815d
commit d7dfd221f0
32859 changed files with 5459654 additions and 404 deletions
+19
View File
@@ -0,0 +1,19 @@
import * as React from 'react';
import { Raycaster, Camera } from 'three';
import { useThree, applyProps } from '@react-three/fiber';
function useCamera(camera, props) {
const pointer = useThree(state => state.pointer);
const [raycast] = React.useState(() => {
const raycaster = new Raycaster();
if (props) applyProps(raycaster, props);
return function (_, intersects) {
raycaster.setFromCamera(pointer, camera instanceof Camera ? camera : camera.current);
const rc = this.constructor.prototype.raycast.bind(this);
if (rc) rc(raycaster, intersects);
};
});
return raycast;
}
export { useCamera };