gaesup-world 0.8.17 → 0.8.19
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/gaesup/controller/context/index.d.ts +6 -0
- package/dist/gaesup/controller/context/index.js +6 -0
- package/dist/gaesup/controller/context/reducer.d.ts +1 -0
- package/dist/gaesup/controller/index.js +2 -1
- package/dist/gaesup/controller/initialize/index.d.ts +1 -7
- package/dist/gaesup/controller/initialize/index.js +5 -15
- package/dist/gaesup/controller/type.d.ts +4 -1
- package/dist/gaesup/gaesupProps/index.js +2 -6
- package/dist/gaesup/tools/miniMap/index.js +4 -4
- package/dist/gaesup/tools/miniMap/type.d.ts +1 -1
- package/dist/gaesup/tools/zoomButton/index.d.ts +0 -19
- package/dist/gaesup/tools/zoomButton/index.js +102 -146
- package/dist/gaesup/world/context/index.js +0 -4
- package/dist/gaesup/world/context/reducer.d.ts +0 -4
- package/dist/gaesup/world/context/type.d.ts +0 -4
- package/dist/gaesup/world/initalize/index.d.ts +0 -4
- package/dist/gaesup/world/initalize/index.js +0 -4
- package/dist/gaesup/world/type.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -38,6 +38,12 @@ export declare const gaesupControllerDefault: {
|
|
|
38
38
|
innerGroupRef: any;
|
|
39
39
|
characterInnerRef: any;
|
|
40
40
|
};
|
|
41
|
+
controllerOptions: {
|
|
42
|
+
lerp: {
|
|
43
|
+
cameraTurn: number;
|
|
44
|
+
cameraPosition: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
41
47
|
};
|
|
42
48
|
export declare const GaesupControllerContext: import("react").Context<gaesupControllerType>;
|
|
43
49
|
export declare const GaesupControllerDispatchContext: import("react").Context<dispatchType<gaesupControllerType>>;
|
|
@@ -48,6 +48,12 @@ export var gaesupControllerDefault = {
|
|
|
48
48
|
innerGroupRef: null,
|
|
49
49
|
characterInnerRef: null,
|
|
50
50
|
},
|
|
51
|
+
controllerOptions: {
|
|
52
|
+
lerp: {
|
|
53
|
+
cameraTurn: 1,
|
|
54
|
+
cameraPosition: 1,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
51
57
|
};
|
|
52
58
|
export var GaesupControllerContext = createContext(__assign({}, gaesupControllerDefault));
|
|
53
59
|
export var GaesupControllerDispatchContext = createContext(null);
|
|
@@ -6,6 +6,7 @@ export declare function gaesupControllerReducer(props: gaesupControllerType, act
|
|
|
6
6
|
airplane: import("./type").airplaneType;
|
|
7
7
|
vehicle: import("./type").vehicleType;
|
|
8
8
|
character: import("./type").characterType;
|
|
9
|
+
controllerOptions: import("../type").controllerOptionsType;
|
|
9
10
|
callbacks?: import("../initialize/callback/type").callbackType;
|
|
10
11
|
refs?: import("../type").refsType;
|
|
11
12
|
};
|
|
@@ -47,6 +47,7 @@ export function GaesupControllerInner(props) {
|
|
|
47
47
|
innerGroupRef: innerGroupRef,
|
|
48
48
|
characterInnerRef: characterInnerRef,
|
|
49
49
|
},
|
|
50
|
+
controllerOptions: Object.assign(gaesupControllerDefault.controllerOptions, props.controllerOptions || {}),
|
|
50
51
|
}), controller = _a[0], controllerDispatch = _a[1];
|
|
51
52
|
var gaesupControl = useMemo(function () { return ({
|
|
52
53
|
value: controller,
|
|
@@ -64,7 +65,7 @@ export function GaesupControllerInner(props) {
|
|
|
64
65
|
}, []);
|
|
65
66
|
var prop = __assign(__assign(__assign(__assign({}, initControllerProps({
|
|
66
67
|
refs: refs,
|
|
67
|
-
})), { children: props.children, groupProps: props.groupProps }), gaesupControl.value.callbacks), refs);
|
|
68
|
+
})), { children: props.children, groupProps: props.groupProps, controllerOptions: gaesupControl.value.controllerOptions }), gaesupControl.value.callbacks), refs);
|
|
68
69
|
initDebug({
|
|
69
70
|
controllerContext: gaesupControl.value,
|
|
70
71
|
controllerDispatch: gaesupControl.dispatch,
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { groundRayType, refsType } from "../../controller/type";
|
|
2
2
|
import { cameraRayType } from "../../camera/type";
|
|
3
3
|
import { keyControlType } from "../../world/context/type";
|
|
4
|
-
export default function initControllerProps(
|
|
4
|
+
export default function initControllerProps(props: {
|
|
5
5
|
refs: refsType;
|
|
6
6
|
}): {
|
|
7
7
|
groundRay: groundRayType;
|
|
8
8
|
cameraRay: cameraRayType;
|
|
9
9
|
keyControl: keyControlType;
|
|
10
|
-
controllerOptions: {
|
|
11
|
-
lerp: {
|
|
12
|
-
cameraPosition: number;
|
|
13
|
-
cameraTurn: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
10
|
};
|
|
@@ -15,11 +15,10 @@ import { useCallback, useContext, useEffect, useMemo } from "react";
|
|
|
15
15
|
import * as THREE from "three";
|
|
16
16
|
import { update } from "../../utils/context";
|
|
17
17
|
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../../world/context";
|
|
18
|
-
export default function initControllerProps(
|
|
19
|
-
var refs = _a.refs;
|
|
18
|
+
export default function initControllerProps(props) {
|
|
20
19
|
var context = useContext(GaesupWorldContext);
|
|
21
20
|
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
22
|
-
var
|
|
21
|
+
var _a = useKeyboardControls(), _ = _a[0], getKeys = _a[1];
|
|
23
22
|
var keyControl = getKeys();
|
|
24
23
|
useEffect(function () {
|
|
25
24
|
if (context && keyControl && context.control) {
|
|
@@ -71,28 +70,19 @@ export default function initControllerProps(_a) {
|
|
|
71
70
|
intersectObjectMap: {},
|
|
72
71
|
};
|
|
73
72
|
}, []);
|
|
74
|
-
var controllerOptions = useMemo(function () {
|
|
75
|
-
return {
|
|
76
|
-
lerp: {
|
|
77
|
-
cameraPosition: 0.9,
|
|
78
|
-
cameraTurn: 0.1,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}, []);
|
|
82
73
|
var initRefs = useCallback(function (refs) {
|
|
83
74
|
update({
|
|
84
75
|
refs: __assign({}, refs),
|
|
85
76
|
}, dispatch);
|
|
86
|
-
}, [refs]);
|
|
77
|
+
}, [props.refs]);
|
|
87
78
|
useEffect(function () {
|
|
88
|
-
if (refs) {
|
|
89
|
-
initRefs(refs);
|
|
79
|
+
if (props.refs) {
|
|
80
|
+
initRefs(props.refs);
|
|
90
81
|
}
|
|
91
82
|
}, []);
|
|
92
83
|
return {
|
|
93
84
|
groundRay: groundRay,
|
|
94
85
|
cameraRay: cameraRay,
|
|
95
86
|
keyControl: keyControl,
|
|
96
|
-
controllerOptions: controllerOptions,
|
|
97
87
|
};
|
|
98
88
|
}
|
|
@@ -81,6 +81,7 @@ export type gaesupControllerContextPropType = {
|
|
|
81
81
|
airplane: airplaneType;
|
|
82
82
|
vehicle: vehicleType;
|
|
83
83
|
character: characterType;
|
|
84
|
+
controllerOptions: controllerOptionsType;
|
|
84
85
|
};
|
|
85
86
|
export interface controllerOtherPropType extends RigidBodyProps {
|
|
86
87
|
children?: ReactNode;
|
|
@@ -88,4 +89,6 @@ export interface controllerOtherPropType extends RigidBodyProps {
|
|
|
88
89
|
rigidBodyProps?: RigidBodyProps;
|
|
89
90
|
debug?: boolean;
|
|
90
91
|
}
|
|
91
|
-
export type controllerType = controllerOtherPropType & urlsType & Partial<gaesupControllerContextPropType> & callbackType
|
|
92
|
+
export type controllerType = controllerOtherPropType & urlsType & Partial<gaesupControllerContextPropType> & callbackType & {
|
|
93
|
+
controllerOptions?: controllerOptionsType;
|
|
94
|
+
};
|
|
@@ -11,7 +11,6 @@ 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 * as _ from "lodash";
|
|
15
14
|
import { useContext, useEffect, useRef } from "react";
|
|
16
15
|
import * as THREE from "three";
|
|
17
16
|
import { useClicker } from "../hooks/useClicker";
|
|
@@ -19,7 +18,7 @@ import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../world/contex
|
|
|
19
18
|
export function GaeSupProps(_a) {
|
|
20
19
|
var _b = _a.type, type = _b === void 0 ? "normal" : _b, text = _a.text, position = _a.position, children = _a.children;
|
|
21
20
|
var groupRef = useRef(null);
|
|
22
|
-
var
|
|
21
|
+
var minimap = useContext(GaesupWorldContext).minimap;
|
|
23
22
|
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
24
23
|
// clicker
|
|
25
24
|
var moveClicker = useClicker().moveClicker;
|
|
@@ -43,8 +42,5 @@ export function GaeSupProps(_a) {
|
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
}, []);
|
|
46
|
-
|
|
47
|
-
moveClicker(e, false, type);
|
|
48
|
-
}, clickerOption.throttle);
|
|
49
|
-
return (_jsx("group", { ref: groupRef, position: position, onPointerDown: moveThrottleClicker, onDoubleClick: moveThrottleClicker, children: children }));
|
|
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 }));
|
|
50
46
|
}
|
|
@@ -19,7 +19,7 @@ import "./style.css";
|
|
|
19
19
|
export function MiniMap(props) {
|
|
20
20
|
var _a = useContext(GaesupWorldContext), minimap = _a.minimap, activeState = _a.activeState, mode = _a.mode;
|
|
21
21
|
var _b = useState(props.scale || minimapDefault.scale), scale = _b[0], setscale = _b[1];
|
|
22
|
-
var
|
|
22
|
+
var minimapInnerStyle = props.minimapInnerStyle, textStyle = props.textStyle, minimapObjectStyle = props.minimapObjectStyle, avatarStyle = props.avatarStyle, scaleStyle = props.scaleStyle, directionStyle = props.directionStyle, plusMinusStyle = props.plusMinusStyle, imageStyle = props.imageStyle, minimapStyle = props.minimapStyle, minimapOuterStyle = props.minimapOuterStyle;
|
|
23
23
|
var upscale = useCallback(function () {
|
|
24
24
|
var max = props.maxScale || minimapDefault.maxScale;
|
|
25
25
|
setscale(function (scale) { return Math.min(max, scale + 0.1); });
|
|
@@ -35,9 +35,9 @@ export function MiniMap(props) {
|
|
|
35
35
|
upscale();
|
|
36
36
|
else
|
|
37
37
|
downscale();
|
|
38
|
-
}, children: [_jsx("div", { className: "minimapOuter", style:
|
|
38
|
+
}, style: minimapStyle, children: [_jsx("div", { className: "minimapOuter", style: minimapOuterStyle }), _jsxs("div", { className: "minimapInner", style: __assign({ transform: props.blockRotate || mode.control === "normal"
|
|
39
39
|
? "translate(-50%, -50%) rotate(180deg) "
|
|
40
|
-
: "translate(-50%, -50%) rotate(".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") },
|
|
40
|
+
: "translate(-50%, -50%) rotate(".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, minimapInnerStyle), children: [_jsx("div", { className: "east direction", style: __assign({ transform: props.blockRotate || mode.control === "normal"
|
|
41
41
|
? "translate(-50%, -50%) rotate(180deg) "
|
|
42
42
|
: "translate(-50%, -50%) rotate(-".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, directionStyle), children: "E" }), _jsx("div", { className: "west direction", style: __assign({ transform: props.blockRotate || mode.control === "normal"
|
|
43
43
|
? "translate(50%, -50%) rotate(180deg) "
|
|
@@ -53,7 +53,7 @@ export function MiniMap(props) {
|
|
|
53
53
|
var Z = (center.z - activeState.position.z) *
|
|
54
54
|
(props.angle ? -Math.cos(props.angle) : 1) *
|
|
55
55
|
scale;
|
|
56
|
-
return (_jsxs("div", { children: [_jsx("div", { className: "minimapObject", style: __assign({ width: "".concat(size.x * scale, "rem"), height: "".concat(size.z * scale, "rem"), top: "50%", left: "50%", transform: "translate(-50.1%, -50.1%) translate(".concat(-X, "rem, ").concat(-Z, "rem) rotate(").concat((Math.PI * 3) / 2 + props.angle || 0, "rad)"), transformOrigin: "50% 50%", zIndex: 1 + key },
|
|
56
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "minimapObject", style: __assign({ width: "".concat(size.x * scale, "rem"), height: "".concat(size.z * scale, "rem"), top: "50%", left: "50%", transform: "translate(-50.1%, -50.1%) translate(".concat(-X, "rem, ").concat(-Z, "rem) rotate(").concat((Math.PI * 3) / 2 + props.angle || 0, "rad)"), transformOrigin: "50% 50%", zIndex: 1 + key }, minimapObjectStyle) }), key === 0 && (_jsx("div", { className: "imageObject", style: __assign({ width: "".concat(size.x * scale, "rem"), height: "".concat(size.z * scale, "rem"), top: "50%", left: "50%", transform: "translate(-50.1%, -50.1%) translate(".concat(-X, "rem, ").concat(-Z, "rem) rotate(").concat((Math.PI * 3) / 2 + props.angle || 0, "rad)"), transformOrigin: "50% 50%", zIndex: 10 + key }, imageStyle) })), _jsx("div", { className: "textObject", style: {
|
|
57
57
|
width: "".concat(size.x * scale, "rem"),
|
|
58
58
|
height: "".concat(size.z * scale, "rem"),
|
|
59
59
|
top: "50.1%",
|
|
@@ -14,7 +14,7 @@ export type minimapInnerType = {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
export type minimapType = {
|
|
17
|
-
[key in "minimapStyle" | "
|
|
17
|
+
[key in "minimapStyle" | "minimapOuterStyle" | "minimapInnerStyle" | "minimapObjectStyle" | "textStyle" | "objectStyle" | "avatarStyle" | "directionStyle" | "scaleStyle" | "imageStyle" | "plusMinusStyle"]?: CSSProperties;
|
|
18
18
|
} & {
|
|
19
19
|
minScale?: number;
|
|
20
20
|
maxScale?: number;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
import "./style.css";
|
|
4
|
-
export type zoomButtonPropsType = {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
position: THREE.Vector3;
|
|
7
|
-
target?: THREE.Vector3;
|
|
8
|
-
keepBlocking?: boolean;
|
|
9
|
-
zoomButtonStyle?: React.CSSProperties;
|
|
10
|
-
};
|
|
11
|
-
export declare function useZoom(): {
|
|
12
|
-
setZoom: (position: THREE.Vector3, isZoom: boolean) => Promise<void>;
|
|
13
|
-
openCamera: () => Promise<void>;
|
|
14
|
-
closeCamera: (position: THREE.Vector3) => Promise<void>;
|
|
15
|
-
isZoom: boolean;
|
|
16
|
-
setIsZoom: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
-
moveToCamera: () => Promise<void>;
|
|
18
|
-
};
|
|
19
|
-
export declare function ZoomButton(props: zoomButtonPropsType): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,146 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}); };
|
|
106
|
-
var setZoom = function (position, isZoom) { return __awaiter(_this, void 0, void 0, function () {
|
|
107
|
-
return __generator(this, function (_a) {
|
|
108
|
-
switch (_a.label) {
|
|
109
|
-
case 0:
|
|
110
|
-
setIsZoom(isZoom);
|
|
111
|
-
return [4 /*yield*/, closeCamera(position)];
|
|
112
|
-
case 1:
|
|
113
|
-
_a.sent();
|
|
114
|
-
return [4 /*yield*/, moveToCamera()];
|
|
115
|
-
case 2:
|
|
116
|
-
_a.sent();
|
|
117
|
-
return [4 /*yield*/, openCamera()];
|
|
118
|
-
case 3:
|
|
119
|
-
_a.sent();
|
|
120
|
-
return [2 /*return*/];
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}); };
|
|
124
|
-
return {
|
|
125
|
-
setZoom: setZoom,
|
|
126
|
-
openCamera: openCamera,
|
|
127
|
-
closeCamera: closeCamera,
|
|
128
|
-
isZoom: isZoom,
|
|
129
|
-
setIsZoom: setIsZoom,
|
|
130
|
-
moveToCamera: moveToCamera,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
export function ZoomButton(props) {
|
|
134
|
-
var _this = this;
|
|
135
|
-
var _a = useZoom(), setZoom = _a.setZoom, isZoom = _a.isZoom;
|
|
136
|
-
return (_jsx("div", { className: "zoomButton", style: __assign({}, props.zoomButtonStyle), onClick: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
137
|
-
return __generator(this, function (_a) {
|
|
138
|
-
switch (_a.label) {
|
|
139
|
-
case 0: return [4 /*yield*/, setZoom(props.position, isZoom)];
|
|
140
|
-
case 1:
|
|
141
|
-
_a.sent();
|
|
142
|
-
return [2 /*return*/];
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}); }, children: props.children }));
|
|
146
|
-
}
|
|
1
|
+
// import { useContext, useState } from "react";
|
|
2
|
+
// import * as THREE from "three";
|
|
3
|
+
// import { makeNormalCameraPosition } from "../../camera/control/normal";
|
|
4
|
+
// import { makeOrbitCameraPosition } from "../../camera/control/orbit";
|
|
5
|
+
// import {
|
|
6
|
+
// GaesupWorldContext,
|
|
7
|
+
// GaesupWorldDispatchContext,
|
|
8
|
+
// } from "../../world/context/index";
|
|
9
|
+
// import "./style.css";
|
|
10
|
+
//
|
|
11
|
+
// export type zoomButtonPropsType = {
|
|
12
|
+
// children?: React.ReactNode;
|
|
13
|
+
// position: THREE.Vector3;
|
|
14
|
+
// target?: THREE.Vector3;
|
|
15
|
+
// keepBlocking?: boolean;
|
|
16
|
+
// zoomButtonStyle?: React.CSSProperties;
|
|
17
|
+
// };
|
|
18
|
+
//
|
|
19
|
+
// export function useZoom() {
|
|
20
|
+
// const { moveTo, activeState, cameraOption, mode, block } =
|
|
21
|
+
// useContext(GaesupWorldContext);
|
|
22
|
+
// const dispatch = useContext(GaesupWorldDispatchContext);
|
|
23
|
+
// const [isZoom, setIsZoom] = useState(true);
|
|
24
|
+
//
|
|
25
|
+
// const closeCamera = async (position: THREE.Vector3) => {
|
|
26
|
+
// cameraOption.XDistance = position.x;
|
|
27
|
+
// cameraOption.YDistance = position.y;
|
|
28
|
+
// cameraOption.ZDistance = position.z;
|
|
29
|
+
// block.camera = true;
|
|
30
|
+
// dispatch({
|
|
31
|
+
// type: "update",
|
|
32
|
+
// payload: {
|
|
33
|
+
// block: {
|
|
34
|
+
// ...block,
|
|
35
|
+
// },
|
|
36
|
+
// cameraOption: {
|
|
37
|
+
// ...cameraOption,
|
|
38
|
+
// },
|
|
39
|
+
// },
|
|
40
|
+
// });
|
|
41
|
+
// };
|
|
42
|
+
//
|
|
43
|
+
// const openCamera = async () => {
|
|
44
|
+
// block.camera = false;
|
|
45
|
+
// dispatch({
|
|
46
|
+
// type: "update",
|
|
47
|
+
// payload: {
|
|
48
|
+
// block: {
|
|
49
|
+
// ...block,
|
|
50
|
+
// },
|
|
51
|
+
// },
|
|
52
|
+
// });
|
|
53
|
+
// };
|
|
54
|
+
//
|
|
55
|
+
// const moveToCamera = async () => {
|
|
56
|
+
// if (mode.control === "orbit" && moveTo) {
|
|
57
|
+
// await moveTo(
|
|
58
|
+
// makeOrbitCameraPosition(activeState, cameraOption),
|
|
59
|
+
// activeState.position
|
|
60
|
+
// );
|
|
61
|
+
// } else if (mode.control === "normal" && moveTo) {
|
|
62
|
+
// await moveTo(
|
|
63
|
+
// makeNormalCameraPosition(activeState, cameraOption),
|
|
64
|
+
// activeState.position
|
|
65
|
+
// );
|
|
66
|
+
// }
|
|
67
|
+
// };
|
|
68
|
+
//
|
|
69
|
+
// const setZoom = async (position: THREE.Vector3, isZoom: boolean) => {
|
|
70
|
+
// setIsZoom(isZoom);
|
|
71
|
+
// await closeCamera(position);
|
|
72
|
+
// await moveToCamera();
|
|
73
|
+
// await openCamera();
|
|
74
|
+
// };
|
|
75
|
+
//
|
|
76
|
+
// return {
|
|
77
|
+
// setZoom,
|
|
78
|
+
// openCamera,
|
|
79
|
+
// closeCamera,
|
|
80
|
+
// isZoom,
|
|
81
|
+
// setIsZoom,
|
|
82
|
+
// moveToCamera,
|
|
83
|
+
// };
|
|
84
|
+
// }
|
|
85
|
+
//
|
|
86
|
+
// export function ZoomButton(props: zoomButtonPropsType) {
|
|
87
|
+
// const { setZoom, isZoom } = useZoom();
|
|
88
|
+
//
|
|
89
|
+
// return (
|
|
90
|
+
// <div
|
|
91
|
+
// className="zoomButton"
|
|
92
|
+
// style={{
|
|
93
|
+
// ...props.zoomButtonStyle,
|
|
94
|
+
// }}
|
|
95
|
+
// onClick={async () => {
|
|
96
|
+
// await setZoom(props.position, isZoom);
|
|
97
|
+
// }}
|
|
98
|
+
// >
|
|
99
|
+
// {props.children}
|
|
100
|
+
// </div>
|
|
101
|
+
// );
|
|
102
|
+
// }
|
|
@@ -114,7 +114,6 @@ export var gaesupWorldDefault = {
|
|
|
114
114
|
position: vec3(),
|
|
115
115
|
focus: false,
|
|
116
116
|
},
|
|
117
|
-
moveTo: null,
|
|
118
117
|
rideable: {},
|
|
119
118
|
sizes: {},
|
|
120
119
|
block: {
|
|
@@ -123,9 +122,6 @@ export var gaesupWorldDefault = {
|
|
|
123
122
|
animation: false,
|
|
124
123
|
scroll: true,
|
|
125
124
|
},
|
|
126
|
-
callback: {
|
|
127
|
-
moveTo: null,
|
|
128
|
-
},
|
|
129
125
|
clickerOption: {
|
|
130
126
|
isRun: true,
|
|
131
127
|
throttle: 100,
|
|
@@ -19,13 +19,9 @@ export declare function gaesupWorldReducer(props: Partial<gaesupWorldContextType
|
|
|
19
19
|
cameraOption?: import("./type").cameraOptionType;
|
|
20
20
|
clickerOption?: import("./type").clickerOptionType;
|
|
21
21
|
clicker?: import("./type").clickerType;
|
|
22
|
-
moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
23
22
|
rideable?: {
|
|
24
23
|
[key: string]: import("../../hooks/useRideable/type").rideableType;
|
|
25
24
|
};
|
|
26
25
|
sizes?: import("./type").sizesType;
|
|
27
26
|
block?: import("./type").blockType;
|
|
28
|
-
callback?: {
|
|
29
|
-
moveTo: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
30
|
-
};
|
|
31
27
|
};
|
|
@@ -162,15 +162,11 @@ export type gaesupWorldContextType = {
|
|
|
162
162
|
cameraOption: cameraOptionType;
|
|
163
163
|
clickerOption: clickerOptionType;
|
|
164
164
|
clicker: clickerType;
|
|
165
|
-
moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
|
|
166
165
|
rideable: {
|
|
167
166
|
[key: string]: rideableType;
|
|
168
167
|
};
|
|
169
168
|
sizes: sizesType;
|
|
170
169
|
block: blockType;
|
|
171
|
-
callback: {
|
|
172
|
-
moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
|
|
173
|
-
};
|
|
174
170
|
};
|
|
175
171
|
export type gaesupDisptachType = dispatchType<gaesupWorldContextType>;
|
|
176
172
|
export {};
|
|
@@ -19,15 +19,11 @@ export default function initGaesupWorld(props: gaesupWorldPropsType): {
|
|
|
19
19
|
cameraOption?: import("../context/type").cameraOptionType;
|
|
20
20
|
clickerOption?: import("../context/type").clickerOptionType;
|
|
21
21
|
clicker?: import("../context/type").clickerType;
|
|
22
|
-
moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
23
22
|
rideable?: {
|
|
24
23
|
[key: string]: import("../../hooks/useRideable/type").rideableType;
|
|
25
24
|
};
|
|
26
25
|
sizes?: import("../context/type").sizesType;
|
|
27
26
|
block?: import("../context/type").blockType;
|
|
28
|
-
callback?: {
|
|
29
|
-
moveTo: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
30
|
-
};
|
|
31
27
|
};
|
|
32
28
|
dispatch: import("react").Dispatch<{
|
|
33
29
|
type: string;
|
|
@@ -31,12 +31,8 @@ export default function initGaesupWorld(props) {
|
|
|
31
31
|
clickerOption: Object.assign(gaesupWorldDefault.clickerOption, props.clickerOption || {}),
|
|
32
32
|
animationState: gaesupWorldDefault.animationState,
|
|
33
33
|
keyBoardMap: Object.assign(gaesupWorldDefault.keyBoardMap, props.keyBoardMap || {}),
|
|
34
|
-
moveTo: null,
|
|
35
34
|
block: Object.assign(gaesupWorldDefault.block, props.block || {}),
|
|
36
35
|
sizes: gaesupWorldDefault.sizes,
|
|
37
|
-
callback: {
|
|
38
|
-
moveTo: null,
|
|
39
|
-
},
|
|
40
36
|
}), value = _a[0], dispatch = _a[1];
|
|
41
37
|
useEffect(function () {
|
|
42
38
|
var _a;
|
|
@@ -15,7 +15,6 @@ export type gaesupWorldPropsType = {
|
|
|
15
15
|
debug?: boolean;
|
|
16
16
|
keyBoardMap?: keyboardMapType;
|
|
17
17
|
cameraOption?: cameraOptionType;
|
|
18
|
-
moveTo?: (position: THREE.Vector3, target: THREE.Vector3) => void;
|
|
19
18
|
block?: blockType;
|
|
20
19
|
clickerOption?: clickerOptionType;
|
|
21
20
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export { JumpPortal } from "./gaesup/tools/jumpPortal";
|
|
|
12
12
|
export { KeyBoardToolTip } from "./gaesup/tools/keyBoardToolTip";
|
|
13
13
|
export { MiniMap } from "./gaesup/tools/miniMap";
|
|
14
14
|
export { Rideable } from "./gaesup/tools/rideable";
|
|
15
|
-
export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
16
15
|
export { InnerHtml } from "./gaesup/utils/innerHtml";
|
|
17
16
|
export { Elr, Qt, V3, V30, V31 } from "./gaesup/utils/vector";
|
|
18
17
|
export { GaesupWorld } from "./gaesup/world";
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { JumpPortal } from "./gaesup/tools/jumpPortal";
|
|
|
12
12
|
export { KeyBoardToolTip } from "./gaesup/tools/keyBoardToolTip";
|
|
13
13
|
export { MiniMap } from "./gaesup/tools/miniMap";
|
|
14
14
|
export { Rideable } from "./gaesup/tools/rideable";
|
|
15
|
-
export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
15
|
+
// export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
16
16
|
export { InnerHtml } from "./gaesup/utils/innerHtml";
|
|
17
17
|
export { Elr, Qt, V3, V30, V31 } from "./gaesup/utils/vector";
|
|
18
18
|
export { GaesupWorld } from "./gaesup/world";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaesup-world",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"@react-three/fiber": "8.16.2",
|
|
14
14
|
"@react-three/postprocessing": "^2.16.2",
|
|
15
15
|
"@react-three/rapier": "^1.3.1",
|
|
16
|
+
"@types/lodash": "^4.17.0",
|
|
16
17
|
"@types/three": "^0.164.0",
|
|
17
18
|
"gh-pages": "^6.1.1",
|
|
18
19
|
"jotai": "^2.8.0",
|
|
@@ -28,7 +29,6 @@
|
|
|
28
29
|
"three-stdlib": "^2.29.7"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@types/lodash": "^4.17.0",
|
|
32
32
|
"@types/react": "^18.3.1",
|
|
33
33
|
"@types/react-dom": "^18.3.0",
|
|
34
34
|
"@vanilla-extract/css": "^1.14.2",
|