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,38 +0,0 @@
1
- import { GroupProps } from "@react-three/fiber";
2
- import { dispatchType } from "../../utils/type";
3
- import { callbackType } from "../initialize/callback/type";
4
- import { gaesupControllerContextPropType, refsType } from "../type";
5
- export type airplaneDebugType = {
6
- angleDelta?: THREE.Vector3;
7
- maxAngle?: THREE.Vector3;
8
- buoyancy?: number;
9
- maxSpeed?: number;
10
- accelRatio?: number;
11
- brakeRatio?: number;
12
- linearDamping?: number;
13
- };
14
- export type vehicleDebugType = {
15
- maxSpeed?: number;
16
- accelRatio?: number;
17
- brakeRatio?: number;
18
- wheelOffset?: number;
19
- linearDamping?: number;
20
- };
21
- export type characterDebugType = {
22
- jumpSpeed?: number;
23
- turnSpeed?: number;
24
- walkSpeed?: number;
25
- runSpeed?: number;
26
- linearDamping?: number;
27
- };
28
- export interface airplaneType extends GroupProps, airplaneDebugType {
29
- }
30
- export interface vehicleType extends GroupProps, vehicleDebugType {
31
- }
32
- export interface characterType extends GroupProps, characterDebugType {
33
- }
34
- export type gaesupControllerType = gaesupControllerContextPropType & {
35
- callbacks?: callbackType;
36
- refs?: refsType;
37
- };
38
- export type gaesupDisptachType = dispatchType<gaesupControllerType>;
@@ -1 +0,0 @@
1
- export {};
@@ -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,74 +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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useContext, useMemo, useReducer, useRef } from "react";
14
- import Camera from "../camera";
15
- import { KeyboardControls } from "@react-three/drei";
16
- import { GaesupComponent } from "../component";
17
- import { GaesupWorldContext } from "../world/context";
18
- import { GaesupControllerContext, GaesupControllerDispatchContext, gaesupControllerDefault, } from "./context";
19
- import { gaesupControllerReducer } from "./context/reducer";
20
- import initDebug from "./debug";
21
- import initControllerProps from "./initialize";
22
- export function GaesupController(props) {
23
- var keyBoardMap = useContext(GaesupWorldContext).keyBoardMap;
24
- return (_jsx(KeyboardControls, { map: keyBoardMap, children: _jsx(GaesupControllerInner, __assign({}, props, { children: props.children })) }));
25
- }
26
- export function GaesupControllerInner(props) {
27
- var colliderRef = useRef(null);
28
- var rigidBodyRef = useRef(null);
29
- var outerGroupRef = useRef(null);
30
- var innerGroupRef = useRef(null);
31
- var characterInnerRef = useRef(null);
32
- var passiveRigidBodyRef = useRef(null);
33
- var _a = useReducer(gaesupControllerReducer, {
34
- airplane: Object.assign(gaesupControllerDefault.airplane, props.airplane || {}),
35
- vehicle: Object.assign(gaesupControllerDefault.vehicle, props.vehicle || {}),
36
- character: Object.assign(gaesupControllerDefault.character, props.character || {}),
37
- callbacks: Object.assign(gaesupControllerDefault.callbacks, {
38
- onReady: props.onReady,
39
- onFrame: props.onFrame,
40
- onDestory: props.onDestory,
41
- onAnimate: props.onAnimate,
42
- }),
43
- urls: Object.assign(gaesupControllerDefault.urls, props.urls || {}),
44
- refs: {
45
- colliderRef: colliderRef,
46
- rigidBodyRef: rigidBodyRef,
47
- outerGroupRef: outerGroupRef,
48
- innerGroupRef: innerGroupRef,
49
- characterInnerRef: characterInnerRef,
50
- },
51
- }), controller = _a[0], controllerDispatch = _a[1];
52
- var gaesupControl = useMemo(function () { return ({
53
- value: controller,
54
- dispatch: controllerDispatch,
55
- }); }, [controller, controllerDispatch]);
56
- var refs = useMemo(function () {
57
- return {
58
- colliderRef: colliderRef,
59
- rigidBodyRef: rigidBodyRef,
60
- outerGroupRef: outerGroupRef,
61
- innerGroupRef: innerGroupRef,
62
- characterInnerRef: characterInnerRef,
63
- passiveRigidBodyRef: passiveRigidBodyRef,
64
- };
65
- }, []);
66
- var prop = __assign(__assign(__assign(__assign({}, initControllerProps({
67
- refs: refs,
68
- })), { children: props.children, groupProps: props.groupProps }), gaesupControl.value.callbacks), refs);
69
- initDebug({
70
- controllerContext: gaesupControl.value,
71
- controllerDispatch: gaesupControl.dispatch,
72
- });
73
- 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 }) })] }));
74
- }
@@ -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
- }