gaesup-world 0.0.1
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/README.md +51 -0
- package/index.html +13 -0
- package/package.json +82 -0
- package/src/gaesup/animation/actions.ts +123 -0
- package/src/gaesup/camera/cameraCollisionDetecter.tsx +53 -0
- package/src/gaesup/camera/control/map.ts +10 -0
- package/src/gaesup/camera/control/normal copy.ts +19 -0
- package/src/gaesup/camera/control/normal.ts +15 -0
- package/src/gaesup/camera/control/orbit.ts +31 -0
- package/src/gaesup/camera/index.tsx +102 -0
- package/src/gaesup/camera/type.ts +17 -0
- package/src/gaesup/component/Airplane.tsx +46 -0
- package/src/gaesup/component/Character.tsx +48 -0
- package/src/gaesup/component/Vehicle.tsx +40 -0
- package/src/gaesup/component/gltf/AirplaneGltf.tsx +31 -0
- package/src/gaesup/component/gltf/CharacterGltf.tsx +81 -0
- package/src/gaesup/component/gltf/VehicleGltf.tsx +31 -0
- package/src/gaesup/component/gltf/WheelJoint.tsx +39 -0
- package/src/gaesup/component/gltf/type.ts +6 -0
- package/src/gaesup/component/ref/airplane.tsx +83 -0
- package/src/gaesup/component/ref/character.tsx +132 -0
- package/src/gaesup/component/ref/vehicle.tsx +145 -0
- package/src/gaesup/controller/index.tsx +103 -0
- package/src/gaesup/controller/type.ts +139 -0
- package/src/gaesup/gaesupProps/index.tsx +66 -0
- package/src/gaesup/initial/callback/index.ts +73 -0
- package/src/gaesup/initial/callback/type.ts +45 -0
- package/src/gaesup/initial/controller/index.ts +143 -0
- package/src/gaesup/initial/controller/initDebug.ts +102 -0
- package/src/gaesup/initial/gaesupWorld/collider/airplane.ts +26 -0
- package/src/gaesup/initial/gaesupWorld/collider/character.ts +32 -0
- package/src/gaesup/initial/gaesupWorld/collider/gltf.ts +91 -0
- package/src/gaesup/initial/gaesupWorld/collider/index.ts +26 -0
- package/src/gaesup/initial/gaesupWorld/collider/vehicle.ts +43 -0
- package/src/gaesup/initial/gaesupWorld/index.ts +82 -0
- package/src/gaesup/initial/gaesupWorld/type.ts +37 -0
- package/src/gaesup/physics/airplane/currentSetting.ts +20 -0
- package/src/gaesup/physics/airplane/damping.ts +8 -0
- package/src/gaesup/physics/airplane/direction.ts +70 -0
- package/src/gaesup/physics/airplane/gravity.ts +11 -0
- package/src/gaesup/physics/airplane/impulse.ts +22 -0
- package/src/gaesup/physics/airplane/index.tsx +16 -0
- package/src/gaesup/physics/airplane/turn.ts +12 -0
- package/src/gaesup/physics/airplane copy/currentSetting.ts +20 -0
- package/src/gaesup/physics/airplane copy/direction.ts +52 -0
- package/src/gaesup/physics/airplane copy/gravity.ts +6 -0
- package/src/gaesup/physics/airplane copy/impulse.ts +28 -0
- package/src/gaesup/physics/airplane copy/index.tsx +14 -0
- package/src/gaesup/physics/airplane copy/turn.ts +9 -0
- package/src/gaesup/physics/character/accelaration.ts +14 -0
- package/src/gaesup/physics/character/currentSetting.ts +20 -0
- package/src/gaesup/physics/character/damping.ts +6 -0
- package/src/gaesup/physics/character/direction.ts +104 -0
- package/src/gaesup/physics/character/impulse.ts +24 -0
- package/src/gaesup/physics/character/index.tsx +20 -0
- package/src/gaesup/physics/character/jump.ts +21 -0
- package/src/gaesup/physics/character/stabilizing.ts +6 -0
- package/src/gaesup/physics/character/turn.ts +17 -0
- package/src/gaesup/physics/check/ground.ts +19 -0
- package/src/gaesup/physics/check/index.ts +12 -0
- package/src/gaesup/physics/check/moving.ts +21 -0
- package/src/gaesup/physics/check/rotate.ts +13 -0
- package/src/gaesup/physics/check/slope.ts +50 -0
- package/src/gaesup/physics/index.ts +50 -0
- package/src/gaesup/physics/type.ts +35 -0
- package/src/gaesup/physics/vehicle/currentSetting.ts +20 -0
- package/src/gaesup/physics/vehicle/damping.ts +8 -0
- package/src/gaesup/physics/vehicle/direction.ts +27 -0
- package/src/gaesup/physics/vehicle/impulse.ts +22 -0
- package/src/gaesup/physics/vehicle/index.tsx +14 -0
- package/src/gaesup/physics/vehicle/turn.ts +11 -0
- package/src/gaesup/stores/active/index.ts +19 -0
- package/src/gaesup/stores/active/type.ts +16 -0
- package/src/gaesup/stores/airplane/index.ts +6 -0
- package/src/gaesup/stores/airplane/type.ts +4 -0
- package/src/gaesup/stores/animation/index.ts +18 -0
- package/src/gaesup/stores/animation/type.ts +9 -0
- package/src/gaesup/stores/collider/index.ts +55 -0
- package/src/gaesup/stores/context/controller/index.ts +36 -0
- package/src/gaesup/stores/context/controller/reducer.ts +18 -0
- package/src/gaesup/stores/context/controller/type.ts +38 -0
- package/src/gaesup/stores/context/gaesupworld/index.ts +11 -0
- package/src/gaesup/stores/context/gaesupworld/reducer.ts +21 -0
- package/src/gaesup/stores/context/gaesupworld/type.ts +66 -0
- package/src/gaesup/stores/control/index.ts +33 -0
- package/src/gaesup/stores/control/type.ts +11 -0
- package/src/gaesup/stores/joystick/index.ts +72 -0
- package/src/gaesup/stores/joystick/type.ts +23 -0
- package/src/gaesup/stores/minimap/index.ts +5 -0
- package/src/gaesup/stores/minimap/type.ts +22 -0
- package/src/gaesup/stores/point/type.ts +6 -0
- package/src/gaesup/stores/states/index.tsx +10 -0
- package/src/gaesup/stores/states/type.ts +10 -0
- package/src/gaesup/stores/url/index.ts +6 -0
- package/src/gaesup/stores/url/type.ts +6 -0
- package/src/gaesup/styles.css.ts +26 -0
- package/src/gaesup/tools/gameboy/GameBoyButton.tsx +38 -0
- package/src/gaesup/tools/gameboy/index.tsx +36 -0
- package/src/gaesup/tools/gameboy/style.css.ts +78 -0
- package/src/gaesup/tools/gamepad/GamePadButton.tsx +31 -0
- package/src/gaesup/tools/gamepad/index.tsx +55 -0
- package/src/gaesup/tools/gamepad/style.css.ts +16 -0
- package/src/gaesup/tools/index.tsx +61 -0
- package/src/gaesup/tools/joystick/index.tsx +145 -0
- package/src/gaesup/tools/joystick/style.css.ts +40 -0
- package/src/gaesup/tools/jumpPoint/index.tsx +27 -0
- package/src/gaesup/tools/jumpPoint/style.css.ts +33 -0
- package/src/gaesup/tools/keyBoardToolTip/constant.ts +144 -0
- package/src/gaesup/tools/keyBoardToolTip/index.tsx +85 -0
- package/src/gaesup/tools/keyBoardToolTip/style.css.ts +49 -0
- package/src/gaesup/tools/minimap/index.tsx +47 -0
- package/src/gaesup/tools/minimap/style.css.ts +144 -0
- package/src/gaesup/tools/style.css.ts +34 -0
- package/src/gaesup/utils/constant.ts +1 -0
- package/src/gaesup/utils/ray.ts +23 -0
- package/src/gaesup/utils/ref.ts +17 -0
- package/src/gaesup/utils/vector.ts +40 -0
- package/src/gaesup/world/index.tsx +17 -0
- package/src/gaesup/world/type.ts +10 -0
- package/src/styles/constants/boxshadow.css.ts +499 -0
- package/src/styles/constants/constant.css.ts +81 -0
- package/src/styles/constants/direction.css.ts +168 -0
- package/src/styles/constants/flex.css.ts +68 -0
- package/src/styles/constants/gradient.css.ts +10 -0
- package/src/styles/constants/grid.css.ts +37 -0
- package/src/styles/constants/palette.css.ts +324 -0
- package/src/styles/constants/translate.css.ts +129 -0
- package/src/styles/global.css.ts +91 -0
- package/src/styles/recipe/base.css.ts +31 -0
- package/src/styles/recipe/button.css.ts +109 -0
- package/src/styles/recipe/index.css.ts +134 -0
- package/src/styles/recipe/input.css.ts +33 -0
- package/src/styles/sprinkles/color.css.ts +62 -0
- package/src/styles/sprinkles/direction.css.ts +26 -0
- package/src/styles/sprinkles/display.css.ts +25 -0
- package/src/styles/sprinkles/fontSize.css.ts +25 -0
- package/src/styles/sprinkles/grid.css.ts +25 -0
- package/src/styles/sprinkles/index.css.ts +22 -0
- package/src/styles/sprinkles/margin.css.ts +30 -0
- package/src/styles/sprinkles/padding.css.ts +30 -0
- package/src/styles/sprinkles/position.css.ts +14 -0
- package/src/styles/sprinkles/size.css.ts +23 -0
- package/src/styles/theme.css.ts +98 -0
- package/tsconfig.json +27 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +9 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { keyframes, style } from "@vanilla-extract/css";
|
|
2
|
+
import { fixed, flex_absolute } from "../../../styles/recipe/index.css";
|
|
3
|
+
import { sprinkles } from "../../../styles/sprinkles/index.css";
|
|
4
|
+
import { vars } from "../../../styles/theme.css";
|
|
5
|
+
|
|
6
|
+
export const pulseWhite = keyframes({
|
|
7
|
+
"0%": {
|
|
8
|
+
boxShadow: "0 0 0 0 rgba(255, 255, 255, 0.7)",
|
|
9
|
+
opacity: 1,
|
|
10
|
+
},
|
|
11
|
+
"70%": {
|
|
12
|
+
boxShadow: "0 0 0 10px rgba(255, 255, 255, 0)",
|
|
13
|
+
opacity: 0.7,
|
|
14
|
+
},
|
|
15
|
+
"100%": {
|
|
16
|
+
boxShadow: "0 0 0 0 rgba(255, 255, 255, 0)",
|
|
17
|
+
opacity: 1,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const avatar = style([
|
|
22
|
+
flex_absolute({
|
|
23
|
+
center: true,
|
|
24
|
+
}),
|
|
25
|
+
{
|
|
26
|
+
width: "2rem",
|
|
27
|
+
height: "2rem",
|
|
28
|
+
borderRadius: "50%",
|
|
29
|
+
background: "rgba(5,222,250,1)",
|
|
30
|
+
boxShadow: "0 0 10px rgba(5,222,250,1)",
|
|
31
|
+
border: "2px solid transparent",
|
|
32
|
+
objectFit: "cover",
|
|
33
|
+
zIndex: 100,
|
|
34
|
+
animation: `${pulseWhite} 2s infinite`,
|
|
35
|
+
},
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
export const avatarImage = style([
|
|
39
|
+
{
|
|
40
|
+
width: "4rem",
|
|
41
|
+
height: "4rem",
|
|
42
|
+
borderRadius: "50%",
|
|
43
|
+
background: vars.gradient.purple,
|
|
44
|
+
border: "2px solid transparent",
|
|
45
|
+
objectFit: "cover",
|
|
46
|
+
},
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
export const border = style([
|
|
50
|
+
{
|
|
51
|
+
width: "4rem",
|
|
52
|
+
height: "4rem",
|
|
53
|
+
borderRadius: "50%",
|
|
54
|
+
boxShadow: "0 0 0 0 rgba(255, 255, 255, 1)",
|
|
55
|
+
transform: "scale(1)",
|
|
56
|
+
animation: `${pulseWhite} 2s infinite`,
|
|
57
|
+
cursor: "pointer",
|
|
58
|
+
transition: "all 0.5s ease-in",
|
|
59
|
+
selectors: {
|
|
60
|
+
"&:hover": {
|
|
61
|
+
transform: "scale(1.1)",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
]);
|
|
66
|
+
|
|
67
|
+
export const minimap = style([
|
|
68
|
+
fixed({
|
|
69
|
+
south_east: true,
|
|
70
|
+
}),
|
|
71
|
+
sprinkles({
|
|
72
|
+
w: {
|
|
73
|
+
mobile: "12",
|
|
74
|
+
tablet: "14",
|
|
75
|
+
laptop: "16",
|
|
76
|
+
desktop: "19",
|
|
77
|
+
},
|
|
78
|
+
h: {
|
|
79
|
+
mobile: "12",
|
|
80
|
+
tablet: "14",
|
|
81
|
+
laptop: "16",
|
|
82
|
+
desktop: "19",
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
{
|
|
86
|
+
margin: "1rem",
|
|
87
|
+
borderRadius: "50%",
|
|
88
|
+
background: "rgba(0, 0, 0, 0.9)",
|
|
89
|
+
boxShadow: `0 0 10px rgba(0, 0, 0, 0.9)`,
|
|
90
|
+
WebkitBackdropFilter: "blur(10px)",
|
|
91
|
+
backdropFilter: "blur(10px)",
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
export const minimapOuter = style([
|
|
96
|
+
flex_absolute({
|
|
97
|
+
center: true,
|
|
98
|
+
}),
|
|
99
|
+
]);
|
|
100
|
+
|
|
101
|
+
export const minimapInner = style([
|
|
102
|
+
flex_absolute({
|
|
103
|
+
center: true,
|
|
104
|
+
}),
|
|
105
|
+
sprinkles({
|
|
106
|
+
w: {
|
|
107
|
+
mobile: "11",
|
|
108
|
+
tablet: "13",
|
|
109
|
+
laptop: "15",
|
|
110
|
+
desktop: "18",
|
|
111
|
+
},
|
|
112
|
+
h: {
|
|
113
|
+
mobile: "11",
|
|
114
|
+
tablet: "13",
|
|
115
|
+
laptop: "15",
|
|
116
|
+
desktop: "18",
|
|
117
|
+
},
|
|
118
|
+
}),
|
|
119
|
+
{
|
|
120
|
+
zIndex: 2,
|
|
121
|
+
borderRadius: "50%",
|
|
122
|
+
background: "rgba(0, 0, 0, 0.9)",
|
|
123
|
+
overflow: "hidden",
|
|
124
|
+
},
|
|
125
|
+
]);
|
|
126
|
+
|
|
127
|
+
export const text = style([
|
|
128
|
+
{
|
|
129
|
+
fontSize: "1rem",
|
|
130
|
+
color: "white",
|
|
131
|
+
textShadow: "0 0 10px black",
|
|
132
|
+
},
|
|
133
|
+
]);
|
|
134
|
+
|
|
135
|
+
export const minimapObject = style([
|
|
136
|
+
flex_absolute({}),
|
|
137
|
+
{
|
|
138
|
+
borderRadius: "2px",
|
|
139
|
+
background: "rgba(99,251,215,0.4)",
|
|
140
|
+
boxShadow: "0 0 10px rgba(99,251,215,0.4)",
|
|
141
|
+
border: "2px solid rgba(99,251,215,1)",
|
|
142
|
+
opacity: 0.5,
|
|
143
|
+
},
|
|
144
|
+
]);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { style } from "@vanilla-extract/css";
|
|
2
|
+
import { fixed } from "../../styles/recipe/index.css";
|
|
3
|
+
|
|
4
|
+
export const footer = style([
|
|
5
|
+
fixed({
|
|
6
|
+
south: true,
|
|
7
|
+
}),
|
|
8
|
+
{
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: "25rem",
|
|
11
|
+
display: "grid",
|
|
12
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
13
|
+
gridTemplateRows: "repeat(2, 1fr)",
|
|
14
|
+
},
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
export const footerUpper = style([
|
|
18
|
+
{
|
|
19
|
+
gridColumn: "1/4",
|
|
20
|
+
gridRow: "1/2",
|
|
21
|
+
display: "flex",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
export const footerLower = style([
|
|
28
|
+
{
|
|
29
|
+
gridColumn: "1/4",
|
|
30
|
+
gridRow: "2/3",
|
|
31
|
+
display: "grid",
|
|
32
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const S3 = "https://jiggloghttps.s3.ap-northeast-2.amazonaws.com/gltf";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Collider } from "@dimforge/rapier3d-compat";
|
|
2
|
+
import { useRapier } from "@react-three/rapier";
|
|
3
|
+
import { MutableRefObject } from "react";
|
|
4
|
+
import { rayType } from "../controller/type";
|
|
5
|
+
|
|
6
|
+
export const getRayHit = <T extends rayType>({
|
|
7
|
+
ray,
|
|
8
|
+
ref,
|
|
9
|
+
}: {
|
|
10
|
+
ray: T;
|
|
11
|
+
ref: MutableRefObject<Collider>;
|
|
12
|
+
}) => {
|
|
13
|
+
const { world } = useRapier();
|
|
14
|
+
return world.castRay(
|
|
15
|
+
ray.rayCast,
|
|
16
|
+
ray.length,
|
|
17
|
+
true,
|
|
18
|
+
undefined,
|
|
19
|
+
undefined,
|
|
20
|
+
ref.current,
|
|
21
|
+
undefined
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ForwardedRef, useEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
export const useForwardRef = <T>(
|
|
4
|
+
ref: ForwardedRef<T>,
|
|
5
|
+
initialValue: any = null
|
|
6
|
+
) => {
|
|
7
|
+
const targetRef = useRef<T>(initialValue);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!ref) return;
|
|
10
|
+
if (typeof ref === "function") {
|
|
11
|
+
ref(targetRef.current);
|
|
12
|
+
} else {
|
|
13
|
+
targetRef.current = ref.current;
|
|
14
|
+
}
|
|
15
|
+
}, [ref]);
|
|
16
|
+
return targetRef;
|
|
17
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
export function isValidOrZero(
|
|
4
|
+
condision: boolean,
|
|
5
|
+
vector: THREE.Vector3
|
|
6
|
+
): THREE.Vector3 {
|
|
7
|
+
return condision ? vector : new THREE.Vector3(0, 0, 0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function isValidOrOne(
|
|
11
|
+
condision: boolean,
|
|
12
|
+
vector: THREE.Vector3
|
|
13
|
+
): THREE.Vector3 {
|
|
14
|
+
return condision ? vector : new THREE.Vector3(1, 1, 1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function V3(x?: number, y?: number, z?: number): THREE.Vector3 {
|
|
18
|
+
return new THREE.Vector3(x, y, z);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function V30(): THREE.Vector3 {
|
|
22
|
+
return new THREE.Vector3(0, 0, 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function V31(): THREE.Vector3 {
|
|
26
|
+
return new THREE.Vector3(1, 1, 1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function Qt(
|
|
30
|
+
x?: number,
|
|
31
|
+
y?: number,
|
|
32
|
+
z?: number,
|
|
33
|
+
w?: number
|
|
34
|
+
): THREE.Quaternion {
|
|
35
|
+
return new THREE.Quaternion(x, y, z, w);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function Elr(x: number, y: number, z: number): THREE.Euler {
|
|
39
|
+
return new THREE.Euler(x, y, z);
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import initGaesupWorld from "../initial/gaesupWorld";
|
|
2
|
+
import { initGaesupWorldPropsType } from "../initial/gaesupWorld/type";
|
|
3
|
+
import {
|
|
4
|
+
GaesupWorldContext,
|
|
5
|
+
GaesupWorldDispatchContext,
|
|
6
|
+
} from "../stores/context/gaesupworld";
|
|
7
|
+
|
|
8
|
+
export default function GaesupWorld(props: initGaesupWorldPropsType) {
|
|
9
|
+
const { gaesupProps } = initGaesupWorld(props);
|
|
10
|
+
return (
|
|
11
|
+
<GaesupWorldContext.Provider value={gaesupProps.value}>
|
|
12
|
+
<GaesupWorldDispatchContext.Provider value={gaesupProps.dispatch}>
|
|
13
|
+
{props.children}
|
|
14
|
+
</GaesupWorldDispatchContext.Provider>
|
|
15
|
+
</GaesupWorldContext.Provider>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { gaesupWorldPropType } from "../stores/context/gaesupworld/type";
|
|
3
|
+
|
|
4
|
+
export type gaesupWorldInitType = {
|
|
5
|
+
value: gaesupWorldPropType;
|
|
6
|
+
dispatch: Dispatch<{
|
|
7
|
+
type: string;
|
|
8
|
+
payload?: Partial<gaesupWorldPropType>;
|
|
9
|
+
}>;
|
|
10
|
+
};
|