gaesup-world 0.0.2 → 0.0.4

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 (86) hide show
  1. package/package.json +2 -1
  2. package/src/gaesup/animation/actions.ts +1 -1
  3. package/src/gaesup/animation/index.ts +1 -0
  4. package/src/gaesup/camera/control/normal.ts +1 -1
  5. package/src/gaesup/camera/control/orbit.ts +1 -1
  6. package/src/gaesup/camera/index.tsx +3 -3
  7. package/src/gaesup/component/gltf/AirplaneGltf.tsx +1 -1
  8. package/src/gaesup/component/gltf/CharacterGltf.tsx +1 -1
  9. package/src/gaesup/component/gltf/VehicleGltf.tsx +1 -1
  10. package/src/gaesup/component/gltf/WheelJoint.tsx +1 -1
  11. package/src/gaesup/component/gltf/index.ts +4 -0
  12. package/src/gaesup/component/index.ts +5 -0
  13. package/src/gaesup/component/ref/airplane.tsx +1 -1
  14. package/src/gaesup/component/ref/character.tsx +1 -1
  15. package/src/gaesup/component/ref/index.ts +3 -0
  16. package/src/gaesup/component/ref/vehicle.tsx +1 -1
  17. package/src/gaesup/component/setInit.ts +2 -2
  18. package/src/gaesup/{stores/context/controller → controller/context}/index.ts +3 -2
  19. package/src/gaesup/{stores/context/controller → controller/context}/type.ts +22 -2
  20. package/src/gaesup/controller/index.tsx +4 -3
  21. package/src/gaesup/controller/type.ts +3 -5
  22. package/src/gaesup/gaesupProps/index.tsx +1 -1
  23. package/src/gaesup/index.ts +8 -0
  24. package/src/gaesup/initial/callback/index.ts +1 -1
  25. package/src/gaesup/initial/callback/type.ts +6 -4
  26. package/src/gaesup/initial/controller/index.ts +3 -2
  27. package/src/gaesup/initial/gaesupWorld/collider/index.ts +1 -1
  28. package/src/gaesup/initial/gaesupWorld/index.ts +33 -33
  29. package/src/gaesup/initial/gaesupWorld/type.ts +11 -14
  30. package/src/gaesup/initial/index.ts +3 -0
  31. package/src/gaesup/physics/airplane/direction.ts +0 -2
  32. package/src/gaesup/physics/airplane/turn.ts +0 -1
  33. package/src/gaesup/physics/character/direction.ts +12 -11
  34. package/src/gaesup/physics/index.ts +5 -4
  35. package/src/gaesup/physics/type.ts +3 -6
  36. package/src/gaesup/tools/context.ts +6 -0
  37. package/src/gaesup/tools/gameboy/GameBoyButton.tsx +6 -4
  38. package/src/gaesup/{stores/gameboy/index.ts → tools/gameboy/default.ts} +1 -1
  39. package/src/gaesup/tools/gameboy/index.tsx +6 -4
  40. package/src/gaesup/tools/gameboy/style.css.ts +2 -2
  41. package/src/gaesup/tools/gamepad/GamePadButton.tsx +21 -4
  42. package/src/gaesup/tools/gamepad/default.ts +3 -0
  43. package/src/gaesup/tools/gamepad/index.tsx +18 -7
  44. package/src/gaesup/tools/gamepad/style.css.ts +62 -7
  45. package/src/gaesup/tools/gamepad/type.ts +9 -0
  46. package/src/gaesup/tools/index.tsx +64 -43
  47. package/src/gaesup/{stores/joystick/index.ts → tools/joystick/default.ts} +11 -9
  48. package/src/gaesup/tools/joystick/index.tsx +94 -63
  49. package/src/gaesup/tools/joystick/style.css.ts +11 -8
  50. package/src/gaesup/{stores → tools}/joystick/type.ts +8 -7
  51. package/src/gaesup/tools/jumpPoint/index.tsx +2 -2
  52. package/src/gaesup/tools/keyBoardToolTip/constant.ts +1 -17
  53. package/src/gaesup/tools/keyBoardToolTip/default.ts +14 -0
  54. package/src/gaesup/tools/keyBoardToolTip/index.tsx +27 -20
  55. package/src/gaesup/tools/keyBoardToolTip/type.ts +37 -0
  56. package/src/gaesup/{stores/minimap/index.ts → tools/minimap/default.ts} +4 -0
  57. package/src/gaesup/tools/minimap/index.tsx +23 -5
  58. package/src/gaesup/{stores → tools}/minimap/type.ts +6 -1
  59. package/src/gaesup/{stores/control → tools/pushKey}/index.ts +1 -8
  60. package/src/gaesup/tools/reducer.ts +21 -0
  61. package/src/gaesup/tools/type.ts +26 -0
  62. package/src/gaesup/utils/index.ts +3 -0
  63. package/src/gaesup/world/context/index.ts +124 -0
  64. package/src/gaesup/{stores/context/gaesupworld → world/context}/reducer.ts +1 -1
  65. package/src/gaesup/world/context/type.ts +137 -0
  66. package/src/gaesup/world/index.tsx +1 -4
  67. package/src/gaesup/world/type.ts +1 -1
  68. package/src/index.ts +1 -0
  69. package/tsconfig.json +2 -1
  70. package/src/gaesup/stores/active/index.ts +0 -19
  71. package/src/gaesup/stores/active/type.ts +0 -16
  72. package/src/gaesup/stores/airplane/index.ts +0 -22
  73. package/src/gaesup/stores/airplane/type.ts +0 -22
  74. package/src/gaesup/stores/animation/index.ts +0 -18
  75. package/src/gaesup/stores/animation/type.ts +0 -9
  76. package/src/gaesup/stores/collider/index.ts +0 -55
  77. package/src/gaesup/stores/context/gaesupworld/index.ts +0 -11
  78. package/src/gaesup/stores/context/gaesupworld/type.ts +0 -71
  79. package/src/gaesup/stores/control/type.ts +0 -11
  80. package/src/gaesup/stores/point/type.ts +0 -6
  81. package/src/gaesup/stores/states/index.tsx +0 -10
  82. package/src/gaesup/stores/states/type.ts +0 -10
  83. package/src/gaesup/stores/url/index.ts +0 -6
  84. package/src/gaesup/stores/url/type.ts +0 -6
  85. /package/src/gaesup/{stores/context/controller → controller/context}/reducer.ts +0 -0
  86. /package/src/gaesup/{stores → tools}/gameboy/type.ts +0 -0
@@ -1,16 +0,0 @@
1
- export type activeStateType = {
2
- position: THREE.Vector3;
3
- impulse: THREE.Vector3;
4
- velocity: THREE.Vector3;
5
- acceleration: THREE.Vector3;
6
- quat: THREE.Quaternion;
7
- euler: THREE.Euler;
8
- direction: THREE.Vector3;
9
- dir: THREE.Vector3;
10
- axisX: THREE.Vector3;
11
- axisY: THREE.Vector3;
12
- axisZ: THREE.Vector3;
13
- yaw: number;
14
- pitch: number;
15
- roll: number;
16
- };
@@ -1,22 +0,0 @@
1
- import { V3 } from "../../utils/vector";
2
-
3
- export const airplaneDefault = {
4
- angleChange: V3(0.01, 0.005, 0.005),
5
- maxAngle: V3(0.1, 0.1, 0.1),
6
- maxSpeed: 60,
7
- accelRatio: 2,
8
- };
9
-
10
- export const vehicleDefault = {
11
- angleChange: V3(0.01, 0.005, 0.005),
12
- maxAngle: V3(0.1, 0.1, 0.1),
13
- maxSpeed: 60,
14
- accelRatio: 2,
15
- };
16
-
17
- export const characterDefault = {
18
- angleChange: V3(0.01, 0.005, 0.005),
19
- maxAngle: V3(0.1, 0.1, 0.1),
20
- maxSpeed: 60,
21
- accelRatio: 2,
22
- };
@@ -1,22 +0,0 @@
1
- import { GroupProps } from "@react-three/fiber";
2
-
3
- export interface airplaneType extends GroupProps {
4
- angleChange?: THREE.Vector3;
5
- maxAngle?: THREE.Vector3;
6
- maxSpeed?: number;
7
- accelRatio?: number;
8
- }
9
-
10
- export interface vehicleType extends GroupProps {
11
- angleChange?: THREE.Vector3;
12
- maxAngle?: THREE.Vector3;
13
- maxSpeed?: number;
14
- accelRatio?: number;
15
- }
16
-
17
- export interface characterType extends GroupProps {
18
- angleChange?: THREE.Vector3;
19
- maxAngle?: THREE.Vector3;
20
- maxSpeed?: number;
21
- accelRatio?: number;
22
- }
@@ -1,18 +0,0 @@
1
- import { animationTagType } from "../../controller/type";
2
-
3
- export const animationDefault = {
4
- current: "idle" as keyof animationTagType,
5
- animationNames: {
6
- idle: "idle",
7
- walk: "walk",
8
- run: "run",
9
- accel: "accel",
10
- break: "break",
11
- ride: "ride",
12
- jump: "jump",
13
- jumpIdle: "jumpIdle",
14
- jumpLand: "jumpLand",
15
- fall: "fall",
16
- },
17
- keyControl: {},
18
- };
@@ -1,9 +0,0 @@
1
- import { actionsType, animationTagType } from "../../controller/type";
2
-
3
- export type animationPropType = {
4
- current: keyof animationTagType;
5
- animationNames: actionsType;
6
- keyControl: {
7
- [key: string]: boolean;
8
- };
9
- };
@@ -1,55 +0,0 @@
1
- export type characterColliderType = {
2
- halfHeight?: number;
3
- height?: number;
4
- radius?: number;
5
- diameter?: number;
6
- };
7
-
8
- export type vehicleColliderType = {
9
- wheelSizeX?: number;
10
- wheelSizeY?: number;
11
- wheelSizeZ?: number;
12
- vehicleSizeX?: number;
13
- vehicleSizeY?: number;
14
- vehicleSizeZ?: number;
15
- vehicleX?: number;
16
- vehicleY?: number;
17
- vehicleZ?: number;
18
- };
19
-
20
- export type airplaneColliderType = {
21
- airplaneSizeX?: number;
22
- airplaneSizeY?: number;
23
- airplaneSizeZ?: number;
24
- airplaneX?: number;
25
- airplaneY?: number;
26
- airplaneZ?: number;
27
- };
28
-
29
- export const characterColliderDefault = {
30
- halfHeight: 0.35,
31
- height: 0.7,
32
- radius: 0.3,
33
- diameter: 0.6,
34
- };
35
-
36
- export const vehicleColliderDefault = {
37
- wheelSizeX: 0.5,
38
- wheelSizeY: 0.5,
39
- wheelSizeZ: 0.5,
40
- vehicleSizeX: 1,
41
- vehicleSizeY: 1,
42
- vehicleSizeZ: 1,
43
- vehicleX: 0.5,
44
- vehicleY: 0.5,
45
- vehicleZ: 0.5,
46
- };
47
-
48
- export const airplaneColliderDefault = {
49
- airplaneSizeX: 1,
50
- airplaneSizeY: 1,
51
- airplaneSizeZ: 1,
52
- airplaneX: 0.5,
53
- airplaneY: 0.5,
54
- airplaneZ: 0.5,
55
- };
@@ -1,11 +0,0 @@
1
- import { createContext } from "react";
2
- import { dispatchType, gaesupWorldPropType } from "./type";
3
-
4
- export const modeDefault = {
5
- type: "character",
6
- controller: "keyboard",
7
- };
8
-
9
- export const GaesupWorldContext = createContext<gaesupWorldPropType>(null);
10
- export const GaesupWorldDispatchContext =
11
- createContext<dispatchType<gaesupWorldPropType>>(null);
@@ -1,71 +0,0 @@
1
- import { Dispatch } from "react";
2
- import { GLTFResult } from "../../../component/gltf/type";
3
- import { refsType } from "../../../controller/type";
4
- import { activeStateType } from "../../active/type";
5
- import { animationPropType } from "../../animation/type";
6
- import {
7
- airplaneColliderType,
8
- characterColliderType,
9
- vehicleColliderType,
10
- } from "../../collider";
11
- import { gameboyType } from "../../gameboy/type";
12
- import { joyStickType } from "../../joystick/type";
13
- import { minimapType } from "../../minimap/type";
14
- import { pointsType } from "../../point/type";
15
- import { statesType } from "../../states/type";
16
- import { urlType } from "../../url/type";
17
-
18
- export type characterOptionType = {
19
- type?: "character";
20
- controller?: "gameboy" | "keyboard" | "joystick";
21
- };
22
- export type vehicleOptionType = {
23
- type?: "vehicle";
24
- controller?: "gameboy" | "keyboard" | "joystick";
25
- };
26
- export type airplaneOptionType = {
27
- type?: "airplane";
28
- controller?: "gameboy" | "keyboard" | "joystick";
29
- };
30
-
31
- export type gaesupControllerPropType =
32
- | characterOptionType
33
- | vehicleOptionType
34
- | airplaneOptionType;
35
-
36
- type KeyboardControlsState<T extends string = string> = {
37
- [K in T]: boolean;
38
- };
39
-
40
- export type gaesupWorldPropType = {
41
- activeState: activeStateType;
42
- characterCollider: characterColliderType;
43
- vehicleCollider: vehicleColliderType;
44
- airplaneCollider: airplaneColliderType;
45
- mode: gaesupControllerPropType;
46
- url: urlType;
47
- characterGltf: GLTFResult;
48
- vehicleGltf: GLTFResult;
49
- wheelGltf: GLTFResult;
50
- airplaneGltf: GLTFResult;
51
- states: statesType;
52
- debug: boolean;
53
- minimap: minimapType;
54
- joystick: joyStickType;
55
- gameboy: gameboyType;
56
- control: KeyboardControlsState<string>;
57
- points: pointsType;
58
- refs: refsType;
59
- animations: animationPropType;
60
- };
61
-
62
- export type dispatchType<T> = Dispatch<{
63
- type: string;
64
- payload?: Partial<T>;
65
- }>;
66
-
67
- export type gaesupWorldPartialPropType = Partial<gaesupWorldPropType>;
68
- export type gaesupDisptachType = Dispatch<{
69
- type: string;
70
- payload?: Partial<gaesupWorldPropType>;
71
- }>;
@@ -1,11 +0,0 @@
1
- export type controlType = {
2
- forward: boolean;
3
- backward: boolean;
4
- leftward: boolean;
5
- rightward: boolean;
6
- [key: string]: boolean;
7
- };
8
-
9
- export type keyControlType = {
10
- [key: string]: boolean;
11
- };
@@ -1,6 +0,0 @@
1
- export type pointType = {
2
- text: string;
3
- position: THREE.Vector3;
4
- };
5
-
6
- export type pointsType = pointType[];
@@ -1,10 +0,0 @@
1
- export const statesDefault = {
2
- isMoving: false,
3
- isNotMoving: false,
4
- isOnTheGround: false,
5
- isOnMoving: false,
6
- isRotated: false,
7
- isRunning: false,
8
- isJumping: false,
9
- isAnimationOuter: false,
10
- };
@@ -1,10 +0,0 @@
1
- export type statesType = {
2
- isMoving: boolean;
3
- isNotMoving: boolean;
4
- isOnTheGround: boolean;
5
- isOnMoving: boolean;
6
- isRotated: boolean;
7
- isRunning: boolean;
8
- isJumping: boolean;
9
- isAnimationOuter: boolean;
10
- };
@@ -1,6 +0,0 @@
1
- export const urlDefault = {
2
- characterUrl: null,
3
- vehicleUrl: null,
4
- airplaneUrl: null,
5
- wheelUrl: null,
6
- };
@@ -1,6 +0,0 @@
1
- export type urlType = {
2
- characterUrl?: string;
3
- vehicleUrl?: string;
4
- airplaneUrl?: string;
5
- wheelUrl?: string;
6
- };
File without changes