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.
- package/package.json +2 -1
- package/src/gaesup/animation/actions.ts +1 -1
- package/src/gaesup/animation/index.ts +1 -0
- package/src/gaesup/camera/control/normal.ts +1 -1
- package/src/gaesup/camera/control/orbit.ts +1 -1
- package/src/gaesup/camera/index.tsx +3 -3
- package/src/gaesup/component/gltf/AirplaneGltf.tsx +1 -1
- package/src/gaesup/component/gltf/CharacterGltf.tsx +1 -1
- package/src/gaesup/component/gltf/VehicleGltf.tsx +1 -1
- package/src/gaesup/component/gltf/WheelJoint.tsx +1 -1
- package/src/gaesup/component/gltf/index.ts +4 -0
- package/src/gaesup/component/index.ts +5 -0
- package/src/gaesup/component/ref/airplane.tsx +1 -1
- package/src/gaesup/component/ref/character.tsx +1 -1
- package/src/gaesup/component/ref/index.ts +3 -0
- package/src/gaesup/component/ref/vehicle.tsx +1 -1
- package/src/gaesup/component/setInit.ts +2 -2
- package/src/gaesup/{stores/context/controller → controller/context}/index.ts +3 -2
- package/src/gaesup/{stores/context/controller → controller/context}/type.ts +22 -2
- package/src/gaesup/controller/index.tsx +4 -3
- package/src/gaesup/controller/type.ts +3 -5
- package/src/gaesup/gaesupProps/index.tsx +1 -1
- package/src/gaesup/index.ts +8 -0
- package/src/gaesup/initial/callback/index.ts +1 -1
- package/src/gaesup/initial/callback/type.ts +6 -4
- package/src/gaesup/initial/controller/index.ts +3 -2
- package/src/gaesup/initial/gaesupWorld/collider/index.ts +1 -1
- package/src/gaesup/initial/gaesupWorld/index.ts +33 -33
- package/src/gaesup/initial/gaesupWorld/type.ts +11 -14
- package/src/gaesup/initial/index.ts +3 -0
- package/src/gaesup/physics/airplane/direction.ts +0 -2
- package/src/gaesup/physics/airplane/turn.ts +0 -1
- package/src/gaesup/physics/character/direction.ts +12 -11
- package/src/gaesup/physics/index.ts +5 -4
- package/src/gaesup/physics/type.ts +3 -6
- package/src/gaesup/tools/context.ts +6 -0
- package/src/gaesup/tools/gameboy/GameBoyButton.tsx +6 -4
- package/src/gaesup/{stores/gameboy/index.ts → tools/gameboy/default.ts} +1 -1
- package/src/gaesup/tools/gameboy/index.tsx +6 -4
- package/src/gaesup/tools/gameboy/style.css.ts +2 -2
- package/src/gaesup/tools/gamepad/GamePadButton.tsx +21 -4
- package/src/gaesup/tools/gamepad/default.ts +3 -0
- package/src/gaesup/tools/gamepad/index.tsx +18 -7
- package/src/gaesup/tools/gamepad/style.css.ts +62 -7
- package/src/gaesup/tools/gamepad/type.ts +9 -0
- package/src/gaesup/tools/index.tsx +64 -43
- package/src/gaesup/{stores/joystick/index.ts → tools/joystick/default.ts} +11 -9
- package/src/gaesup/tools/joystick/index.tsx +94 -63
- package/src/gaesup/tools/joystick/style.css.ts +11 -8
- package/src/gaesup/{stores → tools}/joystick/type.ts +8 -7
- package/src/gaesup/tools/jumpPoint/index.tsx +2 -2
- package/src/gaesup/tools/keyBoardToolTip/constant.ts +1 -17
- package/src/gaesup/tools/keyBoardToolTip/default.ts +14 -0
- package/src/gaesup/tools/keyBoardToolTip/index.tsx +27 -20
- package/src/gaesup/tools/keyBoardToolTip/type.ts +37 -0
- package/src/gaesup/{stores/minimap/index.ts → tools/minimap/default.ts} +4 -0
- package/src/gaesup/tools/minimap/index.tsx +23 -5
- package/src/gaesup/{stores → tools}/minimap/type.ts +6 -1
- package/src/gaesup/{stores/control → tools/pushKey}/index.ts +1 -8
- package/src/gaesup/tools/reducer.ts +21 -0
- package/src/gaesup/tools/type.ts +26 -0
- package/src/gaesup/utils/index.ts +3 -0
- package/src/gaesup/world/context/index.ts +124 -0
- package/src/gaesup/{stores/context/gaesupworld → world/context}/reducer.ts +1 -1
- package/src/gaesup/world/context/type.ts +137 -0
- package/src/gaesup/world/index.tsx +1 -4
- package/src/gaesup/world/type.ts +1 -1
- package/src/index.ts +1 -0
- package/tsconfig.json +2 -1
- package/src/gaesup/stores/active/index.ts +0 -19
- package/src/gaesup/stores/active/type.ts +0 -16
- package/src/gaesup/stores/airplane/index.ts +0 -22
- package/src/gaesup/stores/airplane/type.ts +0 -22
- package/src/gaesup/stores/animation/index.ts +0 -18
- package/src/gaesup/stores/animation/type.ts +0 -9
- package/src/gaesup/stores/collider/index.ts +0 -55
- package/src/gaesup/stores/context/gaesupworld/index.ts +0 -11
- package/src/gaesup/stores/context/gaesupworld/type.ts +0 -71
- package/src/gaesup/stores/control/type.ts +0 -11
- package/src/gaesup/stores/point/type.ts +0 -6
- package/src/gaesup/stores/states/index.tsx +0 -10
- package/src/gaesup/stores/states/type.ts +0 -10
- package/src/gaesup/stores/url/index.ts +0 -6
- package/src/gaesup/stores/url/type.ts +0 -6
- /package/src/gaesup/{stores/context/controller → controller/context}/reducer.ts +0 -0
- /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,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
|
-
}>;
|
|
File without changes
|
|
File without changes
|