gaesup-world 0.0.4 → 0.0.5
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 +1 -1
- package/src/gaesup/animation/actions.d.ts +8 -0
- package/src/gaesup/animation/index.d.ts +1 -0
- package/src/gaesup/camera/cameraCollisionDetecter.d.ts +4 -0
- package/src/gaesup/camera/control/map.d.ts +2 -0
- package/src/gaesup/camera/control/normal.d.ts +2 -0
- package/src/gaesup/camera/control/orbit.d.ts +2 -0
- package/src/gaesup/camera/index.d.ts +8 -0
- package/src/gaesup/camera/type.d.ts +17 -0
- package/src/gaesup/component/Airplane.d.ts +5 -0
- package/src/gaesup/component/Character.d.ts +5 -0
- package/src/gaesup/component/Vehicle.d.ts +5 -0
- package/src/gaesup/component/gltf/AirplaneGltf.d.ts +2 -0
- package/src/gaesup/component/gltf/CharacterGltf.d.ts +14 -0
- package/src/gaesup/component/gltf/VehicleGltf.d.ts +2 -0
- package/src/gaesup/component/gltf/WheelJoint.d.ts +4 -0
- package/src/gaesup/component/gltf/index.d.ts +4 -0
- package/src/gaesup/component/gltf/type.d.ts +9 -0
- package/src/gaesup/component/index.d.ts +5 -0
- package/src/gaesup/component/ref/airplane.d.ts +16 -0
- package/src/gaesup/component/ref/character.d.ts +20 -0
- package/src/gaesup/component/ref/index.d.ts +3 -0
- package/src/gaesup/component/ref/vehicle.d.ts +24 -0
- package/src/gaesup/component/setInit.d.ts +3 -0
- package/src/gaesup/controller/context/index.d.ts +40 -0
- package/src/gaesup/controller/context/index.ts +3 -4
- package/src/gaesup/controller/context/reducer.d.ts +14 -0
- package/src/gaesup/controller/context/reducer.ts +1 -1
- package/src/gaesup/controller/context/type.d.ts +52 -0
- package/src/gaesup/controller/index.d.ts +2 -0
- package/src/gaesup/controller/type.d.ts +124 -0
- package/src/gaesup/controller/type.ts +4 -5
- package/src/gaesup/gaesupProps/index.d.ts +7 -0
- package/src/gaesup/gaesupProps/index.tsx +1 -1
- package/src/gaesup/index.d.ts +8 -0
- package/src/gaesup/initial/callback/index.d.ts +2 -0
- package/src/gaesup/initial/callback/type.d.ts +33 -0
- package/src/gaesup/initial/controller/index.d.ts +29 -0
- package/src/gaesup/initial/controller/initDebug.d.ts +24 -0
- package/src/gaesup/initial/gaesupWorld/collider/airplane.d.ts +2 -0
- package/src/gaesup/initial/gaesupWorld/collider/character.d.ts +2 -0
- package/src/gaesup/initial/gaesupWorld/collider/gltf.d.ts +14 -0
- package/src/gaesup/initial/gaesupWorld/collider/index.d.ts +6 -0
- package/src/gaesup/initial/gaesupWorld/collider/vehicle.d.ts +2 -0
- package/src/gaesup/initial/gaesupWorld/index.d.ts +32 -0
- package/src/gaesup/initial/gaesupWorld/type.d.ts +28 -0
- package/src/gaesup/initial/index.d.ts +3 -0
- package/src/gaesup/physics/airplane/currentSetting.d.ts +2 -0
- package/src/gaesup/physics/airplane/damping.d.ts +2 -0
- package/src/gaesup/physics/airplane/direction.d.ts +2 -0
- package/src/gaesup/physics/airplane/gravity.d.ts +2 -0
- package/src/gaesup/physics/airplane/impulse.d.ts +2 -0
- package/src/gaesup/physics/airplane/index.d.ts +2 -0
- package/src/gaesup/physics/airplane/turn.d.ts +2 -0
- package/src/gaesup/physics/character/accelaration.d.ts +2 -0
- package/src/gaesup/physics/character/currentSetting.d.ts +2 -0
- package/src/gaesup/physics/character/damping.d.ts +2 -0
- package/src/gaesup/physics/character/direction.d.ts +24 -0
- package/src/gaesup/physics/character/impulse.d.ts +2 -0
- package/src/gaesup/physics/character/index.d.ts +2 -0
- package/src/gaesup/physics/character/jump.d.ts +2 -0
- package/src/gaesup/physics/character/stabilizing.d.ts +2 -0
- package/src/gaesup/physics/character/turn.d.ts +2 -0
- package/src/gaesup/physics/check/ground.d.ts +2 -0
- package/src/gaesup/physics/check/index.d.ts +2 -0
- package/src/gaesup/physics/check/moving.d.ts +2 -0
- package/src/gaesup/physics/check/rotate.d.ts +2 -0
- package/src/gaesup/physics/check/slope.d.ts +2 -0
- package/src/gaesup/physics/index.d.ts +2 -0
- package/src/gaesup/physics/type.d.ts +25 -0
- package/src/gaesup/physics/vehicle/currentSetting.d.ts +2 -0
- package/src/gaesup/physics/vehicle/damping.d.ts +2 -0
- package/src/gaesup/physics/vehicle/direction.d.ts +2 -0
- package/src/gaesup/physics/vehicle/impulse.d.ts +2 -0
- package/src/gaesup/physics/vehicle/index.d.ts +2 -0
- package/src/gaesup/physics/vehicle/turn.d.ts +2 -0
- package/src/gaesup/styles.css.d.ts +2 -0
- package/src/gaesup/tools/context.d.ts +4 -0
- package/src/gaesup/tools/gameboy/GameBoyButton.d.ts +7 -0
- package/src/gaesup/tools/gameboy/GameBoyButton.tsx +3 -2
- package/src/gaesup/tools/gameboy/default.d.ts +3 -0
- package/src/gaesup/tools/gameboy/index.d.ts +6 -0
- package/src/gaesup/tools/gameboy/style.css.d.ts +40 -0
- package/src/gaesup/tools/gameboy/style.css.ts +2 -2
- package/src/gaesup/tools/gameboy/type.d.ts +7 -0
- package/src/gaesup/tools/gamepad/GamePadButton.d.ts +4 -0
- package/src/gaesup/tools/gamepad/GamePadButton.tsx +5 -4
- package/src/gaesup/tools/gamepad/default.d.ts +3 -0
- package/src/gaesup/tools/gamepad/index.d.ts +1 -0
- package/src/gaesup/tools/gamepad/index.tsx +4 -3
- package/src/gaesup/tools/gamepad/style.css.d.ts +15 -0
- package/src/gaesup/tools/gamepad/style.css.ts +2 -2
- package/src/gaesup/tools/gamepad/type.d.ts +8 -0
- package/src/gaesup/tools/index.d.ts +2 -0
- package/src/gaesup/tools/joystick/default.d.ts +43 -0
- package/src/gaesup/tools/joystick/default.ts +2 -2
- package/src/gaesup/tools/joystick/index.d.ts +2 -0
- package/src/gaesup/tools/joystick/style.css.d.ts +3 -0
- package/src/gaesup/tools/joystick/style.css.ts +1 -1
- package/src/gaesup/tools/joystick/type.d.ts +28 -0
- package/src/gaesup/tools/jumpPoint/index.d.ts +1 -0
- package/src/gaesup/tools/jumpPoint/index.tsx +3 -2
- package/src/gaesup/tools/jumpPoint/style.css.d.ts +2 -0
- package/src/gaesup/tools/keyBoardToolTip/constant.d.ts +402 -0
- package/src/gaesup/tools/keyBoardToolTip/default.d.ts +11 -0
- package/src/gaesup/tools/keyBoardToolTip/index.d.ts +1 -0
- package/src/gaesup/tools/keyBoardToolTip/style.css.d.ts +3 -0
- package/src/gaesup/tools/keyBoardToolTip/type.d.ts +31 -0
- package/src/gaesup/tools/minimap/default.d.ts +8 -0
- package/src/gaesup/tools/minimap/index.d.ts +1 -0
- package/src/gaesup/tools/minimap/style.css.d.ts +9 -0
- package/src/gaesup/tools/minimap/type.d.ts +24 -0
- package/src/gaesup/tools/pushKey/index.d.ts +3 -0
- package/src/gaesup/tools/reducer.d.ts +11 -0
- package/src/gaesup/tools/style.css.d.ts +3 -0
- package/src/gaesup/tools/type.d.ts +26 -0
- package/src/gaesup/utils/constant.d.ts +1 -0
- package/src/gaesup/utils/index.d.ts +3 -0
- package/src/gaesup/utils/ray.d.ts +7 -0
- package/src/gaesup/utils/ref.d.ts +2 -0
- package/src/gaesup/utils/vector.d.ts +8 -0
- package/src/gaesup/world/context/index.d.ts +5 -0
- package/src/gaesup/world/context/reducer.d.ts +26 -0
- package/src/gaesup/world/context/type.d.ts +121 -0
- package/src/gaesup/world/index.d.ts +2 -0
- package/src/gaesup/world/type.d.ts +9 -0
- package/src/index.d.ts +1 -0
- package/src/styles/constants/boxshadow.css.d.ts +9 -0
- package/src/styles/constants/boxshadow.css.ts +0 -489
- package/src/styles/constants/constant.css.d.ts +77 -0
- package/src/styles/constants/direction.css.d.ts +160 -0
- package/src/styles/constants/flex.css.d.ts +61 -0
- package/src/styles/constants/gradient.css.d.ts +8 -0
- package/src/styles/constants/grid.css.d.ts +55 -0
- package/src/styles/constants/grid.css.ts +1 -1
- package/src/styles/constants/palette.css.d.ts +77 -0
- package/src/styles/constants/palette.css.ts +3 -236
- package/src/styles/constants/translate.css.d.ts +563 -0
- package/src/styles/global.css.d.ts +1 -0
- package/src/styles/global.css.ts +1 -1
- package/src/styles/recipe/base.css.d.ts +22 -0
- package/src/styles/recipe/base.css.ts +17 -17
- package/src/styles/recipe/button.css.d.ts +61 -0
- package/src/styles/recipe/button.css.ts +5 -5
- package/src/styles/recipe/index.css.d.ts +4167 -0
- package/src/styles/recipe/index.css.ts +5 -5
- package/src/styles/recipe/input.css.d.ts +21 -0
- package/src/styles/recipe/input.css.ts +1 -1
- package/src/styles/sprinkles/color.css.d.ts +764 -0
- package/src/styles/sprinkles/color.css.ts +5 -5
- package/src/styles/sprinkles/direction.css.d.ts +1047 -0
- package/src/styles/sprinkles/direction.css.ts +1 -1
- package/src/styles/sprinkles/display.css.d.ts +208 -0
- package/src/styles/sprinkles/fontSize.css.d.ts +529 -0
- package/src/styles/sprinkles/fontSize.css.ts +1 -1
- package/src/styles/sprinkles/grid.css.d.ts +462 -0
- package/src/styles/sprinkles/grid.css.ts +5 -2
- package/src/styles/sprinkles/index.css.d.ts +1 -0
- package/src/styles/sprinkles/index.css.ts +10 -10
- package/src/styles/sprinkles/margin.css.d.ts +2212 -0
- package/src/styles/sprinkles/margin.css.ts +1 -1
- package/src/styles/sprinkles/padding.css.d.ts +2212 -0
- package/src/styles/sprinkles/padding.css.ts +1 -1
- package/src/styles/sprinkles/position.css.d.ts +48 -0
- package/src/styles/sprinkles/size.css.d.ts +43 -0
- package/src/styles/sprinkles/size.css.ts +1 -1
- package/src/styles/theme.css.d.ts +62 -0
- package/tsconfig.json +7 -12
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { groundRayType } from "../controller/type";
|
|
3
|
+
export type playActionsType = {
|
|
4
|
+
outerGroupRef: RefObject<THREE.Group>;
|
|
5
|
+
groundRay: groundRayType;
|
|
6
|
+
isRider?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export default function playActions({ outerGroupRef, groundRay, isRider, }: playActionsType): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./actions";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type cameraRayType = {
|
|
2
|
+
origin: THREE.Vector3;
|
|
3
|
+
hit: THREE.Raycaster;
|
|
4
|
+
rayCast: THREE.Raycaster | null;
|
|
5
|
+
lerpingPoint: THREE.Vector3;
|
|
6
|
+
length: number;
|
|
7
|
+
dir: THREE.Vector3;
|
|
8
|
+
position: THREE.Vector3;
|
|
9
|
+
followCamera: THREE.Object3D;
|
|
10
|
+
pivot: THREE.Object3D;
|
|
11
|
+
intersetesAndTransParented: THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[];
|
|
12
|
+
intersects: THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[];
|
|
13
|
+
intersectObjects: THREE.Object3D[];
|
|
14
|
+
intersectObjectMap: {
|
|
15
|
+
[uuid: string]: THREE.Object3D;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GroupProps } from "@react-three/fiber";
|
|
3
|
+
import { groundRayType, propType, refsType } from "../../controller/type";
|
|
4
|
+
import { callbackType } from "../../initial/callback/type";
|
|
5
|
+
export type characterGltfType = {
|
|
6
|
+
prop: propType;
|
|
7
|
+
groupProps?: GroupProps;
|
|
8
|
+
groundRay: groundRayType;
|
|
9
|
+
refs: refsType;
|
|
10
|
+
callbacks?: callbackType;
|
|
11
|
+
isRider?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const InnerGroupRef: import("react").ForwardRefExoticComponent<import("react").RefAttributes<import("three").Group<import("three").Object3DEventMap>>>;
|
|
14
|
+
export declare const CharacterInnerGroupRef: import("react").ForwardRefExoticComponent<characterGltfType & import("react").RefAttributes<import("three").Group<import("three").Object3DEventMap>>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Collider } from "@dimforge/rapier3d-compat";
|
|
2
|
+
import { RapierRigidBody } from "@react-three/rapier";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
import { controllerType, propType } from "../../controller/type";
|
|
6
|
+
export declare const AirplaneRigidBody: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
controllerProps: propType;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
} & import("react").RefAttributes<RapierRigidBody>>;
|
|
10
|
+
export declare const AirplaneCollider: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
prop: propType;
|
|
12
|
+
} & import("react").RefAttributes<Collider>>;
|
|
13
|
+
export declare const AirplaneGroup: import("react").ForwardRefExoticComponent<{
|
|
14
|
+
controllerProps: controllerType;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
} & import("react").RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Collider } from "@dimforge/rapier3d-compat";
|
|
2
|
+
import { RapierRigidBody } from "@react-three/rapier";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
import { controllerType, groundRayType, propType, slopeRayType } from "../../controller/type";
|
|
6
|
+
export declare const CharacterRigidBody: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
controllerProps: propType;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
} & import("react").RefAttributes<RapierRigidBody>>;
|
|
10
|
+
export declare const CharacterCapsuleCollider: import("react").ForwardRefExoticComponent<{
|
|
11
|
+
prop: propType;
|
|
12
|
+
} & import("react").RefAttributes<Collider>>;
|
|
13
|
+
export declare const CharacterGroup: import("react").ForwardRefExoticComponent<{
|
|
14
|
+
controllerProps: controllerType;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
} & import("react").RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
17
|
+
export declare const CharacterSlopeRay: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
groundRay: groundRayType;
|
|
19
|
+
slopeRay: slopeRayType;
|
|
20
|
+
} & import("react").RefAttributes<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Collider } from "@dimforge/rapier3d-compat";
|
|
2
|
+
import { RapierRigidBody } from "@react-three/rapier";
|
|
3
|
+
import { ReactNode, RefObject } from "react";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
import { controllerType, propType } from "../../controller/type";
|
|
6
|
+
export declare const VehicleRigidBody: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
controllerProps: propType;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
} & import("react").RefAttributes<RapierRigidBody>>;
|
|
10
|
+
export declare const VehicleCollider: import("react").ForwardRefExoticComponent<import("react").RefAttributes<Collider>>;
|
|
11
|
+
export declare const VehicleGroup: import("react").ForwardRefExoticComponent<{
|
|
12
|
+
controllerProps: controllerType;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
} & import("react").RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
15
|
+
export type wheelRegidBodyType = {
|
|
16
|
+
wheelPosition: [number, number, number];
|
|
17
|
+
wheelsUrl?: string;
|
|
18
|
+
bodyRef: RefObject<RapierRigidBody>;
|
|
19
|
+
wheel: RefObject<RapierRigidBody>;
|
|
20
|
+
bodyAnchor: THREE.Vector3Tuple;
|
|
21
|
+
wheelAnchor: THREE.Vector3Tuple;
|
|
22
|
+
rotationAxis: THREE.Vector3Tuple;
|
|
23
|
+
};
|
|
24
|
+
export declare const WheelRegidBodyRef: import("react").ForwardRefExoticComponent<wheelRegidBodyType & import("react").RefAttributes<RapierRigidBody>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { dispatchType } from "../../tools/type.js";
|
|
3
|
+
import { gaesupControllerType, orthographicCameraType, perspectiveCameraType } from "./type.js";
|
|
4
|
+
export declare const gaesupControllerDefault: {
|
|
5
|
+
cameraMode: perspectiveCameraType | orthographicCameraType;
|
|
6
|
+
cameraOption: {
|
|
7
|
+
offset: import("three").Vector3;
|
|
8
|
+
};
|
|
9
|
+
perspectiveCamera: {
|
|
10
|
+
isFront: boolean;
|
|
11
|
+
XZDistance: number;
|
|
12
|
+
YDistance: number;
|
|
13
|
+
};
|
|
14
|
+
orthographicCamera: {
|
|
15
|
+
zoom: number;
|
|
16
|
+
near: number;
|
|
17
|
+
far: number;
|
|
18
|
+
};
|
|
19
|
+
airplane: {
|
|
20
|
+
angleChange: import("three").Vector3;
|
|
21
|
+
maxAngle: import("three").Vector3;
|
|
22
|
+
maxSpeed: number;
|
|
23
|
+
accelRatio: number;
|
|
24
|
+
};
|
|
25
|
+
vehicle: {
|
|
26
|
+
angleChange: import("three").Vector3;
|
|
27
|
+
maxAngle: import("three").Vector3;
|
|
28
|
+
maxSpeed: number;
|
|
29
|
+
accelRatio: number;
|
|
30
|
+
};
|
|
31
|
+
character: {
|
|
32
|
+
angleChange: import("three").Vector3;
|
|
33
|
+
maxAngle: import("three").Vector3;
|
|
34
|
+
maxSpeed: number;
|
|
35
|
+
accelRatio: number;
|
|
36
|
+
};
|
|
37
|
+
isRider: boolean;
|
|
38
|
+
};
|
|
39
|
+
export declare const GaesupControllerContext: import("react").Context<gaesupControllerType>;
|
|
40
|
+
export declare const GaesupControllerDispatchContext: import("react").Context<dispatchType<gaesupControllerType>>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { V3 } from "../../utils/vector";
|
|
2
|
+
import { dispatchType } from "../../tools/type.js";
|
|
3
|
+
import { V3 } from "../../utils/vector.js";
|
|
5
4
|
import {
|
|
6
5
|
gaesupControllerType,
|
|
7
6
|
orthographicCameraType,
|
|
8
7
|
perspectiveCameraType,
|
|
9
|
-
} from "./type";
|
|
8
|
+
} from "./type.js";
|
|
10
9
|
|
|
11
10
|
export const gaesupControllerDefault = {
|
|
12
11
|
cameraMode: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { gaesupControllerType } from "./type.js";
|
|
2
|
+
export declare function gaesupControllerReducer(props: gaesupControllerType, action: {
|
|
3
|
+
type: string;
|
|
4
|
+
payload?: gaesupControllerType;
|
|
5
|
+
}): {
|
|
6
|
+
cameraMode: import("./type.js").gaesupCameraPropType;
|
|
7
|
+
cameraOption: import("./type.js").gaesupCameraOptionType;
|
|
8
|
+
perspectiveCamera: import("./type.js").perspectiveCameraPropType;
|
|
9
|
+
orthographicCamera: import("@react-three/fiber").OrthographicCameraProps;
|
|
10
|
+
airplane: import("./type.js").airplaneType;
|
|
11
|
+
vehicle: import("./type.js").vehicleType;
|
|
12
|
+
character: import("./type.js").characterType;
|
|
13
|
+
isRider: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { GroupProps, OrthographicCameraProps } from "@react-three/fiber";
|
|
2
|
+
import { Dispatch } from "react";
|
|
3
|
+
export interface airplaneType extends GroupProps {
|
|
4
|
+
angleChange?: THREE.Vector3;
|
|
5
|
+
maxAngle?: THREE.Vector3;
|
|
6
|
+
maxSpeed?: number;
|
|
7
|
+
accelRatio?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface vehicleType extends GroupProps {
|
|
10
|
+
angleChange?: THREE.Vector3;
|
|
11
|
+
maxAngle?: THREE.Vector3;
|
|
12
|
+
maxSpeed?: number;
|
|
13
|
+
accelRatio?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface characterType extends GroupProps {
|
|
16
|
+
angleChange?: THREE.Vector3;
|
|
17
|
+
maxAngle?: THREE.Vector3;
|
|
18
|
+
maxSpeed?: number;
|
|
19
|
+
accelRatio?: number;
|
|
20
|
+
}
|
|
21
|
+
export type perspectiveCameraType = {
|
|
22
|
+
cameraType?: "perspective";
|
|
23
|
+
controlType?: "orbit" | "normal";
|
|
24
|
+
};
|
|
25
|
+
export type orthographicCameraType = {
|
|
26
|
+
cameraType?: "orthographic";
|
|
27
|
+
controlType?: "orbit";
|
|
28
|
+
};
|
|
29
|
+
export type gaesupCameraPropType = perspectiveCameraType | orthographicCameraType;
|
|
30
|
+
export type gaesupCameraOptionType = {
|
|
31
|
+
offset?: THREE.Vector3;
|
|
32
|
+
};
|
|
33
|
+
export type perspectiveCameraPropType = {
|
|
34
|
+
isFront: boolean;
|
|
35
|
+
XZDistance: number;
|
|
36
|
+
YDistance: number;
|
|
37
|
+
};
|
|
38
|
+
export type gaesupControllerType = {
|
|
39
|
+
cameraMode: gaesupCameraPropType;
|
|
40
|
+
cameraOption: gaesupCameraOptionType;
|
|
41
|
+
perspectiveCamera: perspectiveCameraPropType;
|
|
42
|
+
orthographicCamera: OrthographicCameraProps;
|
|
43
|
+
airplane: airplaneType;
|
|
44
|
+
vehicle: vehicleType;
|
|
45
|
+
character: characterType;
|
|
46
|
+
isRider: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type gaesupControllerPartialType = Partial<gaesupControllerType>;
|
|
49
|
+
export type gaesupDisptachType = Dispatch<{
|
|
50
|
+
type: string;
|
|
51
|
+
payload?: Partial<gaesupControllerType>;
|
|
52
|
+
}>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Collider, Ray, RayColliderToi, RevoluteImpulseJoint } from "@dimforge/rapier3d-compat";
|
|
2
|
+
import { GroupProps, OrthographicCameraProps } from "@react-three/fiber";
|
|
3
|
+
import { RapierRigidBody, RigidBodyProps } from "@react-three/rapier";
|
|
4
|
+
import { ReactNode, RefObject } from "react";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import { cameraRayType } from "../camera/type.js";
|
|
7
|
+
import { callbackType } from "../initial/callback/type.js";
|
|
8
|
+
import { keyControlType } from "../world/context/type.js";
|
|
9
|
+
import { airplaneType, characterType, gaesupCameraOptionType, gaesupCameraPropType, perspectiveCameraPropType, vehicleType } from "./context/type.js";
|
|
10
|
+
export type constantType = {
|
|
11
|
+
jumpSpeed: number;
|
|
12
|
+
turnSpeed: number;
|
|
13
|
+
walkSpeed: number;
|
|
14
|
+
runSpeed: number;
|
|
15
|
+
accelRate: number;
|
|
16
|
+
brakeRate: number;
|
|
17
|
+
wheelOffset: number;
|
|
18
|
+
linearDamping: number;
|
|
19
|
+
cameraInitDistance: number;
|
|
20
|
+
cameraMaxDistance: number;
|
|
21
|
+
cameraMinDistance: number;
|
|
22
|
+
cameraInitDirection: number;
|
|
23
|
+
cameraCollisionOff: number;
|
|
24
|
+
cameraDistance: number;
|
|
25
|
+
cameraCamFollow: number;
|
|
26
|
+
};
|
|
27
|
+
export type optionsType = {
|
|
28
|
+
debug: boolean;
|
|
29
|
+
mode?: "normal" | "vehicle" | "airplane";
|
|
30
|
+
controllerType: "none" | "gameboy" | "joystick" | "keyboard";
|
|
31
|
+
cameraCollisionType: "transparent" | "closeUp";
|
|
32
|
+
camera: {
|
|
33
|
+
type: "perspective" | "orthographic";
|
|
34
|
+
control: "orbit" | "normal";
|
|
35
|
+
};
|
|
36
|
+
minimap: boolean;
|
|
37
|
+
minimapRatio: number;
|
|
38
|
+
};
|
|
39
|
+
export type partialOptionsType = Partial<optionsType>;
|
|
40
|
+
export type partialConstantType = Partial<constantType>;
|
|
41
|
+
export type jumpInnerType = {
|
|
42
|
+
velocity: THREE.Vector3;
|
|
43
|
+
direction: THREE.Vector3;
|
|
44
|
+
};
|
|
45
|
+
export type jumpConstType = {
|
|
46
|
+
speed: number;
|
|
47
|
+
gravity: number;
|
|
48
|
+
};
|
|
49
|
+
export type jumpPropType = jumpInnerType & jumpConstType;
|
|
50
|
+
export type rayType = {
|
|
51
|
+
origin: THREE.Vector3;
|
|
52
|
+
hit: RayColliderToi | null;
|
|
53
|
+
rayCast: Ray | null;
|
|
54
|
+
dir: THREE.Vector3;
|
|
55
|
+
offset: THREE.Vector3;
|
|
56
|
+
length: number;
|
|
57
|
+
current?: THREE.Vector3;
|
|
58
|
+
angle?: number;
|
|
59
|
+
parent?: RapierRigidBody | null | undefined;
|
|
60
|
+
};
|
|
61
|
+
export type slopeRayType = Omit<rayType, "parent">;
|
|
62
|
+
export type groundRayType = Omit<rayType, "current" | "angle">;
|
|
63
|
+
export type propType = {
|
|
64
|
+
children?: ReactNode;
|
|
65
|
+
groupProps?: GroupProps;
|
|
66
|
+
rigidBodyProps?: RigidBodyProps;
|
|
67
|
+
slopeRay: slopeRayType;
|
|
68
|
+
groundRay: groundRayType;
|
|
69
|
+
cameraRay: cameraRayType;
|
|
70
|
+
constant: constantType;
|
|
71
|
+
capsuleColliderRef: RefObject<Collider>;
|
|
72
|
+
rigidBodyRef: RefObject<RapierRigidBody>;
|
|
73
|
+
outerGroupRef: RefObject<THREE.Group>;
|
|
74
|
+
innerGroupRef: RefObject<THREE.Group>;
|
|
75
|
+
slopeRayOriginRef: RefObject<THREE.Mesh>;
|
|
76
|
+
jointRefs?: RefObject<RevoluteImpulseJoint>;
|
|
77
|
+
characterUrl?: string;
|
|
78
|
+
kartUrl?: string;
|
|
79
|
+
airplaneUrl?: string;
|
|
80
|
+
keyControl: keyControlType;
|
|
81
|
+
debug?: boolean;
|
|
82
|
+
callbacks?: callbackType;
|
|
83
|
+
isRider?: boolean;
|
|
84
|
+
};
|
|
85
|
+
export type animationTagType = {
|
|
86
|
+
idle: string;
|
|
87
|
+
walk: string;
|
|
88
|
+
run: string;
|
|
89
|
+
jump: string;
|
|
90
|
+
jumpIdle: string;
|
|
91
|
+
jumpLand: string;
|
|
92
|
+
fall: string;
|
|
93
|
+
ride: string;
|
|
94
|
+
};
|
|
95
|
+
export type actionsType = animationTagType & {
|
|
96
|
+
[key: string]: string;
|
|
97
|
+
};
|
|
98
|
+
export type refsType = {
|
|
99
|
+
capsuleColliderRef: RefObject<Collider>;
|
|
100
|
+
rigidBodyRef: RefObject<RapierRigidBody>;
|
|
101
|
+
outerGroupRef: RefObject<THREE.Group>;
|
|
102
|
+
innerGroupRef: RefObject<THREE.Group>;
|
|
103
|
+
slopeRayOriginRef: RefObject<THREE.Mesh>;
|
|
104
|
+
characterInnerRef: RefObject<THREE.Group>;
|
|
105
|
+
jointRefs: RefObject<RevoluteImpulseJoint>;
|
|
106
|
+
};
|
|
107
|
+
export interface controllerPropType extends RigidBodyProps {
|
|
108
|
+
children?: ReactNode;
|
|
109
|
+
debug?: boolean;
|
|
110
|
+
slopeRay?: slopeRayType;
|
|
111
|
+
props?: RigidBodyProps;
|
|
112
|
+
constant?: partialConstantType;
|
|
113
|
+
groupProps?: GroupProps;
|
|
114
|
+
rigidBodyProps?: RigidBodyProps;
|
|
115
|
+
cameraMode?: gaesupCameraPropType;
|
|
116
|
+
cameraOption?: gaesupCameraOptionType;
|
|
117
|
+
perspectiveCamera?: perspectiveCameraPropType;
|
|
118
|
+
orthographicCamera?: OrthographicCameraProps;
|
|
119
|
+
airplane?: airplaneType;
|
|
120
|
+
vehicle?: vehicleType;
|
|
121
|
+
character?: characterType;
|
|
122
|
+
isRider?: boolean;
|
|
123
|
+
}
|
|
124
|
+
export type controllerType = controllerPropType & {} & callbackType;
|
|
@@ -8,10 +8,9 @@ import { GroupProps, OrthographicCameraProps } from "@react-three/fiber";
|
|
|
8
8
|
import { RapierRigidBody, RigidBodyProps } from "@react-three/rapier";
|
|
9
9
|
import { ReactNode, RefObject } from "react";
|
|
10
10
|
import * as THREE from "three";
|
|
11
|
-
import { cameraRayType } from "../camera/type";
|
|
12
|
-
import { callbackType } from "../initial/callback/type";
|
|
13
|
-
|
|
14
|
-
import { keyControlType } from "../world/context/type";
|
|
11
|
+
import { cameraRayType } from "../camera/type.js";
|
|
12
|
+
import { callbackType } from "../initial/callback/type.js";
|
|
13
|
+
import { keyControlType } from "../world/context/type.js";
|
|
15
14
|
import {
|
|
16
15
|
airplaneType,
|
|
17
16
|
characterType,
|
|
@@ -19,7 +18,7 @@ import {
|
|
|
19
18
|
gaesupCameraPropType,
|
|
20
19
|
perspectiveCameraPropType,
|
|
21
20
|
vehicleType,
|
|
22
|
-
} from "./context/type";
|
|
21
|
+
} from "./context/type.js";
|
|
23
22
|
|
|
24
23
|
export type constantType = {
|
|
25
24
|
jumpSpeed: number;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RootState } from "@react-three/fiber";
|
|
3
|
+
import { cameraRayType } from "../../camera/type";
|
|
4
|
+
import { actionsType, constantType, groundRayType, propType, slopeRayType } from "../../controller/type";
|
|
5
|
+
import { activeStateType, animationPropType, keyControlType, statesType } from "../../world/context/type";
|
|
6
|
+
export type initCallbackType = {
|
|
7
|
+
prop: propType;
|
|
8
|
+
callbacks?: callbackType;
|
|
9
|
+
outerGroupRef: React.MutableRefObject<THREE.Group | undefined>;
|
|
10
|
+
};
|
|
11
|
+
export type callbackPropType = {
|
|
12
|
+
activeState: activeStateType;
|
|
13
|
+
states: statesType;
|
|
14
|
+
slopeRay: slopeRayType;
|
|
15
|
+
groundRay: groundRayType;
|
|
16
|
+
cameraRay: cameraRayType;
|
|
17
|
+
constant: constantType;
|
|
18
|
+
control: keyControlType;
|
|
19
|
+
};
|
|
20
|
+
export type onFramePropType = callbackPropType & RootState;
|
|
21
|
+
export type onAnimatePropType = onFramePropType & {
|
|
22
|
+
actions: {
|
|
23
|
+
[x: string]: THREE.AnimationAction | null;
|
|
24
|
+
};
|
|
25
|
+
animation: animationPropType;
|
|
26
|
+
playAnimation: (tag: keyof actionsType) => void;
|
|
27
|
+
};
|
|
28
|
+
export type callbackType = {
|
|
29
|
+
onReady?: (prop: callbackPropType) => void;
|
|
30
|
+
onFrame?: (prop: onFramePropType) => void;
|
|
31
|
+
onDestory?: (prop: callbackPropType) => void;
|
|
32
|
+
onAnimate?: (prop: onAnimatePropType) => void;
|
|
33
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { constantType, controllerType, groundRayType, refsType, slopeRayType } from "../../controller/type";
|
|
4
|
+
import { keyControlType } from "../../world/context/type";
|
|
5
|
+
export default function initControllerProps({ props, refs, }: {
|
|
6
|
+
props: controllerType;
|
|
7
|
+
refs: refsType;
|
|
8
|
+
}): {
|
|
9
|
+
children?: import("react").ReactNode;
|
|
10
|
+
groupProps?: import("@react-three/fiber").GroupProps;
|
|
11
|
+
rigidBodyProps?: import("@react-three/rapier").RigidBodyProps;
|
|
12
|
+
slopeRay: slopeRayType;
|
|
13
|
+
groundRay: groundRayType;
|
|
14
|
+
cameraRay: import("../../camera/type").cameraRayType;
|
|
15
|
+
constant: constantType;
|
|
16
|
+
capsuleColliderRef: import("react").RefObject<import("@react-three/rapier").RapierCollider>;
|
|
17
|
+
rigidBodyRef: import("react").RefObject<import("@react-three/rapier").RapierRigidBody>;
|
|
18
|
+
outerGroupRef: import("react").RefObject<THREE.Group<THREE.Object3DEventMap>>;
|
|
19
|
+
innerGroupRef: import("react").RefObject<THREE.Group<THREE.Object3DEventMap>>;
|
|
20
|
+
slopeRayOriginRef: import("react").RefObject<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
21
|
+
jointRefs?: import("react").RefObject<import("@dimforge/rapier3d-compat").RevoluteImpulseJoint>;
|
|
22
|
+
characterUrl?: string;
|
|
23
|
+
kartUrl?: string;
|
|
24
|
+
airplaneUrl?: string;
|
|
25
|
+
keyControl: keyControlType;
|
|
26
|
+
debug?: boolean;
|
|
27
|
+
callbacks?: import("../callback/type").callbackType;
|
|
28
|
+
isRider?: boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { propType } from "../../controller/type";
|
|
3
|
+
export default function initDebug(prop: propType): {
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
groupProps?: import("@react-three/fiber").GroupProps;
|
|
6
|
+
rigidBodyProps?: import("@react-three/rapier").RigidBodyProps;
|
|
7
|
+
slopeRay: import("../../controller/type").slopeRayType;
|
|
8
|
+
groundRay: import("../../controller/type").groundRayType;
|
|
9
|
+
cameraRay: import("../../camera/type").cameraRayType;
|
|
10
|
+
constant: import("../../controller/type").constantType;
|
|
11
|
+
capsuleColliderRef: import("react").RefObject<import("@dimforge/rapier3d-compat").Collider>;
|
|
12
|
+
rigidBodyRef: import("react").RefObject<import("@dimforge/rapier3d-compat").RigidBody>;
|
|
13
|
+
outerGroupRef: import("react").RefObject<import("three").Group<import("three").Object3DEventMap>>;
|
|
14
|
+
innerGroupRef: import("react").RefObject<import("three").Group<import("three").Object3DEventMap>>;
|
|
15
|
+
slopeRayOriginRef: import("react").RefObject<import("three").Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes>, import("three").Material | import("three").Material[], import("three").Object3DEventMap>>;
|
|
16
|
+
jointRefs?: import("react").RefObject<import("@dimforge/rapier3d-compat").RevoluteImpulseJoint>;
|
|
17
|
+
characterUrl?: string;
|
|
18
|
+
kartUrl?: string;
|
|
19
|
+
airplaneUrl?: string;
|
|
20
|
+
keyControl: import("../../world/context/type").keyControlType;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
callbacks?: import("../callback/type").callbackType;
|
|
23
|
+
isRider?: boolean;
|
|
24
|
+
};
|