gaesup-world 0.2.35 → 0.2.36

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 (225) hide show
  1. package/package.json +1 -1
  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 -110
  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 -75
  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/style.css +0 -48
  77. package/dist/gaesup/controller/type.d.ts +0 -85
  78. package/dist/gaesup/controller/type.js +0 -1
  79. package/dist/gaesup/gaesupProps/index.d.ts +0 -7
  80. package/dist/gaesup/gaesupProps/index.js +0 -46
  81. package/dist/gaesup/hooks/useGaesupAnimation/index.d.ts +0 -10
  82. package/dist/gaesup/hooks/useGaesupAnimation/index.js +0 -95
  83. package/dist/gaesup/hooks/useGaesupController/index.d.ts +0 -10
  84. package/dist/gaesup/hooks/useGaesupController/index.js +0 -14
  85. package/dist/gaesup/hooks/useGaesupGltf/index.d.ts +0 -25
  86. package/dist/gaesup/hooks/useGaesupGltf/index.js +0 -73
  87. package/dist/gaesup/hooks/useJoyStick/index.d.ts +0 -39
  88. package/dist/gaesup/hooks/useJoyStick/index.js +0 -61
  89. package/dist/gaesup/hooks/usePushKey/index.d.ts +0 -3
  90. package/dist/gaesup/hooks/usePushKey/index.js +0 -29
  91. package/dist/gaesup/hooks/useRideable/index.d.ts +0 -28
  92. package/dist/gaesup/hooks/useRideable/index.js +0 -199
  93. package/dist/gaesup/hooks/useTeleport/index.d.ts +0 -3
  94. package/dist/gaesup/hooks/useTeleport/index.js +0 -12
  95. package/dist/gaesup/physics/airplane/damping.d.ts +0 -2
  96. package/dist/gaesup/physics/airplane/damping.js +0 -5
  97. package/dist/gaesup/physics/airplane/direction.d.ts +0 -2
  98. package/dist/gaesup/physics/airplane/direction.js +0 -65
  99. package/dist/gaesup/physics/airplane/gravity.d.ts +0 -14
  100. package/dist/gaesup/physics/airplane/gravity.js +0 -18
  101. package/dist/gaesup/physics/airplane/impulse.d.ts +0 -16
  102. package/dist/gaesup/physics/airplane/impulse.js +0 -31
  103. package/dist/gaesup/physics/airplane/index.d.ts +0 -2
  104. package/dist/gaesup/physics/airplane/index.js +0 -14
  105. package/dist/gaesup/physics/airplane/innerCalc.d.ts +0 -2
  106. package/dist/gaesup/physics/airplane/innerCalc.js +0 -27
  107. package/dist/gaesup/physics/airplane/landing.d.ts +0 -2
  108. package/dist/gaesup/physics/airplane/landing.js +0 -29
  109. package/dist/gaesup/physics/character/direction.d.ts +0 -23
  110. package/dist/gaesup/physics/character/direction.js +0 -55
  111. package/dist/gaesup/physics/character/impulse.d.ts +0 -2
  112. package/dist/gaesup/physics/character/impulse.js +0 -43
  113. package/dist/gaesup/physics/character/index.d.ts +0 -2
  114. package/dist/gaesup/physics/character/index.js +0 -8
  115. package/dist/gaesup/physics/character/innerCalc.d.ts +0 -2
  116. package/dist/gaesup/physics/character/innerCalc.js +0 -31
  117. package/dist/gaesup/physics/check/ground.d.ts +0 -2
  118. package/dist/gaesup/physics/check/ground.js +0 -15
  119. package/dist/gaesup/physics/check/index.d.ts +0 -2
  120. package/dist/gaesup/physics/check/index.js +0 -12
  121. package/dist/gaesup/physics/check/moving.d.ts +0 -2
  122. package/dist/gaesup/physics/check/moving.js +0 -16
  123. package/dist/gaesup/physics/check/push.d.ts +0 -2
  124. package/dist/gaesup/physics/check/push.js +0 -6
  125. package/dist/gaesup/physics/check/riding.d.ts +0 -2
  126. package/dist/gaesup/physics/check/riding.js +0 -7
  127. package/dist/gaesup/physics/check/rotate.d.ts +0 -2
  128. package/dist/gaesup/physics/check/rotate.js +0 -8
  129. package/dist/gaesup/physics/index.d.ts +0 -2
  130. package/dist/gaesup/physics/index.js +0 -58
  131. package/dist/gaesup/physics/type.d.ts +0 -36
  132. package/dist/gaesup/physics/type.js +0 -1
  133. package/dist/gaesup/physics/vehicle/damping.d.ts +0 -2
  134. package/dist/gaesup/physics/vehicle/damping.js +0 -6
  135. package/dist/gaesup/physics/vehicle/direction.d.ts +0 -4
  136. package/dist/gaesup/physics/vehicle/direction.js +0 -30
  137. package/dist/gaesup/physics/vehicle/impulse.d.ts +0 -16
  138. package/dist/gaesup/physics/vehicle/impulse.js +0 -40
  139. package/dist/gaesup/physics/vehicle/index.d.ts +0 -2
  140. package/dist/gaesup/physics/vehicle/index.js +0 -12
  141. package/dist/gaesup/physics/vehicle/innerCalc.d.ts +0 -2
  142. package/dist/gaesup/physics/vehicle/innerCalc.js +0 -24
  143. package/dist/gaesup/physics/vehicle/landing.d.ts +0 -2
  144. package/dist/gaesup/physics/vehicle/landing.js +0 -29
  145. package/dist/gaesup/tools/gameBoy/GameBoyButton.d.ts +0 -9
  146. package/dist/gaesup/tools/gameBoy/GameBoyButton.js +0 -16
  147. package/dist/gaesup/tools/gameBoy/index.d.ts +0 -8
  148. package/dist/gaesup/tools/gameBoy/index.js +0 -22
  149. package/dist/gaesup/tools/gameBoy/style.css +0 -92
  150. package/dist/gaesup/tools/gameBoy/type.d.ts +0 -4
  151. package/dist/gaesup/tools/gameBoy/type.js +0 -1
  152. package/dist/gaesup/tools/gamePad/GamePadButton.d.ts +0 -8
  153. package/dist/gaesup/tools/gamePad/GamePadButton.js +0 -21
  154. package/dist/gaesup/tools/gamePad/index.d.ts +0 -6
  155. package/dist/gaesup/tools/gamePad/index.js +0 -32
  156. package/dist/gaesup/tools/gamePad/style.css +0 -62
  157. package/dist/gaesup/tools/gamePad/type.d.ts +0 -6
  158. package/dist/gaesup/tools/gamePad/type.js +0 -1
  159. package/dist/gaesup/tools/joyStick/index.d.ts +0 -6
  160. package/dist/gaesup/tools/joyStick/index.js +0 -169
  161. package/dist/gaesup/tools/joyStick/style.css +0 -38
  162. package/dist/gaesup/tools/joyStick/type.d.ts +0 -19
  163. package/dist/gaesup/tools/joyStick/type.js +0 -1
  164. package/dist/gaesup/tools/jumpPortal/index.d.ts +0 -16
  165. package/dist/gaesup/tools/jumpPortal/index.js +0 -18
  166. package/dist/gaesup/tools/jumpPortal/style.css +0 -16
  167. package/dist/gaesup/tools/keyBoardToolTip/constant.d.ts +0 -402
  168. package/dist/gaesup/tools/keyBoardToolTip/constant.js +0 -122
  169. package/dist/gaesup/tools/keyBoardToolTip/default.d.ts +0 -10
  170. package/dist/gaesup/tools/keyBoardToolTip/default.js +0 -12
  171. package/dist/gaesup/tools/keyBoardToolTip/index.d.ts +0 -3
  172. package/dist/gaesup/tools/keyBoardToolTip/index.js +0 -70
  173. package/dist/gaesup/tools/keyBoardToolTip/style.css +0 -24
  174. package/dist/gaesup/tools/keyBoardToolTip/type.d.ts +0 -37
  175. package/dist/gaesup/tools/keyBoardToolTip/type.js +0 -1
  176. package/dist/gaesup/tools/miniMap/default.d.ts +0 -9
  177. package/dist/gaesup/tools/miniMap/default.js +0 -9
  178. package/dist/gaesup/tools/miniMap/index.d.ts +0 -3
  179. package/dist/gaesup/tools/miniMap/index.js +0 -72
  180. package/dist/gaesup/tools/miniMap/style.css +0 -228
  181. package/dist/gaesup/tools/miniMap/type.d.ts +0 -25
  182. package/dist/gaesup/tools/miniMap/type.js +0 -1
  183. package/dist/gaesup/tools/rideable/index.d.ts +0 -3
  184. package/dist/gaesup/tools/rideable/index.js +0 -79
  185. package/dist/gaesup/tools/rideable/style.css +0 -16
  186. package/dist/gaesup/tools/type.d.ts +0 -2
  187. package/dist/gaesup/tools/type.js +0 -1
  188. package/dist/gaesup/tools/zoomButton/index.d.ts +0 -18
  189. package/dist/gaesup/tools/zoomButton/index.js +0 -146
  190. package/dist/gaesup/tools/zoomButton/style.css +0 -16
  191. package/dist/gaesup/utils/context.d.ts +0 -2
  192. package/dist/gaesup/utils/context.js +0 -3
  193. package/dist/gaesup/utils/debug.d.ts +0 -29
  194. package/dist/gaesup/utils/debug.js +0 -36
  195. package/dist/gaesup/utils/index.d.ts +0 -3
  196. package/dist/gaesup/utils/index.js +0 -3
  197. package/dist/gaesup/utils/ray.d.ts +0 -7
  198. package/dist/gaesup/utils/ray.js +0 -6
  199. package/dist/gaesup/utils/ref.d.ts +0 -2
  200. package/dist/gaesup/utils/ref.js +0 -16
  201. package/dist/gaesup/utils/type.d.ts +0 -5
  202. package/dist/gaesup/utils/type.js +0 -1
  203. package/dist/gaesup/utils/vector.d.ts +0 -10
  204. package/dist/gaesup/utils/vector.js +0 -33
  205. package/dist/gaesup/world/context/index.d.ts +0 -6
  206. package/dist/gaesup/world/context/index.js +0 -117
  207. package/dist/gaesup/world/context/reducer.d.ts +0 -29
  208. package/dist/gaesup/world/context/reducer.js +0 -21
  209. package/dist/gaesup/world/context/type.d.ts +0 -169
  210. package/dist/gaesup/world/context/type.js +0 -1
  211. package/dist/gaesup/world/debug/cameraOption.d.ts +0 -47
  212. package/dist/gaesup/world/debug/cameraOption.js +0 -47
  213. package/dist/gaesup/world/debug/index.d.ts +0 -6
  214. package/dist/gaesup/world/debug/index.js +0 -32
  215. package/dist/gaesup/world/debug/mode.d.ts +0 -10
  216. package/dist/gaesup/world/debug/mode.js +0 -10
  217. package/dist/gaesup/world/index.d.ts +0 -3
  218. package/dist/gaesup/world/index.js +0 -10
  219. package/dist/gaesup/world/initalize/index.d.ts +0 -35
  220. package/dist/gaesup/world/initalize/index.js +0 -62
  221. package/dist/gaesup/world/style.css +0 -13
  222. package/dist/gaesup/world/type.d.ts +0 -19
  223. package/dist/gaesup/world/type.js +0 -1
  224. package/dist/index.d.ts +0 -23
  225. package/dist/index.js +0 -23
@@ -1,71 +0,0 @@
1
- export declare const airplaneDebugMap: {
2
- angleDelta: {
3
- value: {
4
- x: number;
5
- y: number;
6
- z: number;
7
- };
8
- x: {
9
- min: number;
10
- max: number;
11
- step: number;
12
- };
13
- y: {
14
- min: number;
15
- max: number;
16
- step: number;
17
- };
18
- z: {
19
- min: number;
20
- max: number;
21
- step: number;
22
- };
23
- };
24
- maxAngle: {
25
- value: {
26
- x: number;
27
- y: number;
28
- z: number;
29
- };
30
- x: {
31
- min: number;
32
- max: number;
33
- step: number;
34
- };
35
- y: {
36
- min: number;
37
- max: number;
38
- step: number;
39
- };
40
- z: {
41
- min: number;
42
- max: number;
43
- step: number;
44
- };
45
- };
46
- maxSpeed: {
47
- min: number;
48
- max: number;
49
- step: number;
50
- };
51
- accelRatio: {
52
- min: number;
53
- max: number;
54
- step: number;
55
- };
56
- brakeRatio: {
57
- min: number;
58
- max: number;
59
- step: number;
60
- };
61
- buoyancy: {
62
- min: number;
63
- max: number;
64
- step: number;
65
- };
66
- linearDamping: {
67
- min: number;
68
- max: number;
69
- step: number;
70
- };
71
- };
@@ -1,71 +0,0 @@
1
- export var airplaneDebugMap = {
2
- angleDelta: {
3
- value: {
4
- x: 0.01,
5
- y: 0.005,
6
- z: 0.005,
7
- },
8
- x: {
9
- min: -Math.PI,
10
- max: Math.PI,
11
- step: 0.01,
12
- },
13
- y: {
14
- min: -Math.PI,
15
- max: Math.PI,
16
- step: 0.01,
17
- },
18
- z: {
19
- min: -Math.PI,
20
- max: Math.PI,
21
- step: 0.01,
22
- },
23
- },
24
- maxAngle: {
25
- value: {
26
- x: 0.1,
27
- y: 0.1,
28
- z: 0.1,
29
- },
30
- x: {
31
- min: -Math.PI,
32
- max: Math.PI,
33
- step: 0.01,
34
- },
35
- y: {
36
- min: -Math.PI,
37
- max: Math.PI,
38
- step: 0.01,
39
- },
40
- z: {
41
- min: -Math.PI,
42
- max: Math.PI,
43
- step: 0.01,
44
- },
45
- },
46
- maxSpeed: {
47
- min: 50,
48
- max: 100,
49
- step: 0.01,
50
- },
51
- accelRatio: {
52
- min: 1,
53
- max: 10,
54
- step: 0.01,
55
- },
56
- brakeRatio: {
57
- min: 1,
58
- max: 20,
59
- step: 0.01,
60
- },
61
- buoyancy: {
62
- min: 0.1,
63
- max: 1,
64
- step: 0.01,
65
- },
66
- linearDamping: {
67
- min: 0,
68
- max: 1,
69
- step: 0.01,
70
- },
71
- };
@@ -1,27 +0,0 @@
1
- export declare const characterDebugMap: {
2
- walkSpeed: {
3
- min: number;
4
- max: number;
5
- step: number;
6
- };
7
- runSpeed: {
8
- min: number;
9
- max: number;
10
- step: number;
11
- };
12
- turnSpeed: {
13
- min: number;
14
- max: number;
15
- step: number;
16
- };
17
- jumpSpeed: {
18
- min: number;
19
- max: number;
20
- step: number;
21
- };
22
- linearDamping: {
23
- min: number;
24
- max: number;
25
- step: number;
26
- };
27
- };
@@ -1,27 +0,0 @@
1
- export var characterDebugMap = {
2
- walkSpeed: {
3
- min: 1,
4
- max: 20,
5
- step: 0.01,
6
- },
7
- runSpeed: {
8
- min: 1,
9
- max: 20,
10
- step: 0.01,
11
- },
12
- turnSpeed: {
13
- min: 1,
14
- max: 20,
15
- step: 0.01,
16
- },
17
- jumpSpeed: {
18
- min: 0.1,
19
- max: 20,
20
- step: 0.01,
21
- },
22
- linearDamping: {
23
- min: -10,
24
- max: 10,
25
- step: 0.01,
26
- },
27
- };
@@ -1,6 +0,0 @@
1
- import { dispatchType } from "../../utils/type";
2
- import { gaesupControllerType } from "../context/type";
3
- export default function initDebug({ controllerContext, controllerDispatch, }: {
4
- controllerContext: gaesupControllerType;
5
- controllerDispatch: dispatchType<gaesupControllerType>;
6
- }): void;
@@ -1,49 +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 { useContext, useEffect } from "react";
13
- import { update } from "../../utils/context";
14
- import debug from "../../utils/debug";
15
- import { GaesupWorldContext } from "../../world/context";
16
- import { airplaneDebugMap } from "./airplane";
17
- import { characterDebugMap } from "./character";
18
- import { vehicleDebugMap } from "./vehicle";
19
- export default function initDebug(_a) {
20
- var controllerContext = _a.controllerContext, controllerDispatch = _a.controllerDispatch;
21
- var worldDebug = useContext(GaesupWorldContext).debug;
22
- if (!worldDebug)
23
- return;
24
- var characterOptionValue = debug({
25
- debug: worldDebug,
26
- debugProps: controllerContext.character,
27
- tag: "character",
28
- debugMap: characterDebugMap,
29
- });
30
- var vehicleOptionValue = debug({
31
- debug: worldDebug,
32
- debugProps: controllerContext.vehicle,
33
- tag: "vehicle",
34
- debugMap: vehicleDebugMap,
35
- });
36
- var airplaneOptionValue = debug({
37
- debug: worldDebug,
38
- debugProps: controllerContext.airplane,
39
- tag: "airplane",
40
- debugMap: airplaneDebugMap,
41
- });
42
- useEffect(function () {
43
- update({
44
- character: __assign({}, characterOptionValue),
45
- vehicle: __assign({}, vehicleOptionValue),
46
- airplane: __assign({}, airplaneOptionValue),
47
- }, controllerDispatch);
48
- }, [characterOptionValue, vehicleOptionValue, airplaneOptionValue]);
49
- }
@@ -1,27 +0,0 @@
1
- export declare const vehicleDebugMap: {
2
- maxSpeed: {
3
- min: number;
4
- max: number;
5
- step: number;
6
- };
7
- accelRatio: {
8
- min: number;
9
- max: number;
10
- step: number;
11
- };
12
- brakeRatio: {
13
- min: number;
14
- max: number;
15
- step: number;
16
- };
17
- wheelOffset: {
18
- min: number;
19
- max: number;
20
- step: number;
21
- };
22
- linearDamping: {
23
- min: number;
24
- max: number;
25
- step: number;
26
- };
27
- };
@@ -1,27 +0,0 @@
1
- export var vehicleDebugMap = {
2
- maxSpeed: {
3
- min: 50,
4
- max: 100,
5
- step: 0.01,
6
- },
7
- accelRatio: {
8
- min: 1,
9
- max: 10,
10
- step: 0.01,
11
- },
12
- brakeRatio: {
13
- min: 1,
14
- max: 20,
15
- step: 0.01,
16
- },
17
- wheelOffset: {
18
- min: 0.1,
19
- max: 10,
20
- step: 0.01,
21
- },
22
- linearDamping: {
23
- min: 0,
24
- max: 1,
25
- step: 0.01,
26
- },
27
- };
@@ -1,3 +0,0 @@
1
- import { controllerType } from "./type";
2
- export declare function GaesupController(props: controllerType): import("react/jsx-runtime").JSX.Element;
3
- export declare function GaesupControllerInner(props: controllerType): import("react/jsx-runtime").JSX.Element;
@@ -1,75 +0,0 @@
1
- "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { useContext, useMemo, useReducer, useRef } from "react";
15
- import Camera from "../camera";
16
- import { KeyboardControls } from "@react-three/drei";
17
- import { GaesupComponent } from "../component";
18
- import { GaesupWorldContext } from "../world/context";
19
- import { GaesupControllerContext, GaesupControllerDispatchContext, gaesupControllerDefault, } from "./context";
20
- import { gaesupControllerReducer } from "./context/reducer";
21
- import initDebug from "./debug";
22
- import initControllerProps from "./initialize";
23
- export function GaesupController(props) {
24
- var keyBoardMap = useContext(GaesupWorldContext).keyBoardMap;
25
- return (_jsx(KeyboardControls, { map: keyBoardMap, children: _jsx(GaesupControllerInner, __assign({}, props, { children: props.children })) }));
26
- }
27
- export function GaesupControllerInner(props) {
28
- var colliderRef = useRef(null);
29
- var rigidBodyRef = useRef(null);
30
- var outerGroupRef = useRef(null);
31
- var innerGroupRef = useRef(null);
32
- var characterInnerRef = useRef(null);
33
- var passiveRigidBodyRef = useRef(null);
34
- var _a = useReducer(gaesupControllerReducer, {
35
- airplane: Object.assign(gaesupControllerDefault.airplane, props.airplane || {}),
36
- vehicle: Object.assign(gaesupControllerDefault.vehicle, props.vehicle || {}),
37
- character: Object.assign(gaesupControllerDefault.character, props.character || {}),
38
- callbacks: Object.assign(gaesupControllerDefault.callbacks, {
39
- onReady: props.onReady,
40
- onFrame: props.onFrame,
41
- onDestory: props.onDestory,
42
- onAnimate: props.onAnimate,
43
- }),
44
- urls: Object.assign(gaesupControllerDefault.urls, props.urls || {}),
45
- refs: {
46
- colliderRef: colliderRef,
47
- rigidBodyRef: rigidBodyRef,
48
- outerGroupRef: outerGroupRef,
49
- innerGroupRef: innerGroupRef,
50
- characterInnerRef: characterInnerRef,
51
- },
52
- }), controller = _a[0], controllerDispatch = _a[1];
53
- var gaesupControl = useMemo(function () { return ({
54
- value: controller,
55
- dispatch: controllerDispatch,
56
- }); }, [controller, controllerDispatch]);
57
- var refs = useMemo(function () {
58
- return {
59
- colliderRef: colliderRef,
60
- rigidBodyRef: rigidBodyRef,
61
- outerGroupRef: outerGroupRef,
62
- innerGroupRef: innerGroupRef,
63
- characterInnerRef: characterInnerRef,
64
- passiveRigidBodyRef: passiveRigidBodyRef,
65
- };
66
- }, []);
67
- var prop = __assign(__assign(__assign(__assign({}, initControllerProps({
68
- refs: refs,
69
- })), { children: props.children, groupProps: props.groupProps }), gaesupControl.value.callbacks), refs);
70
- initDebug({
71
- controllerContext: gaesupControl.value,
72
- controllerDispatch: gaesupControl.dispatch,
73
- });
74
- return (_jsxs(GaesupControllerContext.Provider, { value: gaesupControl.value, children: [_jsx(Camera, { refs: refs, prop: prop, control: prop.keyControl }), _jsx(GaesupControllerDispatchContext.Provider, { value: gaesupControl.dispatch, children: _jsx(GaesupComponent, { props: prop, refs: refs, urls: props.urls }) })] }));
75
- }
@@ -1,2 +0,0 @@
1
- import { controllerInnerType } from "../../type";
2
- export default function initCallback(props: controllerInnerType, type: "character" | "vehicle" | "airplane"): void;
@@ -1,62 +0,0 @@
1
- export default function initCallback(props, type) {
2
- // const {
3
- // characterGltf,
4
- // animations: characterAnimations,
5
- // activeState,
6
- // states,
7
- // control,
8
- // } = useContext(GaesupWorldContext);
9
- // const dispatch = useContext(GaesupWorldDispatchContext);
10
- // const { animations } = characterGltf;
11
- // const { actions } = useAnimations(animations, props.outerGroupRef);
12
- // const { subscribe } = useGaesupAnimation({ type });
13
- //
14
- // const playAnimation = (tag: keyof animationTagType, key: string) => {
15
- // if (!(key in control)) return;
16
- // if (control[key]) {
17
- // characterAnimations.current = tag;
18
- // dispatch({
19
- // type: "update",
20
- // payload: {
21
- // animations: {
22
- // ...characterAnimations,
23
- // },
24
- // },
25
- // });
26
- // }
27
- // };
28
- //
29
- // const controllerProp: callbackPropType = {
30
- // ...props,
31
- // activeState,
32
- // control,
33
- // states,
34
- // subscribe,
35
- // };
36
- //
37
- // useEffect(() => {
38
- // if (props.onReady) {
39
- // props.onReady(controllerProp);
40
- // }
41
- // return () => {
42
- // if (props.onDestory) {
43
- // props.onDestory(controllerProp);
44
- // }
45
- // };
46
- // }, []);
47
- //
48
- // useFrame((prop) => {
49
- // if (props.onFrame) {
50
- // props.onFrame({ ...controllerProp, ...prop });
51
- // }
52
- // if (props.onAnimate) {
53
- // props.onAnimate({
54
- // ...controllerProp,
55
- // ...prop,
56
- // actions,
57
- // animation: characterAnimations,
58
- // playAnimation,
59
- // });
60
- // }
61
- // });
62
- }
@@ -1,27 +0,0 @@
1
- import { RootState } from "@react-three/fiber";
2
- import { cameraRayType } from "../../../camera/type";
3
- import { activeStateType, animationAtomType, animationPropType, keyControlType, statesType } from "../../../world/context/type";
4
- import { actionsType, groundRayType, slopeRayType } from "../../type";
5
- export type callbackPropType = {
6
- activeState: activeStateType;
7
- states: statesType;
8
- slopeRay: slopeRayType;
9
- groundRay: groundRayType;
10
- cameraRay: cameraRayType;
11
- control: keyControlType;
12
- subscribe: (props: animationAtomType) => void;
13
- };
14
- export type onFramePropType = callbackPropType & RootState;
15
- export type onAnimatePropType = onFramePropType & {
16
- actions: {
17
- [x: string]: THREE.AnimationAction | null;
18
- };
19
- animation: animationPropType;
20
- playAnimation: (tag: keyof actionsType, key: string) => void;
21
- };
22
- export type callbackType = {
23
- onReady?: (prop: callbackPropType) => void;
24
- onFrame?: (prop: onFramePropType) => void;
25
- onDestory?: (prop: callbackPropType) => void;
26
- onAnimate?: (prop: onAnimatePropType) => void;
27
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import { groundRayType, refsType } from "../../controller/type";
2
- import { cameraRayType } from "../../camera/type";
3
- import { keyControlType } from "../../world/context/type";
4
- export default function initControllerProps({ refs }: {
5
- refs: refsType;
6
- }): {
7
- groundRay: groundRayType;
8
- cameraRay: cameraRayType;
9
- keyControl: keyControlType;
10
- };
@@ -1,75 +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 { useKeyboardControls } from "@react-three/drei";
13
- import { vec3 } from "@react-three/rapier";
14
- import { useCallback, useContext, useEffect, useMemo } from "react";
15
- import * as THREE from "three";
16
- import { update } from "../../utils/context";
17
- import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../../world/context";
18
- export default function initControllerProps(_a) {
19
- var refs = _a.refs;
20
- var context = useContext(GaesupWorldContext);
21
- var dispatch = useContext(GaesupWorldDispatchContext);
22
- var _b = useKeyboardControls(), _ = _b[0], getKeys = _b[1];
23
- var keyControl = getKeys();
24
- useEffect(function () {
25
- if (context && keyControl && context.control) {
26
- dispatch({
27
- type: "update",
28
- payload: {
29
- control: __assign({}, (context.mode.controller === "keyboard"
30
- ? keyControl
31
- : context.control)),
32
- },
33
- });
34
- }
35
- }, [context === null || context === void 0 ? void 0 : context.mode.controller, keyControl, context === null || context === void 0 ? void 0 : context.control]);
36
- var groundRay = useMemo(function () {
37
- return {
38
- origin: vec3(),
39
- dir: vec3({ x: 0, y: -1, z: 0 }),
40
- offset: vec3({ x: 0, y: -1, z: 0 }),
41
- hit: null,
42
- parent: null,
43
- rayCast: null,
44
- length: 0.5,
45
- };
46
- }, []);
47
- var cameraRay = useMemo(function () {
48
- return {
49
- origin: vec3(),
50
- hit: new THREE.Raycaster(),
51
- rayCast: new THREE.Raycaster(vec3(), vec3(), 0, -7),
52
- dir: vec3(),
53
- position: vec3(),
54
- length: -context.cameraOption.maxDistance,
55
- detected: [],
56
- intersects: [],
57
- intersectObjectMap: {},
58
- };
59
- }, []);
60
- var initRefs = useCallback(function (refs) {
61
- update({
62
- refs: __assign({}, refs),
63
- }, dispatch);
64
- }, [refs]);
65
- useEffect(function () {
66
- if (refs) {
67
- initRefs(refs);
68
- }
69
- }, []);
70
- return {
71
- groundRay: groundRay,
72
- cameraRay: cameraRay,
73
- keyControl: keyControl,
74
- };
75
- }
@@ -1,48 +0,0 @@
1
- @import url("https://rsms.me/inter/inter.css");
2
-
3
- * {
4
- box-sizing: border-box;
5
- }
6
-
7
- html,
8
- body,
9
- #root {
10
- width: 100%;
11
- height: 100%;
12
- margin: 0;
13
- padding: 0;
14
- }
15
-
16
- body {
17
- background: #f0f0f0;
18
- font-family: inter;
19
- }
20
-
21
- .container {
22
- position: relative;
23
- width: 100%;
24
- height: 100%;
25
- }
26
-
27
- .canvas {
28
- pointer-events: none;
29
- position: absolute !important;
30
- top: 0px;
31
- left: 0px;
32
- width: 100vw;
33
- height: 100vh;
34
- }
35
-
36
- .view1 {
37
- position: absolute;
38
- width: 100%;
39
- height: 100%;
40
- }
41
-
42
- .view2 {
43
- position: absolute;
44
- top: 2em;
45
- right: 2em;
46
- width: calc(250px - 2em);
47
- height: calc(250px - 2em);
48
- }