gaesup-world 0.2.21 → 0.2.23

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.
Files changed (216) hide show
  1. package/package.json +5 -2
  2. package/dist/gaesup/animation/actions.d.ts +0 -44
  3. package/dist/gaesup/animation/actions.js +0 -103
  4. package/dist/gaesup/camera/control/normal.d.ts +0 -4
  5. package/dist/gaesup/camera/control/normal.js +0 -18
  6. package/dist/gaesup/camera/control/orbit.d.ts +0 -4
  7. package/dist/gaesup/camera/control/orbit.js +0 -22
  8. package/dist/gaesup/camera/detector/index.d.ts +0 -2
  9. package/dist/gaesup/camera/detector/index.js +0 -25
  10. package/dist/gaesup/camera/index.d.ts +0 -8
  11. package/dist/gaesup/camera/index.js +0 -139
  12. package/dist/gaesup/camera/type.d.ts +0 -13
  13. package/dist/gaesup/camera/type.js +0 -1
  14. package/dist/gaesup/component/active/airplane/index.d.ts +0 -11
  15. package/dist/gaesup/component/active/airplane/index.js +0 -6
  16. package/dist/gaesup/component/active/character/index.d.ts +0 -7
  17. package/dist/gaesup/component/active/character/index.js +0 -34
  18. package/dist/gaesup/component/active/vehicle/index.d.ts +0 -12
  19. package/dist/gaesup/component/active/vehicle/index.js +0 -31
  20. package/dist/gaesup/component/index.d.ts +0 -7
  21. package/dist/gaesup/component/index.js +0 -19
  22. package/dist/gaesup/component/inner/airplane/index.d.ts +0 -2
  23. package/dist/gaesup/component/inner/airplane/index.js +0 -16
  24. package/dist/gaesup/component/inner/character/index.d.ts +0 -25
  25. package/dist/gaesup/component/inner/character/index.js +0 -28
  26. package/dist/gaesup/component/inner/common/InnerGroupRef.d.ts +0 -10
  27. package/dist/gaesup/component/inner/common/InnerGroupRef.js +0 -29
  28. package/dist/gaesup/component/inner/common/OuterGroupRef.d.ts +0 -4
  29. package/dist/gaesup/component/inner/common/OuterGroupRef.js +0 -6
  30. package/dist/gaesup/component/inner/common/RigidbodyRef.d.ts +0 -12
  31. package/dist/gaesup/component/inner/common/RigidbodyRef.js +0 -7
  32. package/dist/gaesup/component/inner/common/setGroundRay.d.ts +0 -9
  33. package/dist/gaesup/component/inner/common/setGroundRay.js +0 -14
  34. package/dist/gaesup/component/inner/common/type.d.ts +0 -20
  35. package/dist/gaesup/component/inner/common/type.js +0 -1
  36. package/dist/gaesup/component/inner/rider/index.d.ts +0 -11
  37. package/dist/gaesup/component/inner/rider/index.js +0 -31
  38. package/dist/gaesup/component/inner/vehicle/collider.d.ts +0 -10
  39. package/dist/gaesup/component/inner/vehicle/collider.js +0 -19
  40. package/dist/gaesup/component/inner/vehicle/index.d.ts +0 -2
  41. package/dist/gaesup/component/inner/vehicle/index.js +0 -17
  42. package/dist/gaesup/component/inner/vehicle/wheels.d.ts +0 -7
  43. package/dist/gaesup/component/inner/vehicle/wheels.js +0 -64
  44. package/dist/gaesup/component/passive/airplane/index.d.ts +0 -13
  45. package/dist/gaesup/component/passive/airplane/index.js +0 -40
  46. package/dist/gaesup/component/passive/character/index.d.ts +0 -10
  47. package/dist/gaesup/component/passive/character/index.js +0 -46
  48. package/dist/gaesup/component/passive/type.d.ts +0 -20
  49. package/dist/gaesup/component/passive/type.js +0 -1
  50. package/dist/gaesup/component/passive/vehicle/index.d.ts +0 -13
  51. package/dist/gaesup/component/passive/vehicle/index.js +0 -17
  52. package/dist/gaesup/component/type.d.ts +0 -17
  53. package/dist/gaesup/component/type.js +0 -1
  54. package/dist/gaesup/controller/context/index.d.ts +0 -49
  55. package/dist/gaesup/controller/context/index.js +0 -59
  56. package/dist/gaesup/controller/context/reducer.d.ts +0 -12
  57. package/dist/gaesup/controller/context/reducer.js +0 -21
  58. package/dist/gaesup/controller/context/type.d.ts +0 -38
  59. package/dist/gaesup/controller/context/type.js +0 -1
  60. package/dist/gaesup/controller/debug/airplane.d.ts +0 -71
  61. package/dist/gaesup/controller/debug/airplane.js +0 -71
  62. package/dist/gaesup/controller/debug/character.d.ts +0 -27
  63. package/dist/gaesup/controller/debug/character.js +0 -27
  64. package/dist/gaesup/controller/debug/index.d.ts +0 -6
  65. package/dist/gaesup/controller/debug/index.js +0 -49
  66. package/dist/gaesup/controller/debug/vehicle.d.ts +0 -27
  67. package/dist/gaesup/controller/debug/vehicle.js +0 -27
  68. package/dist/gaesup/controller/index.d.ts +0 -3
  69. package/dist/gaesup/controller/index.js +0 -74
  70. package/dist/gaesup/controller/initialize/callback/index.d.ts +0 -2
  71. package/dist/gaesup/controller/initialize/callback/index.js +0 -62
  72. package/dist/gaesup/controller/initialize/callback/type.d.ts +0 -27
  73. package/dist/gaesup/controller/initialize/callback/type.js +0 -1
  74. package/dist/gaesup/controller/initialize/index.d.ts +0 -10
  75. package/dist/gaesup/controller/initialize/index.js +0 -75
  76. package/dist/gaesup/controller/type.d.ts +0 -85
  77. package/dist/gaesup/controller/type.js +0 -1
  78. package/dist/gaesup/gaesupProps/index.d.ts +0 -7
  79. package/dist/gaesup/gaesupProps/index.js +0 -46
  80. package/dist/gaesup/hooks/useGaesupAnimation/index.d.ts +0 -10
  81. package/dist/gaesup/hooks/useGaesupAnimation/index.js +0 -95
  82. package/dist/gaesup/hooks/useGaesupController/index.d.ts +0 -10
  83. package/dist/gaesup/hooks/useGaesupController/index.js +0 -14
  84. package/dist/gaesup/hooks/useGaesupGltf/index.d.ts +0 -25
  85. package/dist/gaesup/hooks/useGaesupGltf/index.js +0 -73
  86. package/dist/gaesup/hooks/useJoyStick/index.d.ts +0 -39
  87. package/dist/gaesup/hooks/useJoyStick/index.js +0 -61
  88. package/dist/gaesup/hooks/usePushKey/index.d.ts +0 -3
  89. package/dist/gaesup/hooks/usePushKey/index.js +0 -29
  90. package/dist/gaesup/hooks/useRideable/index.d.ts +0 -28
  91. package/dist/gaesup/hooks/useRideable/index.js +0 -199
  92. package/dist/gaesup/hooks/useTeleport/index.d.ts +0 -3
  93. package/dist/gaesup/hooks/useTeleport/index.js +0 -12
  94. package/dist/gaesup/physics/airplane/damping.d.ts +0 -2
  95. package/dist/gaesup/physics/airplane/damping.js +0 -5
  96. package/dist/gaesup/physics/airplane/direction.d.ts +0 -2
  97. package/dist/gaesup/physics/airplane/direction.js +0 -65
  98. package/dist/gaesup/physics/airplane/gravity.d.ts +0 -14
  99. package/dist/gaesup/physics/airplane/gravity.js +0 -18
  100. package/dist/gaesup/physics/airplane/impulse.d.ts +0 -16
  101. package/dist/gaesup/physics/airplane/impulse.js +0 -31
  102. package/dist/gaesup/physics/airplane/index.d.ts +0 -2
  103. package/dist/gaesup/physics/airplane/index.js +0 -14
  104. package/dist/gaesup/physics/airplane/innerCalc.d.ts +0 -2
  105. package/dist/gaesup/physics/airplane/innerCalc.js +0 -27
  106. package/dist/gaesup/physics/airplane/landing.d.ts +0 -2
  107. package/dist/gaesup/physics/airplane/landing.js +0 -29
  108. package/dist/gaesup/physics/character/direction.d.ts +0 -23
  109. package/dist/gaesup/physics/character/direction.js +0 -55
  110. package/dist/gaesup/physics/character/impulse.d.ts +0 -2
  111. package/dist/gaesup/physics/character/impulse.js +0 -43
  112. package/dist/gaesup/physics/character/index.d.ts +0 -2
  113. package/dist/gaesup/physics/character/index.js +0 -8
  114. package/dist/gaesup/physics/character/innerCalc.d.ts +0 -2
  115. package/dist/gaesup/physics/character/innerCalc.js +0 -31
  116. package/dist/gaesup/physics/check/ground.d.ts +0 -2
  117. package/dist/gaesup/physics/check/ground.js +0 -15
  118. package/dist/gaesup/physics/check/index.d.ts +0 -2
  119. package/dist/gaesup/physics/check/index.js +0 -12
  120. package/dist/gaesup/physics/check/moving.d.ts +0 -2
  121. package/dist/gaesup/physics/check/moving.js +0 -16
  122. package/dist/gaesup/physics/check/push.d.ts +0 -2
  123. package/dist/gaesup/physics/check/push.js +0 -6
  124. package/dist/gaesup/physics/check/riding.d.ts +0 -2
  125. package/dist/gaesup/physics/check/riding.js +0 -7
  126. package/dist/gaesup/physics/check/rotate.d.ts +0 -2
  127. package/dist/gaesup/physics/check/rotate.js +0 -8
  128. package/dist/gaesup/physics/index.d.ts +0 -2
  129. package/dist/gaesup/physics/index.js +0 -58
  130. package/dist/gaesup/physics/type.d.ts +0 -36
  131. package/dist/gaesup/physics/type.js +0 -1
  132. package/dist/gaesup/physics/vehicle/damping.d.ts +0 -2
  133. package/dist/gaesup/physics/vehicle/damping.js +0 -6
  134. package/dist/gaesup/physics/vehicle/direction.d.ts +0 -4
  135. package/dist/gaesup/physics/vehicle/direction.js +0 -30
  136. package/dist/gaesup/physics/vehicle/impulse.d.ts +0 -16
  137. package/dist/gaesup/physics/vehicle/impulse.js +0 -40
  138. package/dist/gaesup/physics/vehicle/index.d.ts +0 -2
  139. package/dist/gaesup/physics/vehicle/index.js +0 -12
  140. package/dist/gaesup/physics/vehicle/innerCalc.d.ts +0 -2
  141. package/dist/gaesup/physics/vehicle/innerCalc.js +0 -24
  142. package/dist/gaesup/physics/vehicle/landing.d.ts +0 -2
  143. package/dist/gaesup/physics/vehicle/landing.js +0 -29
  144. package/dist/gaesup/tools/gameBoy/GameBoyButton.d.ts +0 -9
  145. package/dist/gaesup/tools/gameBoy/GameBoyButton.js +0 -16
  146. package/dist/gaesup/tools/gameBoy/index.d.ts +0 -8
  147. package/dist/gaesup/tools/gameBoy/index.js +0 -22
  148. package/dist/gaesup/tools/gameBoy/type.d.ts +0 -4
  149. package/dist/gaesup/tools/gameBoy/type.js +0 -1
  150. package/dist/gaesup/tools/gamePad/GamePadButton.d.ts +0 -8
  151. package/dist/gaesup/tools/gamePad/GamePadButton.js +0 -21
  152. package/dist/gaesup/tools/gamePad/index.d.ts +0 -6
  153. package/dist/gaesup/tools/gamePad/index.js +0 -32
  154. package/dist/gaesup/tools/gamePad/type.d.ts +0 -6
  155. package/dist/gaesup/tools/gamePad/type.js +0 -1
  156. package/dist/gaesup/tools/joyStick/index.d.ts +0 -6
  157. package/dist/gaesup/tools/joyStick/index.js +0 -169
  158. package/dist/gaesup/tools/joyStick/type.d.ts +0 -19
  159. package/dist/gaesup/tools/joyStick/type.js +0 -1
  160. package/dist/gaesup/tools/jumpPortal/index.d.ts +0 -16
  161. package/dist/gaesup/tools/jumpPortal/index.js +0 -18
  162. package/dist/gaesup/tools/keyBoardToolTip/constant.d.ts +0 -402
  163. package/dist/gaesup/tools/keyBoardToolTip/constant.js +0 -122
  164. package/dist/gaesup/tools/keyBoardToolTip/default.d.ts +0 -10
  165. package/dist/gaesup/tools/keyBoardToolTip/default.js +0 -12
  166. package/dist/gaesup/tools/keyBoardToolTip/index.d.ts +0 -3
  167. package/dist/gaesup/tools/keyBoardToolTip/index.js +0 -70
  168. package/dist/gaesup/tools/keyBoardToolTip/type.d.ts +0 -37
  169. package/dist/gaesup/tools/keyBoardToolTip/type.js +0 -1
  170. package/dist/gaesup/tools/miniMap/default.d.ts +0 -9
  171. package/dist/gaesup/tools/miniMap/default.js +0 -9
  172. package/dist/gaesup/tools/miniMap/index.d.ts +0 -3
  173. package/dist/gaesup/tools/miniMap/index.js +0 -72
  174. package/dist/gaesup/tools/miniMap/type.d.ts +0 -25
  175. package/dist/gaesup/tools/miniMap/type.js +0 -1
  176. package/dist/gaesup/tools/rideable/index.d.ts +0 -3
  177. package/dist/gaesup/tools/rideable/index.js +0 -79
  178. package/dist/gaesup/tools/type.d.ts +0 -2
  179. package/dist/gaesup/tools/type.js +0 -1
  180. package/dist/gaesup/tools/zoomButton/index.d.ts +0 -18
  181. package/dist/gaesup/tools/zoomButton/index.js +0 -146
  182. package/dist/gaesup/utils/context.d.ts +0 -2
  183. package/dist/gaesup/utils/context.js +0 -3
  184. package/dist/gaesup/utils/debug.d.ts +0 -29
  185. package/dist/gaesup/utils/debug.js +0 -36
  186. package/dist/gaesup/utils/index.d.ts +0 -3
  187. package/dist/gaesup/utils/index.js +0 -3
  188. package/dist/gaesup/utils/ray.d.ts +0 -7
  189. package/dist/gaesup/utils/ray.js +0 -6
  190. package/dist/gaesup/utils/ref.d.ts +0 -2
  191. package/dist/gaesup/utils/ref.js +0 -16
  192. package/dist/gaesup/utils/type.d.ts +0 -5
  193. package/dist/gaesup/utils/type.js +0 -1
  194. package/dist/gaesup/utils/vector.d.ts +0 -10
  195. package/dist/gaesup/utils/vector.js +0 -33
  196. package/dist/gaesup/world/context/index.d.ts +0 -6
  197. package/dist/gaesup/world/context/index.js +0 -117
  198. package/dist/gaesup/world/context/reducer.d.ts +0 -29
  199. package/dist/gaesup/world/context/reducer.js +0 -21
  200. package/dist/gaesup/world/context/type.d.ts +0 -169
  201. package/dist/gaesup/world/context/type.js +0 -1
  202. package/dist/gaesup/world/debug/cameraOption.d.ts +0 -47
  203. package/dist/gaesup/world/debug/cameraOption.js +0 -47
  204. package/dist/gaesup/world/debug/index.d.ts +0 -6
  205. package/dist/gaesup/world/debug/index.js +0 -32
  206. package/dist/gaesup/world/debug/mode.d.ts +0 -10
  207. package/dist/gaesup/world/debug/mode.js +0 -10
  208. package/dist/gaesup/world/index.d.ts +0 -3
  209. package/dist/gaesup/world/index.js +0 -9
  210. package/dist/gaesup/world/initalize/index.d.ts +0 -35
  211. package/dist/gaesup/world/initalize/index.js +0 -62
  212. package/dist/gaesup/world/type.d.ts +0 -19
  213. package/dist/gaesup/world/type.js +0 -1
  214. package/dist/index.d.ts +0 -23
  215. package/index.ts +0 -29
  216. package/yarn-error.log +0 -12152
@@ -1,146 +0,0 @@
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
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import { jsx as _jsx } from "react/jsx-runtime";
49
- import { useContext, useState } from "react";
50
- import { makeNormalCameraPosition } from "../../camera/control/normal";
51
- import { makeOrbitCameraPosition } from "../../camera/control/orbit";
52
- import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../../world/context/index";
53
- import "./style.css";
54
- export function useZoom() {
55
- var _this = this;
56
- var _a = useContext(GaesupWorldContext), moveTo = _a.moveTo, activeState = _a.activeState, cameraOption = _a.cameraOption, mode = _a.mode, block = _a.block;
57
- var dispatch = useContext(GaesupWorldDispatchContext);
58
- var _b = useState(true), isZoom = _b[0], setIsZoom = _b[1];
59
- var closeCamera = function (position) { return __awaiter(_this, void 0, void 0, function () {
60
- return __generator(this, function (_a) {
61
- cameraOption.XDistance = position.x;
62
- cameraOption.YDistance = position.y;
63
- cameraOption.ZDistance = position.z;
64
- block.camera = true;
65
- dispatch({
66
- type: "update",
67
- payload: {
68
- block: __assign({}, block),
69
- cameraOption: __assign({}, cameraOption),
70
- },
71
- });
72
- return [2 /*return*/];
73
- });
74
- }); };
75
- var openCamera = function () { return __awaiter(_this, void 0, void 0, function () {
76
- return __generator(this, function (_a) {
77
- block.camera = false;
78
- dispatch({
79
- type: "update",
80
- payload: {
81
- block: __assign({}, block),
82
- },
83
- });
84
- return [2 /*return*/];
85
- });
86
- }); };
87
- var moveToCamera = function () { return __awaiter(_this, void 0, void 0, function () {
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0:
91
- if (!(mode.control === "orbit" && moveTo)) return [3 /*break*/, 2];
92
- return [4 /*yield*/, moveTo(makeOrbitCameraPosition(activeState, cameraOption), activeState.position)];
93
- case 1:
94
- _a.sent();
95
- return [3 /*break*/, 4];
96
- case 2:
97
- if (!(mode.control === "normal" && moveTo)) return [3 /*break*/, 4];
98
- return [4 /*yield*/, moveTo(makeNormalCameraPosition(activeState, cameraOption), activeState.position)];
99
- case 3:
100
- _a.sent();
101
- _a.label = 4;
102
- case 4: return [2 /*return*/];
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: 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,2 +0,0 @@
1
- import { dispatchType } from "./type";
2
- export declare const update: <T>(payload: Partial<T>, dispatch: dispatchType<T>) => void;
@@ -1,3 +0,0 @@
1
- export var update = function (payload, dispatch) {
2
- dispatch({ type: "update", payload: payload });
3
- };
@@ -1,29 +0,0 @@
1
- type valueType = string | number | THREE.Vector3 | THREE.Quaternion | THREE.Euler;
2
- type constantType = {
3
- [key: string]: valueType;
4
- };
5
- type changeDebugMapItem = {
6
- min: number;
7
- max: number;
8
- step: number;
9
- };
10
- type chagneDebugVectorMapItem = {
11
- x: changeDebugMapItem;
12
- y: changeDebugMapItem;
13
- z: changeDebugMapItem;
14
- };
15
- type changeDebugOptionItem = {
16
- options: string[];
17
- };
18
- type changeDebugMapType<T> = {
19
- [K in keyof T]: changeDebugMapItem | chagneDebugVectorMapItem | changeDebugOptionItem;
20
- };
21
- export type debugPropType<T extends constantType> = {
22
- debug: boolean;
23
- tag: string;
24
- debugProps: T;
25
- } & {
26
- debugMap: changeDebugMapType<T>;
27
- };
28
- export default function debug<T extends constantType>(props: debugPropType<T>): T;
29
- export {};
@@ -1,36 +0,0 @@
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
- };
12
- import { useControls } from "leva";
13
- export default function debug(props) {
14
- var debug = props.debug, tag = props.tag, debugMap = props.debugMap;
15
- if (debug) {
16
- var resultMap = Object.keys(props.debugProps).reduce(function (map, key) {
17
- if (key in debugMap) {
18
- var debugMapItem = debugMap[key];
19
- if ("max" in debugMapItem) {
20
- map[key] = __assign({ value: props.debugProps[key] }, debugMapItem);
21
- }
22
- else if ("options" in debugMapItem) {
23
- map[key] = __assign({ value: props.debugProps[key] }, debugMapItem);
24
- }
25
- else {
26
- map[key] = __assign(__assign(__assign({ value: props.debugProps[key] }, debugMapItem.x), debugMapItem.y), debugMapItem.z);
27
- }
28
- }
29
- return map;
30
- }, {});
31
- props.debugProps = useControls(tag, __assign({}, resultMap), {
32
- collapsed: true,
33
- });
34
- }
35
- return props.debugProps;
36
- }
@@ -1,3 +0,0 @@
1
- export * from "./ray";
2
- export * from "./ref";
3
- export * from "./vector";
@@ -1,3 +0,0 @@
1
- export * from "./ray";
2
- export * from "./ref";
3
- export * from "./vector";
@@ -1,7 +0,0 @@
1
- import { Collider } from "@dimforge/rapier3d-compat";
2
- import { MutableRefObject } from "react";
3
- import { rayType } from "../controller/type";
4
- export declare const getRayHit: <T extends rayType>({ ray, ref, }: {
5
- ray: T;
6
- ref: MutableRefObject<Collider>;
7
- }) => import("@dimforge/rapier3d-compat").RayColliderToi;
@@ -1,6 +0,0 @@
1
- import { useRapier } from "@react-three/rapier";
2
- export var getRayHit = function (_a) {
3
- var ray = _a.ray, ref = _a.ref;
4
- var world = useRapier().world;
5
- return world.castRay(ray.rayCast, ray.length, true, undefined, undefined, ref.current, undefined);
6
- };
@@ -1,2 +0,0 @@
1
- import { ForwardedRef } from "react";
2
- export declare const useForwardRef: <T>(ref: ForwardedRef<T>, initialValue?: any) => import("react").MutableRefObject<T>;
@@ -1,16 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- export var useForwardRef = function (ref, initialValue) {
3
- if (initialValue === void 0) { initialValue = null; }
4
- var targetRef = useRef(initialValue);
5
- useEffect(function () {
6
- if (!ref)
7
- return;
8
- if (typeof ref === "function") {
9
- ref(targetRef.current);
10
- }
11
- else {
12
- targetRef.current = ref.current;
13
- }
14
- }, [ref]);
15
- return targetRef;
16
- };
@@ -1,5 +0,0 @@
1
- import { Dispatch } from "react";
2
- export type dispatchType<T> = Dispatch<{
3
- type: string;
4
- payload?: Partial<T>;
5
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import * as THREE from "three";
2
- export declare function isVectorNonZero(v: THREE.Vector3): boolean;
3
- export declare function isValidOrZero(condision: boolean, vector: THREE.Vector3): THREE.Vector3;
4
- export declare function isValidOrOne(condision: boolean, vector: THREE.Vector3): THREE.Vector3;
5
- export declare function V3(x?: number, y?: number, z?: number): THREE.Vector3;
6
- export declare function V30(): THREE.Vector3;
7
- export declare function V31(): THREE.Vector3;
8
- export declare function Qt(x?: number, y?: number, z?: number, w?: number): THREE.Quaternion;
9
- export declare function Elr(x: number, y: number, z: number): THREE.Euler;
10
- export declare function calcAngleByVector(dir: THREE.Vector3): number;
@@ -1,33 +0,0 @@
1
- import * as THREE from "three";
2
- export function isVectorNonZero(v) {
3
- return v.toArray().every(function (value) { return value !== 0; });
4
- }
5
- export function isValidOrZero(condision, vector) {
6
- return condision ? vector : new THREE.Vector3(0, 0, 0);
7
- }
8
- export function isValidOrOne(condision, vector) {
9
- return condision ? vector : new THREE.Vector3(1, 1, 1);
10
- }
11
- export function V3(x, y, z) {
12
- return new THREE.Vector3(x, y, z);
13
- }
14
- export function V30() {
15
- return new THREE.Vector3(0, 0, 0);
16
- }
17
- export function V31() {
18
- return new THREE.Vector3(1, 1, 1);
19
- }
20
- export function Qt(x, y, z, w) {
21
- return new THREE.Quaternion(x, y, z, w);
22
- }
23
- export function Elr(x, y, z) {
24
- return new THREE.Euler(x, y, z);
25
- }
26
- export function calcAngleByVector(dir) {
27
- var axis = V3(0, 0, 1);
28
- var angles = Math.acos(dir.dot(axis) / dir.length());
29
- var product = dir.cross(axis);
30
- var isLeft = Math.sin(product.y) || 1;
31
- var angle = Math.PI - angles * isLeft;
32
- return angle;
33
- }
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { dispatchType } from "../../utils/type";
3
- import { gaesupWorldContextType } from "./type";
4
- export declare const gaesupWorldDefault: gaesupWorldContextType;
5
- export declare const GaesupWorldContext: import("react").Context<gaesupWorldContextType>;
6
- export declare const GaesupWorldDispatchContext: import("react").Context<dispatchType<gaesupWorldContextType>>;
@@ -1,117 +0,0 @@
1
- import { euler, quat, vec3 } from "@react-three/rapier";
2
- import { createContext } from "react";
3
- import { V3 } from "../../utils/vector";
4
- export var gaesupWorldDefault = {
5
- activeState: {
6
- position: V3(0, 1, 5),
7
- impulse: vec3(),
8
- velocity: vec3(),
9
- acceleration: vec3(),
10
- quat: quat(),
11
- euler: euler(),
12
- rotation: euler(),
13
- dir: vec3(),
14
- direction: vec3(),
15
- },
16
- mode: {},
17
- urls: {
18
- characterUrl: null,
19
- vehicleUrl: null,
20
- airplaneUrl: null,
21
- wheelUrl: null,
22
- },
23
- states: {
24
- rideableId: null,
25
- isMoving: false,
26
- isNotMoving: false,
27
- isOnTheGround: false,
28
- isOnMoving: false,
29
- isRotated: false,
30
- isRunning: false,
31
- isJumping: false,
32
- enableRiding: false,
33
- isRiderOn: false,
34
- isLanding: false,
35
- isPush: {
36
- forward: false,
37
- backward: false,
38
- leftward: false,
39
- rightward: false,
40
- },
41
- },
42
- debug: false,
43
- minimap: {
44
- props: {},
45
- },
46
- joystick: {
47
- joyStickOrigin: {
48
- x: 0,
49
- y: 0,
50
- angle: Math.PI / 2,
51
- currentRadius: 0,
52
- originRadius: 0,
53
- isIn: true,
54
- isOn: false,
55
- isUp: true,
56
- isCenter: true,
57
- },
58
- joyStickBall: {
59
- top: "50%",
60
- left: "50%",
61
- },
62
- },
63
- control: {
64
- forward: false,
65
- backward: false,
66
- leftward: false,
67
- rightward: false,
68
- },
69
- refs: null,
70
- animationState: {
71
- character: {
72
- current: "idle",
73
- default: "idle",
74
- store: {},
75
- },
76
- vehicle: {
77
- current: "idle",
78
- default: "idle",
79
- store: {},
80
- },
81
- airplane: {
82
- current: "idle",
83
- default: "idle",
84
- store: {},
85
- },
86
- },
87
- keyBoardMap: [
88
- { name: "forward", keys: ["ArrowUp", "KeyW"] },
89
- { name: "backward", keys: ["ArrowDown", "KeyS"] },
90
- { name: "leftward", keys: ["ArrowLeft", "KeyA"] },
91
- { name: "rightward", keys: ["ArrowRight", "KeyD"] },
92
- { name: "space", keys: ["Space"] },
93
- { name: "shift", keys: ["Shift"] },
94
- { name: "keyZ", keys: ["KeyZ"] },
95
- ],
96
- cameraOption: {
97
- offset: V3(-10, -10, -10),
98
- maxDistance: -7,
99
- distance: -1,
100
- XDistance: 20,
101
- YDistance: 10,
102
- ZDistance: 20,
103
- },
104
- moveTo: null,
105
- rideable: {},
106
- sizes: {},
107
- block: {
108
- camera: false,
109
- control: false,
110
- scroll: true,
111
- },
112
- callback: {
113
- moveTo: null,
114
- },
115
- };
116
- export var GaesupWorldContext = createContext(null);
117
- export var GaesupWorldDispatchContext = createContext(null);
@@ -1,29 +0,0 @@
1
- import { gaesupWorldContextType } from "./type";
2
- export declare function gaesupWorldReducer(props: gaesupWorldContextType, action: {
3
- type: string;
4
- payload?: Partial<gaesupWorldContextType>;
5
- }): {
6
- activeState: import("./type").activeStateType;
7
- mode: import("./type").modeType;
8
- urls: import("./type").urlsType;
9
- states: import("./type").statesType;
10
- debug: boolean;
11
- minimap: import("../../tools/miniMap/type").minimapInnerType;
12
- joystick: import("../../tools/joyStick/type").joyStickInnerType;
13
- control: {
14
- [x: string]: boolean;
15
- };
16
- refs: import("../../controller/type").refsType;
17
- animationState: import("./type").animationStateType;
18
- keyBoardMap: import("../../tools/keyBoardToolTip/type").keyboardMapType;
19
- cameraOption: import("./type").cameraOptionType;
20
- moveTo: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
21
- rideable: {
22
- [key: string]: import("./type").rideableType;
23
- };
24
- sizes: import("./type").sizesType;
25
- block: import("./type").blockType;
26
- callback: {
27
- moveTo: (position: import("three").Vector3, target: import("three").Vector3) => Promise<void>;
28
- };
29
- };
@@ -1,21 +0,0 @@
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
- };
12
- export function gaesupWorldReducer(props, action) {
13
- switch (action.type) {
14
- case "init": {
15
- return __assign({}, props);
16
- }
17
- case "update": {
18
- return __assign(__assign({}, props), action.payload);
19
- }
20
- }
21
- }
@@ -1,169 +0,0 @@
1
- import { CSSProperties } from "react";
2
- import { actionsType, refsType } from "../../controller/type";
3
- import { joyStickInnerType } from "../../tools/joyStick/type";
4
- import { keyboardMapType } from "../../tools/keyBoardToolTip/type";
5
- import { minimapInnerType } from "../../tools/miniMap/type";
6
- import { dispatchType } from "../../utils/type";
7
- export type gaesupCameraOptionDebugType = {
8
- maxDistance?: number;
9
- distance?: number;
10
- XDistance?: number;
11
- YDistance?: number;
12
- ZDistance?: number;
13
- };
14
- export type cameraOptionType = {
15
- offset?: THREE.Vector3;
16
- } & gaesupCameraOptionDebugType;
17
- export type controlType = {
18
- forward: boolean;
19
- backward: boolean;
20
- leftward: boolean;
21
- rightward: boolean;
22
- [key: string]: boolean;
23
- };
24
- export type keyControlType = {
25
- [key: string]: boolean;
26
- };
27
- export type portalType = {
28
- text?: string;
29
- position: THREE.Vector3;
30
- jumpPortalStlye?: CSSProperties;
31
- };
32
- export type portalsType = portalType[];
33
- export type statesType = {
34
- rideableId?: string;
35
- isMoving: boolean;
36
- isNotMoving: boolean;
37
- isOnTheGround: boolean;
38
- isOnMoving: boolean;
39
- isRotated: boolean;
40
- isRunning: boolean;
41
- isJumping: boolean;
42
- enableRiding: boolean;
43
- isRiderOn: boolean;
44
- isPush: controlType;
45
- isLanding: boolean;
46
- };
47
- export type urlsType = {
48
- characterUrl?: string;
49
- vehicleUrl?: string;
50
- airplaneUrl?: string;
51
- wheelUrl?: string;
52
- };
53
- export type animationAtomType = {
54
- tag: string;
55
- condition: () => boolean;
56
- action?: () => void;
57
- animationName?: string;
58
- key?: string;
59
- };
60
- export type animationPropType = {
61
- current: string;
62
- animationNames: actionsType;
63
- keyControl: {
64
- [key: string]: boolean;
65
- };
66
- store: {};
67
- default: string;
68
- };
69
- export type animationStatePropType = {
70
- current: string;
71
- animationNames?: actionsType;
72
- keyControl?: {
73
- [key: string]: boolean;
74
- };
75
- store: {};
76
- default: string;
77
- };
78
- export type modeType = {
79
- type?: "character" | "vehicle" | "airplane";
80
- controller?: "gameboy" | "keyboard" | "joystick";
81
- control?: "normal" | "orbit";
82
- };
83
- export type activeStateType = {
84
- position: THREE.Vector3;
85
- impulse: THREE.Vector3;
86
- velocity: THREE.Vector3;
87
- acceleration: THREE.Vector3;
88
- quat: THREE.Quaternion;
89
- euler: THREE.Euler;
90
- rotation: THREE.Euler;
91
- direction: THREE.Vector3;
92
- dir: THREE.Vector3;
93
- };
94
- export type wheelStateType = {
95
- position: THREE.Vector3;
96
- rotation: THREE.Euler;
97
- };
98
- export type blockType = {
99
- camera: boolean;
100
- control: boolean;
101
- scroll: boolean;
102
- };
103
- export type sizeType = {
104
- x: number;
105
- y: number;
106
- z: number;
107
- };
108
- export type wheelsStateType = {
109
- 0?: wheelStateType;
110
- 1?: wheelStateType;
111
- 2?: wheelStateType;
112
- 3?: wheelStateType;
113
- };
114
- export type passiveStateType = {
115
- position: THREE.Vector3;
116
- quat: THREE.Quaternion;
117
- euler: THREE.Euler;
118
- rotation: THREE.Euler;
119
- };
120
- export type rideableType = {
121
- objectkey: string;
122
- objectType?: "vehicle" | "airplane";
123
- enableRiding?: boolean;
124
- isRiderOn?: boolean;
125
- url?: string;
126
- wheelUrl?: string;
127
- position?: THREE.Vector3;
128
- rotation?: THREE.Euler;
129
- offset?: THREE.Vector3;
130
- landingOffset?: THREE.Vector3;
131
- visible?: boolean;
132
- vehicleSize?: THREE.Vector3;
133
- wheelSize?: THREE.Vector3;
134
- airplaneSize?: THREE.Vector3;
135
- };
136
- export type animationStateType = {
137
- [key: string]: animationStatePropType;
138
- };
139
- export type sizesType = {
140
- [key: string]: THREE.Vector3;
141
- };
142
- type KeyboardControlsState<T extends string = string> = {
143
- [K in T]: boolean;
144
- };
145
- export type gaesupWorldContextType = {
146
- activeState: activeStateType;
147
- mode: modeType;
148
- urls: urlsType;
149
- states: statesType;
150
- debug: boolean;
151
- minimap: minimapInnerType;
152
- joystick: joyStickInnerType;
153
- control: KeyboardControlsState<string>;
154
- refs: refsType;
155
- animationState: animationStateType;
156
- keyBoardMap: keyboardMapType;
157
- cameraOption: cameraOptionType;
158
- moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
159
- rideable: {
160
- [key: string]: rideableType;
161
- };
162
- sizes: sizesType;
163
- block: blockType;
164
- callback: {
165
- moveTo: (position: THREE.Vector3, target: THREE.Vector3) => Promise<void>;
166
- };
167
- };
168
- export type gaesupDisptachType = dispatchType<gaesupWorldContextType>;
169
- export {};
@@ -1 +0,0 @@
1
- export {};