gaesup-world 0.7.33 → 0.7.92
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/active/character/index.d.ts +3 -1
- package/dist/gaesup/component/active/character/index.js +2 -2
- package/dist/gaesup/component/index.js +1 -1
- package/dist/gaesup/controller/index.js +3 -2
- package/dist/gaesup/physics/character/impulse.js +0 -2
- package/dist/gaesup/tools/miniMap/index.js +1 -9
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { controllerInnerType, refsType } from "../../../controller/type";
|
|
2
3
|
import { urlsType } from "../../../world/context/type";
|
|
3
|
-
export declare function CharacterRef({ props, refs, urls, }: {
|
|
4
|
+
export declare function CharacterRef({ children, props, refs, urls, }: {
|
|
5
|
+
children: React.ReactNode;
|
|
4
6
|
props: controllerInnerType;
|
|
5
7
|
refs: refsType;
|
|
6
8
|
urls: urlsType;
|
|
@@ -12,6 +12,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { CharacterInnerRef } from "../../inner/character";
|
|
14
14
|
export function CharacterRef(_a) {
|
|
15
|
-
var props = _a.props, refs = _a.refs, urls = _a.urls;
|
|
16
|
-
return (_jsx(CharacterInnerRef, __assign({ url: urls.characterUrl, isActive: true, componentType: "character", rigidbodyType: "dynamic", controllerOptions: props.controllerOptions, groundRay: props.groundRay, onAnimate: props.onAnimate, onFrame: props.onFrame, onReady: props.onReady, onDestory: props.onDestory }, refs, { children:
|
|
15
|
+
var children = _a.children, props = _a.props, refs = _a.refs, urls = _a.urls;
|
|
16
|
+
return (_jsx(CharacterInnerRef, __assign({ url: urls.characterUrl, isActive: true, componentType: "character", rigidbodyType: "dynamic", controllerOptions: props.controllerOptions, groundRay: props.groundRay, onAnimate: props.onAnimate, onFrame: props.onFrame, onReady: props.onReady, onDestory: props.onDestory }, refs, { children: children })));
|
|
17
17
|
}
|
|
@@ -20,7 +20,7 @@ export function GaesupComponent(_a) {
|
|
|
20
20
|
var props = _a.props, refs = _a.refs, urls = _a.urls;
|
|
21
21
|
var _b = useContext(GaesupWorldContext), mode = _b.mode, states = _b.states, rideable = _b.rideable;
|
|
22
22
|
var enableRiding = states.enableRiding, isRiderOn = states.isRiderOn, rideableId = states.rideableId;
|
|
23
|
-
return (_jsxs(_Fragment, { children: [mode.type === "character" && (_jsx(CharacterRef, { props: props, refs: refs, urls: urls })), 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]
|
|
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
|
|
25
25
|
: vec3() }, refs, { children: props.children }))), mode.type === "airplane" && (_jsx(AirplaneRef, __assign({ controllerOptions: props.controllerOptions, url: urls.airplaneUrl, ridingUrl: urls.ridingUrl, enableRiding: enableRiding, isRiderOn: isRiderOn, groundRay: props.groundRay, offset: rideableId && rideable[rideableId]
|
|
26
26
|
? rideable[rideableId].offset
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useContext, useMemo, useReducer, useRef } from "react";
|
|
15
|
-
import { KeyboardControls } from "@react-three/drei";
|
|
15
|
+
import { KeyboardControls, useContextBridge } from "@react-three/drei";
|
|
16
16
|
import { GaesupComponent } from "../component";
|
|
17
17
|
import { GaesupWorldContext } from "../world/context";
|
|
18
18
|
import { GaesupControllerContext, GaesupControllerDispatchContext, gaesupControllerDefault, } from "./context";
|
|
@@ -70,5 +70,6 @@ export function GaesupControllerInner(props) {
|
|
|
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, urls: props.urls }) }) }) }));
|
|
74
75
|
}
|
|
@@ -16,8 +16,6 @@ export default function impulse(prop) {
|
|
|
16
16
|
var _b = prop.controllerContext.character, walkSpeed = _b.walkSpeed, runSpeed = _b.runSpeed, jumpSpeed = _b.jumpSpeed;
|
|
17
17
|
var isOnTheGround = states.isOnTheGround, isJumping = states.isJumping;
|
|
18
18
|
var impulse = vec3();
|
|
19
|
-
console.log(isJumping ? "점프중" : "점프안함");
|
|
20
|
-
console.log(isOnTheGround ? "땅에있음" : "땅에없음");
|
|
21
19
|
if (isJumping && isOnTheGround) {
|
|
22
20
|
impulse.setY(jumpSpeed * rigidBodyRef.current.mass());
|
|
23
21
|
}
|
|
@@ -53,15 +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 }, objectStyle) }, key), _jsx("div", { className: "
|
|
57
|
-
width: "".concat(size.x * scale, "rem"),
|
|
58
|
-
height: "".concat(size.z * scale, "rem"),
|
|
59
|
-
top: "50%",
|
|
60
|
-
left: "50%",
|
|
61
|
-
transform: "translate(-50.1%, -50.1%) translate(".concat(-X, "rem, ").concat(-Z, "rem) rotate(").concat((Math.PI * 3) / 2 + props.angle || 0, "rad)"),
|
|
62
|
-
transformOrigin: "50% 50%",
|
|
63
|
-
zIndex: 1 + key,
|
|
64
|
-
} }, key), _jsx("div", { className: "textObject", style: {
|
|
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 }, objectStyle) }), 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: {
|
|
65
57
|
width: "".concat(size.x * scale, "rem"),
|
|
66
58
|
height: "".concat(size.z * scale, "rem"),
|
|
67
59
|
top: "50.1%",
|