gaesup-world 0.6.3 → 0.6.33
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.
|
@@ -67,33 +67,5 @@ export default function Camera(_a) {
|
|
|
67
67
|
cameraOption.position = makeNormalCameraPosition(activeState, cameraOption);
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
// lookat
|
|
71
|
-
// useEffect(() => {
|
|
72
|
-
// if (cameraRef.current) {
|
|
73
|
-
// const currentCamera = camera.position.clone();
|
|
74
|
-
// if (cameraOption.focus) {
|
|
75
|
-
// cameraRef.current.setLookAt(
|
|
76
|
-
// currentCamera.x,
|
|
77
|
-
// currentCamera.y,
|
|
78
|
-
// currentCamera.z,
|
|
79
|
-
// cameraOption.target.x,
|
|
80
|
-
// cameraOption.target.y,
|
|
81
|
-
// cameraOption.target.z,
|
|
82
|
-
// true
|
|
83
|
-
// );
|
|
84
|
-
// // 포커스 품
|
|
85
|
-
// } else if (!cameraOption.focus) {
|
|
86
|
-
// cameraRef.current.setLookAt(
|
|
87
|
-
// currentCamera.x,
|
|
88
|
-
// currentCamera.y,
|
|
89
|
-
// currentCamera.z,
|
|
90
|
-
// activeState.position.x,
|
|
91
|
-
// activeState.position.y,
|
|
92
|
-
// activeState.position.z,
|
|
93
|
-
// true
|
|
94
|
-
// );
|
|
95
|
-
// }
|
|
96
|
-
// }
|
|
97
|
-
// }, [cameraOption.focus]);
|
|
98
70
|
return _jsx(CameraControls, { ref: cameraRef });
|
|
99
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { vec3 } from "@react-three/rapier";
|
|
3
|
-
import { useContext } from "react";
|
|
3
|
+
import { useContext, useMemo } from "react";
|
|
4
4
|
import calculation from "../physics";
|
|
5
5
|
import { GaesupWorldContext } from "../world/context";
|
|
6
6
|
import { AirplaneRef } from "./active/airplane";
|
|
@@ -11,9 +11,12 @@ export function GaesupComponent(_a) {
|
|
|
11
11
|
var _b = useContext(GaesupWorldContext), mode = _b.mode, states = _b.states, rideable = _b.rideable;
|
|
12
12
|
var enableRiding = states.enableRiding, isRiderOn = states.isRiderOn, rideableId = states.rideableId;
|
|
13
13
|
calculation(props);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
var MemorizeComponent = useMemo(function () {
|
|
15
|
+
return (_jsxs(_Fragment, { children: [mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls })), mode.type === "vehicle" && (_jsx(VehicleRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
|
|
16
|
+
? rideable[rideableId].offset
|
|
17
|
+
: vec3(), children: props.children })), mode.type === "airplane" && (_jsx(AirplaneRef, { props: props, groundRay: props.groundRay, refs: refs, urls: urls, enableRiding: enableRiding, isRiderOn: isRiderOn, offset: rideableId && rideable[rideableId]
|
|
18
|
+
? rideable[rideableId].offset
|
|
19
|
+
: vec3(), children: props.children }))] }));
|
|
20
|
+
}, [mode.type]);
|
|
21
|
+
return (_jsx(_Fragment, { children: MemorizeComponent }));
|
|
19
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useGraph } from "@react-three/fiber";
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useMemo } from "react";
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
import { SkeletonUtils } from "three-stdlib";
|
|
6
6
|
import { useAnimations, useGLTF } from "@react-three/drei";
|
|
@@ -17,13 +17,13 @@ export var InnerGroupRef = forwardRef(function (_a, ref) {
|
|
|
17
17
|
var clone = useMemo(function () { return SkeletonUtils.clone(scene); }, [scene]);
|
|
18
18
|
var nodes = useGraph(clone).nodes;
|
|
19
19
|
var objectNode = Object.values(nodes).find(function (node) { return node.type === "Object3D"; });
|
|
20
|
-
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
return (_jsxs("group", { receiveShadow: true, castShadow: true, ref: ref, rotation: rotation, userData: { intangible: true }, children: [children, objectNode && animationRef && (_jsx("primitive", { object: objectNode, visible: false, receiveShadow: true, castShadow: true, ref: animationRef })), Object.keys(nodes).map(function (name, key) {
|
|
21
|
+
var node = nodes[name];
|
|
22
|
+
if (node instanceof THREE.SkinnedMesh) {
|
|
23
|
+
return (_jsx("skinnedMesh", { castShadow: true, receiveShadow: true, material: node.material, geometry: node.geometry, skeleton: node.skeleton }, key));
|
|
24
|
+
}
|
|
25
|
+
else if (node instanceof THREE.Mesh) {
|
|
26
|
+
return (_jsx("mesh", { castShadow: true, receiveShadow: true, material: node.material, geometry: node.geometry }, key));
|
|
27
|
+
}
|
|
28
|
+
})] }));
|
|
29
29
|
});
|
|
@@ -22,7 +22,7 @@ export function PassiveCharacter(props) {
|
|
|
22
22
|
};
|
|
23
23
|
}, [props]), position = _a.position, euler = _a.euler;
|
|
24
24
|
useEffect(function () {
|
|
25
|
-
if (rigidBodyRef
|
|
25
|
+
if (rigidBodyRef && rigidBodyRef.current) {
|
|
26
26
|
rigidBodyRef.current.setEnabledRotations(false, false, false, false);
|
|
27
27
|
}
|
|
28
28
|
}, []);
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { vec3 } from "@react-three/rapier";
|
|
14
|
-
import {
|
|
14
|
+
import { useContext, useEffect, useRef } from "react";
|
|
15
15
|
import * as THREE from "three";
|
|
16
16
|
import useClicker from "../hooks/useClicker";
|
|
17
17
|
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../world/context";
|
|
@@ -42,5 +42,5 @@ export function GaeSupProps(_a) {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
}, []);
|
|
45
|
-
return (_jsx(
|
|
45
|
+
return (_jsx("group", { ref: groupRef, position: position, onPointerDown: function (e) { return moveClicker(e, false, type); }, onDoubleClick: function (e) { return moveClicker(e, true, type); }, children: children }));
|
|
46
46
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaesup-world",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.33",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"@dimforge/rapier3d": "^0.12.0",
|
|
21
21
|
"@dimforge/rapier3d-compat": "^0.12.0",
|
|
22
22
|
"@react-icons/all-files": "^4.1.0",
|
|
23
|
-
"@react-three/drei": "9.
|
|
24
|
-
"@react-three/fiber": "8.16.
|
|
23
|
+
"@react-three/drei": "9.105.4",
|
|
24
|
+
"@react-three/fiber": "8.16.2",
|
|
25
25
|
"@react-three/rapier": "^1.3.0",
|
|
26
|
-
"@types/three": "^0.
|
|
26
|
+
"@types/three": "^0.163.0",
|
|
27
27
|
"gh-pages": "^6.1.1",
|
|
28
28
|
"leva": "0.9.35",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/lodash": "^4.17.0",
|
|
41
|
-
"@types/react": "^18.2.
|
|
42
|
-
"@types/react-dom": "^18.2.
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
44
|
-
"@typescript-eslint/parser": "^7.
|
|
41
|
+
"@types/react": "^18.2.78",
|
|
42
|
+
"@types/react-dom": "^18.2.25",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
44
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
45
45
|
"@vanilla-extract/css": "^1.14.2",
|
|
46
46
|
"@vanilla-extract/dynamic": "^2.1.0",
|
|
47
47
|
"@vanilla-extract/recipes": "^0.5.2",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"@vanilla-extract/vite-plugin": "^4.0.7",
|
|
50
50
|
"@vitejs/plugin-react-swc": "^3.6.0",
|
|
51
51
|
"copyfiles": "^2.4.1",
|
|
52
|
-
"css-loader": "^
|
|
53
|
-
"eslint": "^
|
|
52
|
+
"css-loader": "^7.1.1",
|
|
53
|
+
"eslint": "^9.0.0",
|
|
54
54
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
55
55
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
56
56
|
"path": "^0.12.7",
|
|
57
57
|
"prettier": "^3.2.5",
|
|
58
58
|
"rimraf": "^5.0.5",
|
|
59
|
-
"typescript": "^5.4.
|
|
60
|
-
"vite": "^5.2.
|
|
59
|
+
"typescript": "^5.4.5",
|
|
60
|
+
"vite": "^5.2.8",
|
|
61
61
|
"vite-plugin-svgr": "^4.2.0"
|
|
62
62
|
},
|
|
63
63
|
"description": "Web 3D Character Controller and World Platform Library",
|