gaesup-world 0.7.95 → 0.8.2
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/component/index.d.ts +1 -3
- package/dist/gaesup/component/index.js +2 -2
- package/dist/gaesup/component/inner/common/RigidbodyRef.d.ts +6 -1
- package/dist/gaesup/component/inner/common/RigidbodyRef.js +13 -2
- package/dist/gaesup/component/inner/common/type.d.ts +2 -3
- package/dist/gaesup/component/inner/vehicle/index.js +3 -4
- package/dist/gaesup/component/passive/type.d.ts +5 -0
- package/dist/gaesup/component/passive/vehicle/index.js +1 -1
- package/dist/gaesup/controller/context/index.d.ts +5 -5
- package/dist/gaesup/controller/context/index.js +5 -5
- package/dist/gaesup/controller/context/reducer.d.ts +1 -1
- package/dist/gaesup/controller/index.js +3 -3
- 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 -2
- package/dist/gaesup/physics/airplane/innerCalc.js +1 -1
- package/dist/gaesup/physics/check/moving.js +3 -2
- package/dist/gaesup/physics/index.js +1 -1
- package/dist/gaesup/tools/clicker/index.js +2 -2
- package/dist/gaesup/tools/miniMap/index.js +4 -4
- package/dist/gaesup/tools/miniMap/type.d.ts +1 -1
- package/dist/gaesup/tools/rideable/index.js +6 -6
- package/dist/gaesup/tools/rideable/type.d.ts +4 -0
- 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 +3 -3
- package/dist/gaesup/world/context/reducer.d.ts +1 -4
- package/dist/gaesup/world/context/type.d.ts +5 -4
- package/dist/gaesup/world/initalize/index.d.ts +1 -4
- package/dist/gaesup/world/initalize/index.js +1 -4
- package/dist/gaesup/world/type.d.ts +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/package.json +9 -9
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { controllerInnerType, refsType } from "../controller/type";
|
|
2
|
-
|
|
3
|
-
export declare function GaesupComponent({ props, refs, urls, }: {
|
|
2
|
+
export declare function GaesupComponent({ props, refs, }: {
|
|
4
3
|
props: controllerInnerType;
|
|
5
4
|
refs: refsType;
|
|
6
|
-
urls: urlsType;
|
|
7
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,8 +17,8 @@ import { AirplaneRef } from "./active/airplane";
|
|
|
17
17
|
import { CharacterRef } from "./active/character";
|
|
18
18
|
import { VehicleRef } from "./active/vehicle";
|
|
19
19
|
export function GaesupComponent(_a) {
|
|
20
|
-
var props = _a.props, refs = _a.refs
|
|
21
|
-
var _b = useContext(GaesupWorldContext), mode = _b.mode, states = _b.states, rideable = _b.rideable;
|
|
20
|
+
var props = _a.props, refs = _a.refs;
|
|
21
|
+
var _b = useContext(GaesupWorldContext), mode = _b.mode, states = _b.states, rideable = _b.rideable, urls = _b.urls;
|
|
22
22
|
var enableRiding = states.enableRiding, isRiderOn = states.isRiderOn, rideableId = states.rideableId;
|
|
23
23
|
return (_jsxs(_Fragment, { children: [mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls, children: props.children })), mode.type === "vehicle" && (_jsx(VehicleRef, __assign({ controllerOptions: props.controllerOptions, url: urls.vehicleUrl, wheelUrl: urls.wheelUrl, ridingUrl: urls.ridingUrl, enableRiding: enableRiding, isRiderOn: isRiderOn, groundRay: props.groundRay, offset: rideableId && rideable[rideableId]
|
|
24
24
|
? rideable[rideableId].offset
|
|
@@ -6,10 +6,10 @@ export declare const RigidBodyRef: import("react").ForwardRefExoticComponent<{
|
|
|
6
6
|
userData?: {
|
|
7
7
|
intangible: boolean;
|
|
8
8
|
};
|
|
9
|
-
onCollisionEnter?: (e: import("@react-three/rapier").CollisionEnterPayload) => Promise<void>;
|
|
10
9
|
isActive?: boolean;
|
|
11
10
|
ridingUrl?: string;
|
|
12
11
|
groundRay?: import("../../../controller/type").groundRayType;
|
|
12
|
+
rigidBodyProps?: RapierRigidBody;
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode;
|
|
15
15
|
groundRay?: import("../../../controller/type").groundRayType;
|
|
@@ -22,9 +22,14 @@ export declare const RigidBodyRef: import("react").ForwardRefExoticComponent<{
|
|
|
22
22
|
controllerOptions?: import("../../../controller/type").controllerOptionsType;
|
|
23
23
|
currentAnimation?: string;
|
|
24
24
|
rigidbodyType?: import("@react-three/rapier").RigidBodyTypeString;
|
|
25
|
+
sensor?: boolean;
|
|
26
|
+
onIntersectionEnter?: (e: import("@react-three/rapier").CollisionEnterPayload) => Promise<void>;
|
|
25
27
|
onCollisionEnter?: (e: import("@react-three/rapier").CollisionEnterPayload) => Promise<void>;
|
|
26
28
|
componentType: import("../../passive/type").componentTypeString;
|
|
27
29
|
userData?: {
|
|
28
30
|
intangible: boolean;
|
|
29
31
|
};
|
|
32
|
+
rigidBodyProps?: RapierRigidBody;
|
|
33
|
+
outerGroupProps?: THREE.Group<THREE.Object3DEventMap>;
|
|
34
|
+
innerGroupProps?: THREE.Group<THREE.Object3DEventMap>;
|
|
30
35
|
} & import("./type").ridingType & import("../../passive/type").innerRefType & import("../../../controller/initialize/callback/type").callbackType & import("react").RefAttributes<RapierRigidBody>>;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { useAnimations, useGLTF } from "@react-three/drei";
|
|
3
14
|
import { useFrame, useGraph } from "@react-three/fiber";
|
|
@@ -72,7 +83,7 @@ export var RigidBodyRef = forwardRef(function (props, ref) {
|
|
|
72
83
|
return;
|
|
73
84
|
ref.current.setTranslation(V3(THREE.MathUtils.lerp(ref.current.translation().x, props.position.x, props.controllerOptions.lerp.cameraPosition), THREE.MathUtils.lerp(ref.current.translation().y, props.position.y, props.controllerOptions.lerp.cameraPosition), THREE.MathUtils.lerp(ref.current.translation().z, props.position.z, props.controllerOptions.lerp.cameraPosition)), false);
|
|
74
85
|
});
|
|
75
|
-
return (_jsxs(RigidBody, { colliders: false, ref: ref, name: props.name, rotation: euler()
|
|
86
|
+
return (_jsxs(RigidBody, __assign({ colliders: false, ref: ref, name: props.name, rotation: euler()
|
|
76
87
|
.set(0, ((_a = props.rotation) === null || _a === void 0 ? void 0 : _a.clone().y) || 0, 0)
|
|
77
|
-
.clone(), userData: props.userData,
|
|
88
|
+
.clone(), userData: props.userData, type: props.rigidbodyType || (props.isActive ? "dynamic" : "fixed"), sensor: props.sensor, onIntersectionEnter: props.onIntersectionEnter, onCollisionEnter: props.onCollisionEnter }, props.rigidBodyProps, { children: [_jsx(CapsuleCollider, { ref: props.colliderRef, args: [(size.y / 2 - size.x) * 1.2, size.x * 1.2], position: [0, (size.y / 2 + size.x / 2) * 1.2, 0] }), props.children, _jsx(InnerGroupRef, { objectNode: objectNode, animationRef: animationRef, nodes: nodes, ref: props.innerGroupRef, isActive: props.isActive, isRiderOn: props.isRiderOn, enableRiding: props.enableRiding, ridingUrl: props.ridingUrl, offset: props.offset, children: props.children })] })));
|
|
78
89
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collider } from "@dimforge/rapier3d-compat";
|
|
2
|
-
import {
|
|
2
|
+
import { RapierRigidBody, RigidBodyTypeString } from "@react-three/rapier";
|
|
3
3
|
import { MutableRefObject, RefObject } from "react";
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
import { callbackType } from "../../../controller/initialize/callback/type";
|
|
@@ -40,7 +40,6 @@ export type refPropsType = {
|
|
|
40
40
|
intangible: boolean;
|
|
41
41
|
};
|
|
42
42
|
currentAnimation?: string;
|
|
43
|
-
onCollisionEnter?: (e: CollisionEnterPayload) => Promise<void>;
|
|
44
43
|
type?: RigidBodyTypeString;
|
|
45
44
|
};
|
|
46
45
|
export type setGroundRayType = {
|
|
@@ -53,8 +52,8 @@ export type rigidBodyRefType = {
|
|
|
53
52
|
userData?: {
|
|
54
53
|
intangible: boolean;
|
|
55
54
|
};
|
|
56
|
-
onCollisionEnter?: (e: CollisionEnterPayload) => Promise<void>;
|
|
57
55
|
isActive?: boolean;
|
|
58
56
|
ridingUrl?: string;
|
|
59
57
|
groundRay?: groundRayType;
|
|
58
|
+
rigidBodyProps?: RapierRigidBody;
|
|
60
59
|
} & passivePropsType & innerRefType & callbackType;
|
|
@@ -10,13 +10,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useGltfAndSize } from "../../../hooks/useGaesupGltf";
|
|
14
13
|
import { OuterGroupRef } from "../common/OuterGroupRef";
|
|
15
14
|
import { RigidBodyRef } from "../common/RigidbodyRef";
|
|
16
15
|
export function VehicleInnerRef(props) {
|
|
17
16
|
var rigidBodyRef = props.rigidBodyRef, outerGroupRef = props.outerGroupRef;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
17
|
+
// const { size } = useGltfAndSize({
|
|
18
|
+
// url: props.url,
|
|
19
|
+
// });
|
|
21
20
|
return (_jsx(OuterGroupRef, { ref: outerGroupRef, children: _jsx(RigidBodyRef, __assign({ ref: rigidBodyRef, name: props.name, componentType: "vehicle", ridingUrl: props.ridingUrl }, props, { children: props.children })) }));
|
|
22
21
|
}
|
|
@@ -23,9 +23,14 @@ export type passivePropsType = {
|
|
|
23
23
|
controllerOptions?: controllerOptionsType;
|
|
24
24
|
currentAnimation?: string;
|
|
25
25
|
rigidbodyType?: RigidBodyTypeString;
|
|
26
|
+
sensor?: boolean;
|
|
27
|
+
onIntersectionEnter?: (e: CollisionEnterPayload) => Promise<void>;
|
|
26
28
|
onCollisionEnter?: (e: CollisionEnterPayload) => Promise<void>;
|
|
27
29
|
componentType: componentTypeString;
|
|
28
30
|
userData?: {
|
|
29
31
|
intangible: boolean;
|
|
30
32
|
};
|
|
33
|
+
rigidBodyProps?: RapierRigidBody;
|
|
34
|
+
outerGroupProps?: THREE.Group;
|
|
35
|
+
innerGroupProps?: THREE.Group;
|
|
31
36
|
} & ridingType;
|
|
@@ -28,5 +28,5 @@ export function PassiveVehicle(props) {
|
|
|
28
28
|
cameraTurn: 1,
|
|
29
29
|
cameraPosition: 1,
|
|
30
30
|
},
|
|
31
|
-
}, position: props.position, rotation: props.rotation, currentAnimation: props.currentAnimation, ridingUrl: props.ridingUrl }, props, refs, { children: props.children })));
|
|
31
|
+
}, position: props.position, rotation: props.rotation, currentAnimation: props.currentAnimation, url: props.url, ridingUrl: props.ridingUrl }, props, refs, { children: props.children })));
|
|
32
32
|
}
|
|
@@ -38,11 +38,11 @@ export declare const gaesupControllerDefault: {
|
|
|
38
38
|
innerGroupRef: any;
|
|
39
39
|
characterInnerRef: any;
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
controllerOptions: {
|
|
42
|
+
lerp: {
|
|
43
|
+
cameraTurn: number;
|
|
44
|
+
cameraPosition: number;
|
|
45
|
+
};
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export declare const GaesupControllerContext: import("react").Context<gaesupControllerType>;
|
|
@@ -48,11 +48,11 @@ export var gaesupControllerDefault = {
|
|
|
48
48
|
innerGroupRef: null,
|
|
49
49
|
characterInnerRef: null,
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
controllerOptions: {
|
|
52
|
+
lerp: {
|
|
53
|
+
cameraTurn: 1,
|
|
54
|
+
cameraPosition: 1,
|
|
55
|
+
},
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
export var GaesupControllerContext = createContext(__assign({}, gaesupControllerDefault));
|
|
@@ -6,7 +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
|
-
|
|
9
|
+
controllerOptions: import("../type").controllerOptionsType;
|
|
10
10
|
callbacks?: import("../initialize/callback/type").callbackType;
|
|
11
11
|
refs?: import("../type").refsType;
|
|
12
12
|
};
|
|
@@ -40,7 +40,6 @@ export function GaesupControllerInner(props) {
|
|
|
40
40
|
onDestory: props.onDestory,
|
|
41
41
|
onAnimate: props.onAnimate,
|
|
42
42
|
}),
|
|
43
|
-
urls: Object.assign(gaesupControllerDefault.urls, props.urls || {}),
|
|
44
43
|
refs: {
|
|
45
44
|
colliderRef: colliderRef,
|
|
46
45
|
rigidBodyRef: rigidBodyRef,
|
|
@@ -48,6 +47,7 @@ export function GaesupControllerInner(props) {
|
|
|
48
47
|
innerGroupRef: innerGroupRef,
|
|
49
48
|
characterInnerRef: characterInnerRef,
|
|
50
49
|
},
|
|
50
|
+
controllerOptions: Object.assign(gaesupControllerDefault.controllerOptions, props.controllerOptions || {}),
|
|
51
51
|
}), controller = _a[0], controllerDispatch = _a[1];
|
|
52
52
|
var gaesupControl = useMemo(function () { return ({
|
|
53
53
|
value: controller,
|
|
@@ -65,11 +65,11 @@ export function GaesupControllerInner(props) {
|
|
|
65
65
|
}, []);
|
|
66
66
|
var prop = __assign(__assign(__assign(__assign({}, initControllerProps({
|
|
67
67
|
refs: refs,
|
|
68
|
-
})), { 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);
|
|
69
69
|
initDebug({
|
|
70
70
|
controllerContext: gaesupControl.value,
|
|
71
71
|
controllerDispatch: gaesupControl.dispatch,
|
|
72
72
|
});
|
|
73
73
|
var ContextBridge = useContextBridge(GaesupWorldContext, GaesupControllerContext);
|
|
74
|
-
return (_jsx(ContextBridge, { children: _jsx(GaesupControllerContext.Provider, { value: gaesupControl.value, children: _jsx(GaesupControllerDispatchContext.Provider, { value: gaesupControl.dispatch, children: _jsx(GaesupComponent, { props: prop, refs: refs
|
|
74
|
+
return (_jsx(ContextBridge, { children: _jsx(GaesupControllerContext.Provider, { value: gaesupControl.value, children: _jsx(GaesupControllerDispatchContext.Provider, { value: gaesupControl.dispatch, children: _jsx(GaesupComponent, { props: prop, refs: refs }) }) }) }));
|
|
75
75
|
}
|
|
@@ -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,7 +81,7 @@ export type gaesupControllerContextPropType = {
|
|
|
81
81
|
airplane: airplaneType;
|
|
82
82
|
vehicle: vehicleType;
|
|
83
83
|
character: characterType;
|
|
84
|
-
|
|
84
|
+
controllerOptions: controllerOptionsType;
|
|
85
85
|
};
|
|
86
86
|
export interface controllerOtherPropType extends RigidBodyProps {
|
|
87
87
|
children?: ReactNode;
|
|
@@ -89,4 +89,6 @@ export interface controllerOtherPropType extends RigidBodyProps {
|
|
|
89
89
|
rigidBodyProps?: RigidBodyProps;
|
|
90
90
|
debug?: boolean;
|
|
91
91
|
}
|
|
92
|
-
export type controllerType = controllerOtherPropType & Partial<gaesupControllerContextPropType> & callbackType
|
|
92
|
+
export type controllerType = controllerOtherPropType & urlsType & Partial<gaesupControllerContextPropType> & callbackType & {
|
|
93
|
+
controllerOptions?: controllerOptionsType;
|
|
94
|
+
};
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { quat, vec3 } from "@react-three/rapier";
|
|
13
13
|
export default function innerCalc(prop) {
|
|
14
|
-
var rigidBodyRef = prop.rigidBodyRef,
|
|
14
|
+
var rigidBodyRef = prop.rigidBodyRef, activeState = prop.worldContext.activeState, dispatch = prop.dispatch;
|
|
15
15
|
activeState.position = vec3(rigidBodyRef.current.translation());
|
|
16
16
|
activeState.velocity = vec3(rigidBodyRef.current.linvel());
|
|
17
17
|
var _euler = activeState.euler.clone();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default function moving(prop) {
|
|
2
|
-
var _a = prop.worldContext, states = _a.states, joystick = _a.joystick, mode = _a.mode, control = _a.control, clicker = _a.clicker;
|
|
2
|
+
var _a = prop.worldContext, states = _a.states, joystick = _a.joystick, mode = _a.mode, control = _a.control, clicker = _a.clicker, clickerOption = _a.clickerOption;
|
|
3
3
|
var forward = control.forward, backward = control.backward, leftward = control.leftward, rightward = control.rightward, shift = control.shift, space = control.space;
|
|
4
4
|
if (mode.controller === "gameboy" || mode.controller === "keyboard") {
|
|
5
5
|
states.isMoving = forward || backward || leftward || rightward;
|
|
@@ -16,7 +16,8 @@ export default function moving(prop) {
|
|
|
16
16
|
else if (mode.controller === "clicker") {
|
|
17
17
|
states.isMoving = clicker.isOn;
|
|
18
18
|
states.isNotMoving = !clicker.isOn;
|
|
19
|
-
states.isRunning =
|
|
19
|
+
states.isRunning =
|
|
20
|
+
(shift || clicker.isRun) && states.isMoving && clickerOption.isRun;
|
|
20
21
|
states.isJumping = space;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
@@ -54,7 +54,7 @@ export default function calculation(_a) {
|
|
|
54
54
|
worldContext: worldContext,
|
|
55
55
|
controllerContext: controllerContext,
|
|
56
56
|
dispatch: dispatch,
|
|
57
|
-
matchSizes: getSizesByUrls(
|
|
57
|
+
matchSizes: getSizesByUrls(worldContext === null || worldContext === void 0 ? void 0 : worldContext.urls),
|
|
58
58
|
};
|
|
59
59
|
if (mode.type === "vehicle")
|
|
60
60
|
vehicleCalculation(calcProp);
|
|
@@ -3,6 +3,6 @@ import { useContext } from "react";
|
|
|
3
3
|
import { GaesupWorldContext } from "../../world/context";
|
|
4
4
|
export function Clicker(_a) {
|
|
5
5
|
var onMarker = _a.onMarker, runMarker = _a.runMarker;
|
|
6
|
-
var _b = useContext(GaesupWorldContext), clicker = _b.clicker, mode = _b.mode;
|
|
7
|
-
return (_jsx(_Fragment, { children: mode.controller === "clicker" && (_jsxs("group", { position: clicker.point, children: [clicker.isOn && onMarker, clicker.isOn && clicker.isRun && runMarker] })) }));
|
|
6
|
+
var _b = useContext(GaesupWorldContext), clicker = _b.clicker, mode = _b.mode, clickerOption = _b.clickerOption;
|
|
7
|
+
return (_jsx(_Fragment, { children: mode.controller === "clicker" && (_jsxs("group", { position: clicker.point, children: [clicker.isOn && onMarker, clicker.isOn && clickerOption.isRun && clicker.isRun && runMarker] })) }));
|
|
8
8
|
}
|
|
@@ -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;
|
|
@@ -46,13 +46,13 @@ import "./style.css";
|
|
|
46
46
|
export function Rideable(props) {
|
|
47
47
|
var _this = this;
|
|
48
48
|
var _a;
|
|
49
|
-
var _b = useContext(GaesupWorldContext), states = _b.states, rideable = _b.rideable
|
|
50
|
-
var _c = useRideable(), initRideable = _c.initRideable,
|
|
49
|
+
var _b = useContext(GaesupWorldContext), states = _b.states, rideable = _b.rideable;
|
|
50
|
+
var _c = useRideable(), initRideable = _c.initRideable, ride = _c.ride, landing = _c.landing;
|
|
51
51
|
// const current = getRideable(props.objectkey);
|
|
52
|
-
var
|
|
52
|
+
var _rideable = useState({
|
|
53
53
|
position: props.position || V3(0, 0, 0),
|
|
54
54
|
rotation: props.rotation || euler(),
|
|
55
|
-
})
|
|
55
|
+
})[0];
|
|
56
56
|
useEffect(function () {
|
|
57
57
|
initRideable(props);
|
|
58
58
|
}, []);
|
|
@@ -63,7 +63,7 @@ export function Rideable(props) {
|
|
|
63
63
|
landing(props.objectkey);
|
|
64
64
|
}
|
|
65
65
|
}, [states === null || states === void 0 ? void 0 : states.isRiding]);
|
|
66
|
-
var
|
|
66
|
+
var onIntersectionEnter = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
|
67
67
|
return __generator(this, function (_a) {
|
|
68
68
|
switch (_a.label) {
|
|
69
69
|
case 0: return [4 /*yield*/, ride(e, props)];
|
|
@@ -73,5 +73,5 @@ export function Rideable(props) {
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}); };
|
|
76
|
-
return (_jsx(_Fragment, { children: ((_a = rideable === null || rideable === void 0 ? void 0 : rideable[props.objectkey]) === null || _a === void 0 ? void 0 : _a.visible) && (_jsxs("group", { userData: { intangible: true }, children: [props.objectType === "vehicle" && (_jsx(PassiveVehicle, { controllerOptions: props.controllerOptions, position:
|
|
76
|
+
return (_jsx(_Fragment, { children: ((_a = rideable === null || rideable === void 0 ? void 0 : rideable[props.objectkey]) === null || _a === void 0 ? void 0 : _a.visible) && (_jsxs("group", { userData: { intangible: true }, children: [props.objectType === "vehicle" && (_jsx(PassiveVehicle, { controllerOptions: props.controllerOptions, position: _rideable.position, rotation: _rideable.rotation, currentAnimation: "idle", url: props.url, wheelUrl: props.wheelUrl, ridingUrl: props.ridingUrl, offset: props.offset, enableRiding: props.enableRiding, rigidBodyProps: props.rigidBodyProps, sensor: true, onIntersectionEnter: onIntersectionEnter })), props.objectType === "airplane" && (_jsx(PassiveAirplane, { controllerOptions: props.controllerOptions, position: _rideable.position.clone(), rotation: _rideable.rotation.clone(), currentAnimation: "idle", url: props.url, ridingUrl: props.ridingUrl, offset: props.offset, enableRiding: props.enableRiding, rigidBodyProps: props.rigidBodyProps, sensor: true, onIntersectionEnter: onIntersectionEnter }))] })) }));
|
|
77
77
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RapierRigidBody } from "@react-three/rapier";
|
|
1
2
|
import * as THREE from "three";
|
|
2
3
|
import { controllerOptionsType } from "../../controller/type";
|
|
3
4
|
export type rideablePropType = {
|
|
@@ -18,4 +19,7 @@ export type rideablePropType = {
|
|
|
18
19
|
vehicleSize?: THREE.Vector3;
|
|
19
20
|
wheelSize?: THREE.Vector3;
|
|
20
21
|
airplaneSize?: THREE.Vector3;
|
|
22
|
+
rigidBodyProps?: RapierRigidBody;
|
|
23
|
+
outerGroupProps?: THREE.Group;
|
|
24
|
+
innerGroupProps?: THREE.Group;
|
|
21
25
|
};
|
|
@@ -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,8 +122,9 @@ export var gaesupWorldDefault = {
|
|
|
123
122
|
animation: false,
|
|
124
123
|
scroll: true,
|
|
125
124
|
},
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
clickerOption: {
|
|
126
|
+
isRun: true,
|
|
127
|
+
throttle: 100,
|
|
128
128
|
},
|
|
129
129
|
};
|
|
130
130
|
export var GaesupWorldContext = createContext(null);
|
|
@@ -17,14 +17,11 @@ export declare function gaesupWorldReducer(props: Partial<gaesupWorldContextType
|
|
|
17
17
|
animationState?: import("./type").animationStateType;
|
|
18
18
|
keyBoardMap?: import("../../tools/keyBoardToolTip/type").keyboardMapType;
|
|
19
19
|
cameraOption?: import("./type").cameraOptionType;
|
|
20
|
+
clickerOption?: import("./type").clickerOptionType;
|
|
20
21
|
clicker?: import("./type").clickerType;
|
|
21
|
-
moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
22
22
|
rideable?: {
|
|
23
23
|
[key: string]: import("../../hooks/useRideable/type").rideableType;
|
|
24
24
|
};
|
|
25
25
|
sizes?: import("./type").sizesType;
|
|
26
26
|
block?: import("./type").blockType;
|
|
27
|
-
callback?: {
|
|
28
|
-
moveTo: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
29
|
-
};
|
|
30
27
|
};
|
|
@@ -107,6 +107,10 @@ export type clickerType = {
|
|
|
107
107
|
isOn: boolean;
|
|
108
108
|
isRun: boolean;
|
|
109
109
|
};
|
|
110
|
+
export type clickerOptionType = {
|
|
111
|
+
isRun: boolean;
|
|
112
|
+
throttle: number;
|
|
113
|
+
};
|
|
110
114
|
export type wheelStateType = {
|
|
111
115
|
position: THREE.Vector3;
|
|
112
116
|
rotation: THREE.Euler;
|
|
@@ -156,16 +160,13 @@ export type gaesupWorldContextType = {
|
|
|
156
160
|
animationState: animationStateType;
|
|
157
161
|
keyBoardMap: keyboardMapType;
|
|
158
162
|
cameraOption: cameraOptionType;
|
|
163
|
+
clickerOption: clickerOptionType;
|
|
159
164
|
clicker: clickerType;
|
|
160
|
-
moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
|
|
161
165
|
rideable: {
|
|
162
166
|
[key: string]: rideableType;
|
|
163
167
|
};
|
|
164
168
|
sizes: sizesType;
|
|
165
169
|
block: blockType;
|
|
166
|
-
callback: {
|
|
167
|
-
moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
|
|
168
|
-
};
|
|
169
170
|
};
|
|
170
171
|
export type gaesupDisptachType = dispatchType<gaesupWorldContextType>;
|
|
171
172
|
export {};
|
|
@@ -17,16 +17,13 @@ export default function initGaesupWorld(props: gaesupWorldPropsType): {
|
|
|
17
17
|
animationState?: import("../context/type").animationStateType;
|
|
18
18
|
keyBoardMap?: import("../../tools/keyBoardToolTip/type").keyboardMapType;
|
|
19
19
|
cameraOption?: import("../context/type").cameraOptionType;
|
|
20
|
+
clickerOption?: import("../context/type").clickerOptionType;
|
|
20
21
|
clicker?: import("../context/type").clickerType;
|
|
21
|
-
moveTo?: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
22
22
|
rideable?: {
|
|
23
23
|
[key: string]: import("../../hooks/useRideable/type").rideableType;
|
|
24
24
|
};
|
|
25
25
|
sizes?: import("../context/type").sizesType;
|
|
26
26
|
block?: import("../context/type").blockType;
|
|
27
|
-
callback?: {
|
|
28
|
-
moveTo: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
|
|
29
|
-
};
|
|
30
27
|
};
|
|
31
28
|
dispatch: import("react").Dispatch<{
|
|
32
29
|
type: string;
|
|
@@ -28,14 +28,11 @@ export default function initGaesupWorld(props) {
|
|
|
28
28
|
joystick: gaesupWorldDefault.joystick,
|
|
29
29
|
control: gaesupWorldDefault.control,
|
|
30
30
|
clicker: gaesupWorldDefault.clicker,
|
|
31
|
+
clickerOption: Object.assign(gaesupWorldDefault.clickerOption, props.clickerOption || {}),
|
|
31
32
|
animationState: gaesupWorldDefault.animationState,
|
|
32
33
|
keyBoardMap: Object.assign(gaesupWorldDefault.keyBoardMap, props.keyBoardMap || {}),
|
|
33
|
-
moveTo: null,
|
|
34
34
|
block: Object.assign(gaesupWorldDefault.block, props.block || {}),
|
|
35
35
|
sizes: gaesupWorldDefault.sizes,
|
|
36
|
-
callback: {
|
|
37
|
-
moveTo: null,
|
|
38
|
-
},
|
|
39
36
|
}), value = _a[0], dispatch = _a[1];
|
|
40
37
|
useEffect(function () {
|
|
41
38
|
var _a;
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { keyboardMapType } from "../tools/keyBoardToolTip/type";
|
|
4
4
|
import { dispatchType } from "../utils/type";
|
|
5
|
-
import { blockType, cameraOptionType, gaesupWorldContextType, modeType, urlsType } from "./context/type";
|
|
5
|
+
import { blockType, cameraOptionType, clickerOptionType, gaesupWorldContextType, modeType, urlsType } from "./context/type";
|
|
6
6
|
export type gaesupWorldInitType = {
|
|
7
7
|
value: gaesupWorldContextType;
|
|
8
8
|
dispatch: dispatchType<gaesupWorldContextType>;
|
|
@@ -15,6 +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;
|
|
19
|
+
clickerOption?: clickerOptionType;
|
|
20
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.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,24 +13,24 @@
|
|
|
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/
|
|
16
|
+
"@types/lodash": "^4.17.0",
|
|
17
|
+
"@types/three": "^0.164.0",
|
|
17
18
|
"gh-pages": "^6.1.1",
|
|
18
19
|
"jotai": "^2.8.0",
|
|
19
20
|
"leva": "0.9.35",
|
|
20
21
|
"lodash": "^4.17.21",
|
|
21
22
|
"node-fetch": "3.3.2",
|
|
22
|
-
"react": "^18.
|
|
23
|
+
"react": "^18.3.1",
|
|
23
24
|
"react-device-detect": "^2.2.3",
|
|
24
|
-
"react-dom": "^18.
|
|
25
|
+
"react-dom": "^18.3.1",
|
|
25
26
|
"react-icons": "^5.1.0",
|
|
26
27
|
"react-use-refs": "^1.0.1",
|
|
27
|
-
"three": "^0.
|
|
28
|
-
"three-stdlib": "^2.29.
|
|
28
|
+
"three": "^0.164.1",
|
|
29
|
+
"three-stdlib": "^2.29.7"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@types/
|
|
32
|
-
"@types/react": "^18.
|
|
33
|
-
"@types/react-dom": "^18.2.25",
|
|
32
|
+
"@types/react": "^18.3.1",
|
|
33
|
+
"@types/react-dom": "^18.3.0",
|
|
34
34
|
"@vanilla-extract/css": "^1.14.2",
|
|
35
35
|
"@vanilla-extract/dynamic": "^2.1.0",
|
|
36
36
|
"@vanilla-extract/recipes": "^0.5.2",
|