@react-three/viverse 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils.js +2 -2
- package/package.json +2 -2
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VRM } from '@pixiv/three-vrm';
|
|
2
2
|
import { CharacterCameraBehavior, flattenCharacterAnimationOptions, flattenCharacterModelOptions, loadCharacterModel, loadCharacterAnimation, ScreenJoystickLocomotionActionBindings, ScreenButtonJumpActionBindings, PointerCaptureRotateZoomActionBindings, KeyboardLocomotionActionBindings, applySimpleCharacterActionBindingOptions, KeyboardActionBinding, PointerButtonActionBinding, defaultScreenButtonStyles, PointerLockRotateZoomActionBindings, DefaultMoveBackwardKeys, DefaultMoveForwardKeys, DefaultJumpKeys, DefaultMoveLeftKeys, DefaultMoveRightKeys, DefaultRunKeys, } from '@pmndrs/viverse';
|
|
3
3
|
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
5
5
|
import { suspend } from 'suspend-react';
|
|
6
6
|
import { Object3D } from 'three';
|
|
7
7
|
import { useBvhPhysicsWorld } from './physics.js';
|
|
@@ -17,7 +17,7 @@ export function useCharacterCameraBehavior(model, options) {
|
|
|
17
17
|
};
|
|
18
18
|
}, []);
|
|
19
19
|
const world = useBvhPhysicsWorld();
|
|
20
|
-
const raycast =
|
|
20
|
+
const raycast = useCallback((ray, far) => world.raycast(ray, far)?.distance, [world]);
|
|
21
21
|
useFrame((state, delta) => {
|
|
22
22
|
const resolvedModel = model instanceof Object3D ? model : model.current;
|
|
23
23
|
if (resolvedModel == null) {
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@pixiv/three-vrm": "^3.4.2",
|
|
30
30
|
"zustand": "^5.0.6",
|
|
31
31
|
"@react-three/xr": "^6.6.20",
|
|
32
|
-
"@pmndrs/viverse": "^0.2.
|
|
32
|
+
"@pmndrs/viverse": "^0.2.15"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@react-three/fiber": "*"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@types/react": "^19.1.8",
|
|
41
41
|
"react": "^19.1.0"
|
|
42
42
|
},
|
|
43
|
-
"version": "0.2.
|
|
43
|
+
"version": "0.2.15",
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc",
|
|
46
46
|
"check:prettier": "prettier --check src",
|