gaesup-world 0.0.6 → 0.0.7
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 +177 -28
- package/dist/gaesup/animation/actions.d.ts +25 -0
- package/dist/gaesup/animation/actions.js +126 -0
- package/dist/gaesup/animation/index.d.ts +1 -0
- package/dist/gaesup/animation/index.js +1 -0
- package/dist/gaesup/animation/passiveActions.d.ts +9 -0
- package/dist/gaesup/animation/passiveActions.js +16 -0
- package/dist/gaesup/camera/cameraCollisionDetecter.d.ts +4 -0
- package/dist/{src/gaesup → gaesup}/camera/control/normal.js +1 -1
- package/dist/{src/gaesup → gaesup}/camera/index.d.ts +2 -2
- package/dist/gaesup/component/active/airplane/collider.d.ts +6 -0
- package/dist/gaesup/component/active/airplane/collider.js +22 -0
- package/dist/gaesup/component/active/airplane/index.d.ts +5 -0
- package/dist/gaesup/component/active/airplane/index.js +11 -0
- package/dist/gaesup/component/active/character/collider.d.ts +6 -0
- package/dist/gaesup/component/active/character/collider.js +24 -0
- package/dist/gaesup/component/active/character/index.d.ts +5 -0
- package/dist/gaesup/component/active/character/index.js +16 -0
- package/dist/gaesup/component/active/common/InnerGroupRef.d.ts +10 -0
- package/dist/gaesup/component/active/common/InnerGroupRef.js +32 -0
- package/dist/gaesup/component/active/common/OuterGroupRef.d.ts +6 -0
- package/dist/{src/gaesup/tools/reducer.js → gaesup/component/active/common/OuterGroupRef.js} +6 -13
- package/dist/gaesup/component/active/common/RigidbodyRef.d.ts +7 -0
- package/dist/gaesup/component/active/common/RigidbodyRef.js +22 -0
- package/dist/gaesup/component/active/common/WrapperRef.d.ts +12 -0
- package/dist/gaesup/component/active/common/WrapperRef.js +9 -0
- package/dist/gaesup/component/active/common/slopeRayRef.d.ts +6 -0
- package/dist/gaesup/component/active/common/slopeRayRef.js +10 -0
- package/dist/gaesup/component/active/vehicle/collider.d.ts +3 -0
- package/dist/gaesup/component/active/vehicle/collider.js +9 -0
- package/dist/gaesup/component/active/vehicle/index.d.ts +5 -0
- package/dist/gaesup/component/active/vehicle/index.js +12 -0
- package/dist/gaesup/component/active/vehicle/wheel.d.ts +12 -0
- package/dist/gaesup/component/active/vehicle/wheel.js +13 -0
- package/dist/gaesup/component/active/vehicle/wheels.d.ts +7 -0
- package/dist/gaesup/component/active/vehicle/wheels.js +22 -0
- package/dist/gaesup/component/index.d.ts +7 -0
- package/dist/gaesup/component/index.js +20 -0
- package/dist/gaesup/component/passive/airplane/collider.d.ts +6 -0
- package/dist/gaesup/component/passive/airplane/collider.js +8 -0
- package/dist/gaesup/component/passive/airplane/index.d.ts +4 -0
- package/dist/gaesup/component/passive/airplane/index.js +25 -0
- package/dist/gaesup/component/passive/character/collider.d.ts +6 -0
- package/dist/gaesup/component/passive/character/collider.js +7 -0
- package/dist/gaesup/component/passive/character/index.d.ts +4 -0
- package/dist/gaesup/component/passive/character/index.js +25 -0
- package/dist/gaesup/component/passive/common/InnerGroupRef.d.ts +8 -0
- package/dist/gaesup/component/passive/common/InnerGroupRef.js +27 -0
- package/dist/gaesup/component/passive/common/OuterGroupRef.d.ts +4 -0
- package/dist/gaesup/component/passive/common/OuterGroupRef.js +6 -0
- package/dist/gaesup/component/passive/common/PassiveWrapperRef.d.ts +10 -0
- package/dist/gaesup/component/passive/common/PassiveWrapperRef.js +8 -0
- package/dist/gaesup/component/passive/common/RigidbodyRef.d.ts +5 -0
- package/dist/gaesup/component/passive/common/RigidbodyRef.js +7 -0
- package/dist/gaesup/component/passive/type.d.ts +30 -0
- package/dist/gaesup/component/passive/vehicle/collider.d.ts +7 -0
- package/dist/gaesup/component/passive/vehicle/collider.js +8 -0
- package/dist/gaesup/component/passive/vehicle/index.d.ts +4 -0
- package/dist/gaesup/component/passive/vehicle/index.js +26 -0
- package/dist/gaesup/component/passive/vehicle/wheel.d.ts +16 -0
- package/dist/gaesup/component/passive/vehicle/wheel.js +10 -0
- package/dist/gaesup/component/passive/vehicle/wheels.d.ts +11 -0
- package/dist/gaesup/component/passive/vehicle/wheels.js +27 -0
- package/dist/gaesup/component/type.d.ts +18 -0
- package/dist/gaesup/controller/context/index.d.ts +67 -0
- package/dist/{src/gaesup → gaesup}/controller/context/index.js +36 -8
- package/dist/gaesup/controller/context/reducer.d.ts +16 -0
- package/dist/gaesup/controller/context/type.d.ts +71 -0
- package/dist/gaesup/controller/debug/airplane.d.ts +71 -0
- package/dist/gaesup/controller/debug/airplane.js +71 -0
- package/dist/gaesup/controller/debug/cameraOption.d.ts +27 -0
- package/dist/gaesup/controller/debug/cameraOption.js +27 -0
- package/dist/gaesup/controller/debug/character.d.ts +27 -0
- package/dist/gaesup/controller/debug/character.js +27 -0
- package/dist/gaesup/controller/debug/index.d.ts +6 -0
- package/dist/gaesup/controller/debug/index.js +100 -0
- package/dist/gaesup/controller/debug/orthographicCamera.d.ts +17 -0
- package/dist/gaesup/controller/debug/orthographicCamera.js +17 -0
- package/dist/gaesup/controller/debug/perspectiveCamera.d.ts +12 -0
- package/dist/gaesup/controller/debug/perspectiveCamera.js +12 -0
- package/dist/gaesup/controller/debug/vehicle.d.ts +27 -0
- package/dist/gaesup/controller/debug/vehicle.js +27 -0
- package/dist/{src/gaesup → gaesup}/controller/index.d.ts +1 -1
- package/dist/{src/gaesup → gaesup}/controller/index.js +45 -34
- package/dist/gaesup/controller/initialize/callback/index.d.ts +2 -0
- package/dist/gaesup/controller/initialize/callback/index.js +57 -0
- package/dist/{src/gaesup/initial → gaesup/controller/initialize}/callback/type.d.ts +4 -11
- package/dist/gaesup/controller/initialize/index.d.ts +27 -0
- package/dist/{src/gaesup/initial/controller → gaesup/controller/initialize}/index.js +8 -42
- package/dist/{src/gaesup → gaesup}/controller/type.d.ts +23 -56
- package/dist/{src/gaesup → gaesup}/gaesupProps/index.d.ts +1 -1
- package/dist/{src/gaesup → gaesup}/gaesupProps/index.js +5 -7
- package/dist/gaesup/hooks/index.d.ts +1 -0
- package/dist/gaesup/hooks/index.js +1 -0
- package/dist/gaesup/hooks/useGaesupController/index.d.ts +12 -0
- package/dist/gaesup/hooks/useGaesupController/index.js +18 -0
- package/dist/gaesup/index.d.ts +8 -0
- package/dist/gaesup/index.js +8 -0
- package/dist/gaesup/mutation/airplane/index.d.ts +2 -0
- package/dist/gaesup/mutation/airplane/index.js +6 -0
- package/dist/gaesup/mutation/airplane/rotation.d.ts +2 -0
- package/dist/gaesup/mutation/airplane/rotation.js +9 -0
- package/dist/gaesup/mutation/character/index.d.ts +2 -0
- package/dist/gaesup/mutation/character/index.js +8 -0
- package/dist/gaesup/mutation/character/rotation.d.ts +2 -0
- package/dist/gaesup/mutation/character/rotation.js +5 -0
- package/dist/gaesup/mutation/common/stabilizing.d.ts +2 -0
- package/dist/gaesup/mutation/common/stabilizing.js +4 -0
- package/dist/gaesup/mutation/common/transition.d.ts +2 -0
- package/dist/gaesup/mutation/common/transition.js +4 -0
- package/dist/gaesup/mutation/index.d.ts +7 -0
- package/dist/gaesup/mutation/index.js +35 -0
- package/dist/gaesup/mutation/type.d.ts +21 -0
- package/dist/gaesup/mutation/vehicle/index.d.ts +2 -0
- package/dist/gaesup/mutation/vehicle/index.js +6 -0
- package/dist/gaesup/mutation/vehicle/rotation.d.ts +2 -0
- package/dist/gaesup/mutation/vehicle/rotation.js +5 -0
- package/dist/gaesup/physics/airplane/damping.js +5 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/direction.js +3 -2
- package/dist/{src/gaesup → gaesup}/physics/airplane/gravity.js +3 -2
- package/dist/{src/gaesup → gaesup}/physics/airplane/impulse.js +1 -1
- package/dist/{src/gaesup → gaesup}/physics/character/accelaration.js +1 -1
- package/dist/gaesup/physics/character/damping.js +4 -0
- package/dist/{src/gaesup → gaesup}/physics/character/direction.js +8 -9
- package/dist/{src/gaesup → gaesup}/physics/character/impulse.js +1 -1
- package/dist/{src/gaesup → gaesup}/physics/character/jump.js +2 -3
- package/dist/gaesup/physics/character/turn.js +9 -0
- package/dist/gaesup/physics/index.d.ts +2 -0
- package/dist/{src/gaesup → gaesup}/physics/index.js +9 -2
- package/dist/{src/gaesup → gaesup}/physics/type.d.ts +8 -7
- package/dist/gaesup/physics/vehicle/damping.js +6 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/impulse.js +4 -6
- package/dist/gaesup/tools/gameboy/GameBoyButton.d.ts +9 -0
- package/dist/{src/gaesup → gaesup}/tools/gameboy/GameBoyButton.js +3 -5
- package/dist/{src/gaesup → gaesup}/tools/gameboy/index.d.ts +2 -1
- package/dist/gaesup/tools/gameboy/index.js +23 -0
- package/dist/{src/gaesup → gaesup}/tools/gameboy/style.css.d.ts +0 -1
- package/dist/{src/gaesup → gaesup}/tools/gameboy/style.css.js +4 -15
- package/dist/gaesup/tools/gameboy/type.d.ts +4 -0
- package/dist/gaesup/tools/gamepad/GamePadButton.d.ts +6 -0
- package/dist/{src/gaesup → gaesup}/tools/gamepad/GamePadButton.js +4 -5
- package/dist/gaesup/tools/gamepad/index.d.ts +2 -0
- package/dist/gaesup/tools/gamepad/index.js +30 -0
- package/dist/{src/gaesup → gaesup}/tools/gamepad/style.css.js +1 -1
- package/dist/gaesup/tools/gamepad/type.d.ts +6 -0
- package/dist/gaesup/tools/index.d.ts +5 -0
- package/dist/gaesup/tools/index.js +5 -0
- package/dist/{src/gaesup → gaesup}/tools/joystick/default.d.ts +0 -4
- package/dist/{src/gaesup → gaesup}/tools/joystick/default.js +0 -4
- package/dist/gaesup/tools/joystick/index.d.ts +2 -0
- package/dist/gaesup/tools/joystick/index.js +169 -0
- package/dist/{src/gaesup → gaesup}/tools/joystick/style.css.d.ts +0 -1
- package/dist/{src/gaesup → gaesup}/tools/joystick/style.css.js +5 -18
- package/dist/{src/gaesup → gaesup}/tools/joystick/type.d.ts +2 -7
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/default.d.ts +0 -1
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/default.js +0 -1
- package/dist/gaesup/tools/keyBoardToolTip/index.d.ts +2 -0
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/index.js +7 -14
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/style.css.d.ts +0 -1
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/style.css.js +1 -21
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/type.d.ts +8 -5
- package/dist/{src/gaesup → gaesup}/tools/minimap/default.d.ts +4 -3
- package/dist/{src/gaesup → gaesup}/tools/minimap/default.js +4 -3
- package/dist/gaesup/tools/minimap/index.d.ts +2 -0
- package/dist/gaesup/tools/minimap/index.js +66 -0
- package/dist/gaesup/tools/minimap/style.css.d.ts +41 -0
- package/dist/{src/gaesup → gaesup}/tools/minimap/style.css.js +99 -19
- package/dist/gaesup/tools/minimap/type.d.ts +20 -0
- package/dist/gaesup/tools/type.d.ts +2 -0
- package/dist/gaesup/utils/context.d.ts +2 -0
- package/dist/gaesup/utils/context.js +3 -0
- package/dist/gaesup/utils/debug.d.ts +29 -0
- package/dist/gaesup/utils/debug.js +36 -0
- package/dist/gaesup/utils/gltf.d.ts +7 -0
- package/dist/gaesup/utils/gltf.js +10 -0
- package/dist/gaesup/utils/type.d.ts +5 -0
- package/dist/{src/gaesup → gaesup}/utils/vector.d.ts +1 -0
- package/dist/{src/gaesup → gaesup}/utils/vector.js +3 -0
- package/dist/gaesup/world/context/index.d.ts +6 -0
- package/dist/{src/gaesup → gaesup}/world/context/index.js +28 -9
- package/dist/{src/gaesup → gaesup}/world/context/reducer.d.ts +10 -8
- package/dist/{src/gaesup → gaesup}/world/context/reducer.js +0 -3
- package/dist/{src/gaesup → gaesup}/world/context/type.d.ts +24 -19
- package/dist/gaesup/world/debug/index.d.ts +2 -0
- package/dist/gaesup/world/debug/index.js +27 -0
- package/dist/gaesup/world/debug/mode.d.ts +10 -0
- package/dist/gaesup/world/debug/mode.js +10 -0
- package/dist/gaesup/world/index.d.ts +2 -0
- package/dist/{src/gaesup → gaesup}/world/index.js +2 -2
- package/dist/gaesup/world/initalize/collider/airplane.js +24 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/collider/character.js +10 -13
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/collider/gltf.d.ts +1 -1
- package/dist/gaesup/world/initalize/collider/gltf.js +54 -0
- package/dist/gaesup/world/initalize/collider/index.d.ts +2 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/collider/index.js +2 -1
- package/dist/gaesup/world/initalize/collider/vehicle.js +55 -0
- package/dist/gaesup/world/initalize/index.d.ts +35 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/index.js +9 -4
- package/dist/gaesup/world/initalize/type.d.ts +13 -0
- package/dist/gaesup/world/type.d.ts +19 -0
- package/dist/gaesup/world/type.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles/global.css.d.ts +1 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/index.js +2 -0
- package/dist/styles/sprinkles/index.css.d.ts +368 -0
- package/index.ts +7 -0
- package/package.json +10 -22
- package/dist/examples/select/App.d.ts +0 -2
- package/dist/examples/select/App.js +0 -6
- package/dist/examples/select/global.css.js +0 -71
- package/dist/examples/select/main.d.ts +0 -1
- package/dist/examples/select/main.js +0 -6
- package/dist/examples/select/platform/ControlledInput.d.ts +0 -1
- package/dist/examples/select/platform/ControlledInput.js +0 -40
- package/dist/examples/select/platform/DynamicPlatforms.d.ts +0 -8
- package/dist/examples/select/platform/DynamicPlatforms.js +0 -48
- package/dist/examples/select/platform/FloatMove.d.ts +0 -14
- package/dist/examples/select/platform/FloatMove.js +0 -60
- package/dist/examples/select/platform/Floor.d.ts +0 -1
- package/dist/examples/select/platform/Floor.js +0 -7
- package/dist/examples/select/platform/RigidObjects.d.ts +0 -1
- package/dist/examples/select/platform/RigidObjects.js +0 -7
- package/dist/examples/select/platform/RoughPlane.d.ts +0 -1
- package/dist/examples/select/platform/RoughPlane.js +0 -20
- package/dist/examples/select/platform/Slopes.d.ts +0 -1
- package/dist/examples/select/platform/Slopes.js +0 -27
- package/dist/examples/select/platform/style.css.d.ts +0 -1
- package/dist/examples/select/platform/style.css.js +0 -11
- package/dist/examples/select/src/index.d.ts +0 -5
- package/dist/examples/select/src/index.js +0 -139
- package/dist/examples/select/src/keyboardMap/character.d.ts +0 -8
- package/dist/examples/select/src/keyboardMap/character.js +0 -18
- package/dist/examples/select/src/keyboardMap/vehicle.d.ts +0 -4
- package/dist/examples/select/src/keyboardMap/vehicle.js +0 -8
- package/dist/examples/select/src/style.css.d.ts +0 -35
- package/dist/examples/select/src/style.css.js +0 -81
- package/dist/src/gaesup/animation/actions.d.ts +0 -8
- package/dist/src/gaesup/animation/actions.js +0 -100
- package/dist/src/gaesup/animation/index.d.ts +0 -1
- package/dist/src/gaesup/animation/index.js +0 -1
- package/dist/src/gaesup/camera/cameraCollisionDetecter.d.ts +0 -4
- package/dist/src/gaesup/component/Airplane.d.ts +0 -5
- package/dist/src/gaesup/component/Airplane.js +0 -14
- package/dist/src/gaesup/component/Character.d.ts +0 -5
- package/dist/src/gaesup/component/Character.js +0 -13
- package/dist/src/gaesup/component/Vehicle.d.ts +0 -5
- package/dist/src/gaesup/component/Vehicle.js +0 -15
- package/dist/src/gaesup/component/gltf/AirplaneGltf.d.ts +0 -2
- package/dist/src/gaesup/component/gltf/AirplaneGltf.js +0 -13
- package/dist/src/gaesup/component/gltf/CharacterGltf.d.ts +0 -14
- package/dist/src/gaesup/component/gltf/CharacterGltf.js +0 -46
- package/dist/src/gaesup/component/gltf/VehicleGltf.d.ts +0 -2
- package/dist/src/gaesup/component/gltf/VehicleGltf.js +0 -13
- package/dist/src/gaesup/component/gltf/WheelJoint.d.ts +0 -4
- package/dist/src/gaesup/component/gltf/WheelJoint.js +0 -21
- package/dist/src/gaesup/component/gltf/index.d.ts +0 -4
- package/dist/src/gaesup/component/gltf/index.js +0 -4
- package/dist/src/gaesup/component/gltf/type.d.ts +0 -10
- package/dist/src/gaesup/component/index.d.ts +0 -5
- package/dist/src/gaesup/component/index.js +0 -5
- package/dist/src/gaesup/component/ref/airplane.d.ts +0 -16
- package/dist/src/gaesup/component/ref/airplane.js +0 -46
- package/dist/src/gaesup/component/ref/character.d.ts +0 -20
- package/dist/src/gaesup/component/ref/character.js +0 -56
- package/dist/src/gaesup/component/ref/index.d.ts +0 -3
- package/dist/src/gaesup/component/ref/index.js +0 -3
- package/dist/src/gaesup/component/ref/vehicle.d.ts +0 -24
- package/dist/src/gaesup/component/ref/vehicle.js +0 -41
- package/dist/src/gaesup/component/setInit.d.ts +0 -3
- package/dist/src/gaesup/component/setInit.js +0 -10
- package/dist/src/gaesup/controller/context/index.d.ts +0 -40
- package/dist/src/gaesup/controller/context/reducer.d.ts +0 -14
- package/dist/src/gaesup/controller/context/type.d.ts +0 -52
- package/dist/src/gaesup/index.d.ts +0 -8
- package/dist/src/gaesup/index.js +0 -8
- package/dist/src/gaesup/initial/callback/index.d.ts +0 -2
- package/dist/src/gaesup/initial/callback/index.js +0 -51
- package/dist/src/gaesup/initial/controller/index.d.ts +0 -29
- package/dist/src/gaesup/initial/controller/initDebug.d.ts +0 -24
- package/dist/src/gaesup/initial/controller/initDebug.js +0 -110
- package/dist/src/gaesup/initial/gaesupWorld/collider/airplane.js +0 -25
- package/dist/src/gaesup/initial/gaesupWorld/collider/gltf.js +0 -71
- package/dist/src/gaesup/initial/gaesupWorld/collider/index.d.ts +0 -6
- package/dist/src/gaesup/initial/gaesupWorld/collider/vehicle.js +0 -40
- package/dist/src/gaesup/initial/gaesupWorld/index.d.ts +0 -33
- package/dist/src/gaesup/initial/gaesupWorld/type.d.ts +0 -28
- package/dist/src/gaesup/initial/index.d.ts +0 -3
- package/dist/src/gaesup/initial/index.js +0 -3
- package/dist/src/gaesup/physics/airplane/damping.js +0 -4
- package/dist/src/gaesup/physics/character/damping.js +0 -4
- package/dist/src/gaesup/physics/character/turn.js +0 -6
- package/dist/src/gaesup/physics/index.d.ts +0 -2
- package/dist/src/gaesup/physics/vehicle/damping.js +0 -6
- package/dist/src/gaesup/tools/context.d.ts +0 -4
- package/dist/src/gaesup/tools/context.js +0 -3
- package/dist/src/gaesup/tools/gameboy/GameBoyButton.d.ts +0 -7
- package/dist/src/gaesup/tools/gameboy/default.d.ts +0 -3
- package/dist/src/gaesup/tools/gameboy/default.js +0 -3
- package/dist/src/gaesup/tools/gameboy/index.js +0 -21
- package/dist/src/gaesup/tools/gameboy/type.d.ts +0 -7
- package/dist/src/gaesup/tools/gamepad/GamePadButton.d.ts +0 -4
- package/dist/src/gaesup/tools/gamepad/index.d.ts +0 -1
- package/dist/src/gaesup/tools/gamepad/index.js +0 -30
- package/dist/src/gaesup/tools/gamepad/type.d.ts +0 -8
- package/dist/src/gaesup/tools/index.d.ts +0 -2
- package/dist/src/gaesup/tools/index.js +0 -44
- package/dist/src/gaesup/tools/joystick/index.d.ts +0 -2
- package/dist/src/gaesup/tools/joystick/index.js +0 -138
- package/dist/src/gaesup/tools/keyBoardToolTip/index.d.ts +0 -1
- package/dist/src/gaesup/tools/minimap/index.d.ts +0 -1
- package/dist/src/gaesup/tools/minimap/index.js +0 -57
- package/dist/src/gaesup/tools/minimap/style.css.d.ts +0 -9
- package/dist/src/gaesup/tools/minimap/type.d.ts +0 -24
- package/dist/src/gaesup/tools/reducer.d.ts +0 -11
- package/dist/src/gaesup/tools/style.css.d.ts +0 -3
- package/dist/src/gaesup/tools/style.css.js +0 -31
- package/dist/src/gaesup/tools/type.d.ts +0 -26
- package/dist/src/gaesup/utils/constant.d.ts +0 -1
- package/dist/src/gaesup/utils/constant.js +0 -1
- package/dist/src/gaesup/world/context/index.d.ts +0 -5
- package/dist/src/gaesup/world/index.d.ts +0 -2
- package/dist/src/gaesup/world/type.d.ts +0 -9
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/styles/sprinkles/index.css.d.ts +0 -1
- package/index.html +0 -14
- package/src/gaesup/animation/actions.ts +0 -123
- package/src/gaesup/animation/index.ts +0 -1
- package/src/gaesup/camera/cameraCollisionDetecter.tsx +0 -53
- package/src/gaesup/camera/control/map.ts +0 -10
- package/src/gaesup/camera/control/normal.ts +0 -16
- package/src/gaesup/camera/control/orbit.ts +0 -31
- package/src/gaesup/camera/index.tsx +0 -102
- package/src/gaesup/camera/type.ts +0 -17
- package/src/gaesup/component/Airplane.tsx +0 -52
- package/src/gaesup/component/Character.tsx +0 -58
- package/src/gaesup/component/Vehicle.tsx +0 -43
- package/src/gaesup/component/gltf/AirplaneGltf.tsx +0 -31
- package/src/gaesup/component/gltf/CharacterGltf.tsx +0 -96
- package/src/gaesup/component/gltf/VehicleGltf.tsx +0 -31
- package/src/gaesup/component/gltf/WheelJoint.tsx +0 -39
- package/src/gaesup/component/gltf/index.ts +0 -4
- package/src/gaesup/component/gltf/type.ts +0 -7
- package/src/gaesup/component/index.ts +0 -5
- package/src/gaesup/component/ref/airplane.tsx +0 -97
- package/src/gaesup/component/ref/character.tsx +0 -137
- package/src/gaesup/component/ref/index.ts +0 -3
- package/src/gaesup/component/ref/vehicle.tsx +0 -122
- package/src/gaesup/component/setInit.ts +0 -14
- package/src/gaesup/controller/context/index.ts +0 -53
- package/src/gaesup/controller/context/reducer.ts +0 -18
- package/src/gaesup/controller/context/type.ts +0 -63
- package/src/gaesup/controller/index.tsx +0 -123
- package/src/gaesup/controller/type.ts +0 -149
- package/src/gaesup/gaesupProps/index.tsx +0 -66
- package/src/gaesup/index.ts +0 -8
- package/src/gaesup/initial/callback/index.ts +0 -73
- package/src/gaesup/initial/callback/type.ts +0 -47
- package/src/gaesup/initial/controller/index.ts +0 -157
- package/src/gaesup/initial/controller/initDebug.ts +0 -102
- package/src/gaesup/initial/gaesupWorld/collider/airplane.ts +0 -26
- package/src/gaesup/initial/gaesupWorld/collider/character.ts +0 -32
- package/src/gaesup/initial/gaesupWorld/collider/gltf.ts +0 -92
- package/src/gaesup/initial/gaesupWorld/collider/index.ts +0 -26
- package/src/gaesup/initial/gaesupWorld/collider/vehicle.ts +0 -43
- package/src/gaesup/initial/gaesupWorld/index.ts +0 -84
- package/src/gaesup/initial/gaesupWorld/type.ts +0 -38
- package/src/gaesup/initial/index.ts +0 -3
- package/src/gaesup/physics/airplane/currentSetting.ts +0 -20
- package/src/gaesup/physics/airplane/damping.ts +0 -6
- package/src/gaesup/physics/airplane/direction.ts +0 -79
- package/src/gaesup/physics/airplane/gravity.ts +0 -11
- package/src/gaesup/physics/airplane/impulse.ts +0 -28
- package/src/gaesup/physics/airplane/index.tsx +0 -16
- package/src/gaesup/physics/airplane/turn.ts +0 -11
- package/src/gaesup/physics/character/accelaration.ts +0 -14
- package/src/gaesup/physics/character/currentSetting.ts +0 -20
- package/src/gaesup/physics/character/damping.ts +0 -6
- package/src/gaesup/physics/character/direction.ts +0 -104
- package/src/gaesup/physics/character/impulse.ts +0 -24
- package/src/gaesup/physics/character/index.tsx +0 -20
- package/src/gaesup/physics/character/jump.ts +0 -21
- package/src/gaesup/physics/character/stabilizing.ts +0 -6
- package/src/gaesup/physics/character/turn.ts +0 -17
- package/src/gaesup/physics/check/ground.ts +0 -19
- package/src/gaesup/physics/check/index.ts +0 -12
- package/src/gaesup/physics/check/moving.ts +0 -20
- package/src/gaesup/physics/check/rotate.ts +0 -13
- package/src/gaesup/physics/check/slope.ts +0 -50
- package/src/gaesup/physics/index.ts +0 -50
- package/src/gaesup/physics/type.ts +0 -29
- package/src/gaesup/physics/vehicle/currentSetting.ts +0 -20
- package/src/gaesup/physics/vehicle/damping.ts +0 -12
- package/src/gaesup/physics/vehicle/direction.ts +0 -48
- package/src/gaesup/physics/vehicle/impulse.ts +0 -39
- package/src/gaesup/physics/vehicle/index.tsx +0 -14
- package/src/gaesup/physics/vehicle/turn.ts +0 -11
- package/src/gaesup/styles.css.ts +0 -26
- package/src/gaesup/tools/context.ts +0 -6
- package/src/gaesup/tools/gameboy/GameBoyButton.tsx +0 -47
- package/src/gaesup/tools/gameboy/default.ts +0 -3
- package/src/gaesup/tools/gameboy/index.tsx +0 -37
- package/src/gaesup/tools/gameboy/style.css.ts +0 -96
- package/src/gaesup/tools/gameboy/type.ts +0 -8
- package/src/gaesup/tools/gamepad/GamePadButton.tsx +0 -49
- package/src/gaesup/tools/gamepad/default.ts +0 -3
- package/src/gaesup/tools/gamepad/index.tsx +0 -53
- package/src/gaesup/tools/gamepad/style.css.ts +0 -71
- package/src/gaesup/tools/gamepad/type.ts +0 -9
- package/src/gaesup/tools/index.tsx +0 -82
- package/src/gaesup/tools/joystick/default.ts +0 -76
- package/src/gaesup/tools/joystick/index.tsx +0 -200
- package/src/gaesup/tools/joystick/style.css.ts +0 -49
- package/src/gaesup/tools/joystick/type.ts +0 -32
- package/src/gaesup/tools/jumpPoint/index.tsx +0 -28
- package/src/gaesup/tools/jumpPoint/style.css.ts +0 -34
- package/src/gaesup/tools/keyBoardToolTip/constant.ts +0 -128
- package/src/gaesup/tools/keyBoardToolTip/default.ts +0 -14
- package/src/gaesup/tools/keyBoardToolTip/index.tsx +0 -92
- package/src/gaesup/tools/keyBoardToolTip/style.css.ts +0 -49
- package/src/gaesup/tools/keyBoardToolTip/type.ts +0 -37
- package/src/gaesup/tools/minimap/default.ts +0 -9
- package/src/gaesup/tools/minimap/index.tsx +0 -78
- package/src/gaesup/tools/minimap/style.css.ts +0 -144
- package/src/gaesup/tools/minimap/type.ts +0 -27
- package/src/gaesup/tools/pushKey/index.ts +0 -26
- package/src/gaesup/tools/reducer.ts +0 -21
- package/src/gaesup/tools/style.css.ts +0 -34
- package/src/gaesup/tools/type.ts +0 -26
- package/src/gaesup/utils/constant.ts +0 -1
- package/src/gaesup/utils/index.ts +0 -3
- package/src/gaesup/utils/ray.ts +0 -23
- package/src/gaesup/utils/ref.ts +0 -17
- package/src/gaesup/utils/vector.ts +0 -40
- package/src/gaesup/world/context/index.ts +0 -133
- package/src/gaesup/world/context/reducer.ts +0 -21
- package/src/gaesup/world/context/type.ts +0 -139
- package/src/gaesup/world/index.tsx +0 -14
- package/src/gaesup/world/type.ts +0 -10
- package/src/index.ts +0 -1
- package/src/styles/constants/boxshadow.css.ts +0 -10
- package/src/styles/constants/constant.css.ts +0 -81
- package/src/styles/constants/direction.css.ts +0 -168
- package/src/styles/constants/flex.css.ts +0 -68
- package/src/styles/constants/gradient.css.ts +0 -10
- package/src/styles/constants/grid.css.ts +0 -37
- package/src/styles/constants/palette.css.ts +0 -91
- package/src/styles/constants/translate.css.ts +0 -129
- package/src/styles/global.css.ts +0 -91
- package/src/styles/recipe/base.css.ts +0 -31
- package/src/styles/recipe/button.css.ts +0 -109
- package/src/styles/recipe/index.css.ts +0 -134
- package/src/styles/recipe/input.css.ts +0 -33
- package/src/styles/sprinkles/color.css.ts +0 -62
- package/src/styles/sprinkles/direction.css.ts +0 -26
- package/src/styles/sprinkles/display.css.ts +0 -25
- package/src/styles/sprinkles/fontSize.css.ts +0 -25
- package/src/styles/sprinkles/grid.css.ts +0 -28
- package/src/styles/sprinkles/index.css.ts +0 -22
- package/src/styles/sprinkles/margin.css.ts +0 -30
- package/src/styles/sprinkles/padding.css.ts +0 -30
- package/src/styles/sprinkles/position.css.ts +0 -14
- package/src/styles/sprinkles/size.css.ts +0 -23
- package/src/styles/theme.css.ts +0 -98
- package/tsconfig.json +0 -22
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -9
- package/dist/{src/gaesup → gaesup}/camera/cameraCollisionDetecter.js +0 -0
- package/dist/{src/gaesup → gaesup}/camera/control/map.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/camera/control/map.js +0 -0
- package/dist/{src/gaesup → gaesup}/camera/control/normal.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/camera/control/orbit.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/camera/control/orbit.js +0 -0
- package/dist/{src/gaesup → gaesup}/camera/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/camera/type.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/camera/type.js +0 -0
- package/dist/{src/gaesup/component/gltf → gaesup/component/passive}/type.js +0 -0
- package/dist/{src/gaesup/controller/context → gaesup/component}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/controller/context/reducer.js +0 -0
- package/dist/{src/gaesup/controller → gaesup/controller/context}/type.js +0 -0
- package/dist/{src/gaesup/initial → gaesup/controller/initialize}/callback/type.js +0 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/controller}/type.js +0 -0
- package/dist/{src/gaesup/physics → gaesup/mutation}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/currentSetting.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/currentSetting.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/damping.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/direction.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/gravity.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/impulse.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/turn.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/airplane/turn.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/accelaration.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/currentSetting.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/currentSetting.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/damping.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/direction.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/impulse.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/jump.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/stabilizing.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/stabilizing.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/character/turn.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/ground.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/ground.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/moving.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/moving.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/rotate.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/rotate.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/slope.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/check/slope.js +0 -0
- package/dist/{src/gaesup/tools/gameboy → gaesup/physics}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/currentSetting.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/currentSetting.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/damping.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/direction.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/direction.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/impulse.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/turn.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/physics/vehicle/turn.js +0 -0
- package/dist/{src/gaesup → gaesup}/styles.css.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/styles.css.js +0 -0
- package/dist/{src/gaesup/tools/gamepad → gaesup/tools/gameboy}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/tools/gamepad/default.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/tools/gamepad/default.js +0 -0
- package/dist/{src/gaesup → gaesup}/tools/gamepad/style.css.d.ts +0 -0
- package/dist/{src/gaesup/tools/joystick → gaesup/tools/gamepad}/type.js +0 -0
- package/dist/{src/gaesup/tools/keyBoardToolTip → gaesup/tools/joystick}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/tools/jumpPoint/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/tools/jumpPoint/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/tools/jumpPoint/style.css.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/tools/jumpPoint/style.css.js +0 -0
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/constant.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/tools/keyBoardToolTip/constant.js +0 -0
- package/dist/{src/gaesup/tools/minimap → gaesup/tools/keyBoardToolTip}/type.js +0 -0
- package/dist/{src/gaesup/tools → gaesup/tools/minimap}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/tools/pushKey/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/tools/pushKey/index.js +0 -0
- package/dist/{src/gaesup/world/context → gaesup/tools}/type.js +0 -0
- package/dist/{src/gaesup → gaesup}/utils/index.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/utils/index.js +0 -0
- package/dist/{src/gaesup → gaesup}/utils/ray.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/utils/ray.js +0 -0
- package/dist/{src/gaesup → gaesup}/utils/ref.d.ts +0 -0
- package/dist/{src/gaesup → gaesup}/utils/ref.js +0 -0
- package/dist/{src/gaesup/world → gaesup/utils}/type.js +0 -0
- package/dist/{examples/select/global.css.d.ts → gaesup/world/context/type.js} +0 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/collider/airplane.d.ts +0 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/collider/character.d.ts +0 -0
- package/dist/{src/gaesup/initial/gaesupWorld → gaesup/world/initalize}/collider/vehicle.d.ts +0 -0
- package/dist/{src/styles/global.css.d.ts → gaesup/world/initalize/type.js} +0 -0
- package/dist/{src/styles → styles}/constants/boxshadow.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/boxshadow.css.js +0 -0
- package/dist/{src/styles → styles}/constants/constant.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/constant.css.js +0 -0
- package/dist/{src/styles → styles}/constants/direction.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/direction.css.js +0 -0
- package/dist/{src/styles → styles}/constants/flex.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/flex.css.js +0 -0
- package/dist/{src/styles → styles}/constants/gradient.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/gradient.css.js +0 -0
- package/dist/{src/styles → styles}/constants/grid.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/grid.css.js +0 -0
- package/dist/{src/styles → styles}/constants/palette.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/palette.css.js +0 -0
- package/dist/{src/styles → styles}/constants/translate.css.d.ts +0 -0
- package/dist/{src/styles → styles}/constants/translate.css.js +0 -0
- package/dist/{src/styles → styles}/global.css.js +0 -0
- package/dist/{src/styles → styles}/recipe/base.css.d.ts +0 -0
- package/dist/{src/styles → styles}/recipe/base.css.js +0 -0
- package/dist/{src/styles → styles}/recipe/button.css.d.ts +0 -0
- package/dist/{src/styles → styles}/recipe/button.css.js +0 -0
- package/dist/{src/styles → styles}/recipe/index.css.d.ts +0 -0
- package/dist/{src/styles → styles}/recipe/index.css.js +0 -0
- package/dist/{src/styles → styles}/recipe/input.css.d.ts +0 -0
- package/dist/{src/styles → styles}/recipe/input.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/color.css.d.ts +14 -14
- package/dist/{src/styles → styles}/sprinkles/color.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/direction.css.d.ts +24 -24
- package/dist/{src/styles → styles}/sprinkles/direction.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/display.css.d.ts +2 -2
- package/dist/{src/styles → styles}/sprinkles/display.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/fontSize.css.d.ts +12 -12
- package/dist/{src/styles → styles}/sprinkles/fontSize.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/grid.css.d.ts +0 -0
- package/dist/{src/styles → styles}/sprinkles/grid.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/index.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/margin.css.d.ts +55 -55
- package/dist/{src/styles → styles}/sprinkles/margin.css.js +0 -0
- package/dist/{src/styles → styles}/sprinkles/padding.css.d.ts +55 -55
- /package/dist/{src/styles → styles}/sprinkles/padding.css.js +0 -0
- /package/dist/{src/styles → styles}/sprinkles/position.css.d.ts +0 -0
- /package/dist/{src/styles → styles}/sprinkles/position.css.js +0 -0
- /package/dist/{src/styles → styles}/sprinkles/size.css.d.ts +0 -0
- /package/dist/{src/styles → styles}/sprinkles/size.css.js +0 -0
- /package/dist/{src/styles → styles}/theme.css.d.ts +0 -0
- /package/dist/{src/styles → styles}/theme.css.js +0 -0
package/README.md
CHANGED
|
@@ -1,51 +1,200 @@
|
|
|
1
1
|
# Gaesup World
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/leva)
|
|
6
|
-
|
|
7
|
-
@react-three/fiber
|
|
8
|
-
@react-three/drei
|
|
9
|
-
three @types/three
|
|
10
|
-
@react-three/rapier
|
|
3
|
+
[](https://www.npmjs.com/package/gaesup-world)
|
|
4
|
+
[](https://www.npmjs.com/package/gaesup-world)
|
|
11
5
|
|
|
12
|
-
|
|
6
|
+
Web 3D Character Controller and World Platform Library
|
|
13
7
|
|
|
14
|
-
|
|
8
|
+
[](https://codesandbox.io/p/github/jigglypop/gaesup-world-examples/master?workspaceId=e8ae627a-af61-415e-aa21-1fe5af422c86)
|
|
9
|
+
|
|
10
|
+
> click and watch code sandbox example!
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## introduction
|
|
15
|
+
|
|
16
|
+
Gaesup World is a library that uses @react/three-fiber, @react/three-drei, and rapier to provide control tools for characters, airplanes, cars, and more in a web 3D environment. This controller is designed to easily manage character movement, animation, and interaction. It allows for easy manipulation of characters or vehicles in a virtual world, and is also equipped with utilities like minimaps and joysticks.
|
|
17
|
+
|
|
18
|
+
## How to start
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
"use client";
|
|
22
|
+
|
|
23
|
+
import { Environment, KeyboardControls } from "@react-three/drei";
|
|
24
|
+
import { Canvas } from "@react-three/fiber";
|
|
25
|
+
import { Physics, RigidBody } from "@react-three/rapier";
|
|
26
|
+
|
|
27
|
+
import { GaesupController, GaesupWorld } from "gaesup-world";
|
|
28
|
+
|
|
29
|
+
export const keyboardMap = [
|
|
30
|
+
{ name: "forward", keys: ["ArrowUp", "KeyW"] },
|
|
31
|
+
{ name: "backward", keys: ["ArrowDown", "KeyS"] },
|
|
32
|
+
{ name: "leftward", keys: ["ArrowLeft", "KeyA"] },
|
|
33
|
+
{ name: "rightward", keys: ["ArrowRight", "KeyD"] },
|
|
34
|
+
{ name: "space", keys: ["Space"] },
|
|
35
|
+
{ name: "shift", keys: ["Shift"] },
|
|
36
|
+
{ name: "keyZ", keys: ["KeyZ"] },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export default function App() {
|
|
40
|
+
const CHARACTER_URL = "./gaesupyee.glb";
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<GaesupWorld
|
|
44
|
+
url={{
|
|
45
|
+
characterUrl: CHARACTER_URL,
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<Canvas shadows style={{ width: "100dvw", height: "100dvh" }}>
|
|
49
|
+
<Environment background preset="sunset" blur={0.8} />
|
|
50
|
+
<Physics>
|
|
51
|
+
<KeyboardControls map={keyboardMap}>
|
|
52
|
+
<GaesupController
|
|
53
|
+
groupProps={{
|
|
54
|
+
rotation: [0, Math.PI, 0],
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
</KeyboardControls>
|
|
58
|
+
<RigidBody type="fixed">
|
|
59
|
+
<mesh receiveShadow position={[0, 0, 0]}>
|
|
60
|
+
<boxGeometry args={[300, 5, 300]} />
|
|
61
|
+
<meshStandardMaterial />
|
|
62
|
+
</mesh>
|
|
63
|
+
</RigidBody>
|
|
64
|
+
</Physics>
|
|
65
|
+
</Canvas>
|
|
66
|
+
</GaesupWorld>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
15
70
|
|
|
16
|
-
|
|
71
|
+
### Features
|
|
17
72
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
73
|
+
- 3D character control based on React Three Fiber.
|
|
74
|
+
- Simple API for controlling character movement and animation.
|
|
75
|
+
- Extensible structure for various customizations.
|
|
76
|
+
- Lightweight library for fast loading and performance optimization.
|
|
22
77
|
|
|
23
|
-
|
|
78
|
+
### Installation
|
|
24
79
|
|
|
25
80
|
```bash
|
|
26
81
|
npm install @react-three/fiber @react-three/drei three @types/three @react-three/rapier gaesup-world
|
|
27
82
|
```
|
|
28
83
|
|
|
29
|
-
|
|
84
|
+
Or
|
|
30
85
|
|
|
31
86
|
```bash
|
|
32
87
|
yarn add @react-three/fiber @react-three/drei three @types/three @react-three/rapier gaesup-world
|
|
33
88
|
```
|
|
34
89
|
|
|
35
|
-
|
|
90
|
+
### Documentation
|
|
91
|
+
|
|
92
|
+
it is detailed usage methods and API documentation
|
|
93
|
+
|
|
94
|
+
- [how to contribute](#how-to-contribute)
|
|
95
|
+
|
|
96
|
+
### How to Contribute
|
|
97
|
+
|
|
98
|
+
If you would like to contribute to this project, please follow these steps:
|
|
99
|
+
|
|
100
|
+
1. Fork the project.
|
|
101
|
+
2. Create a new Feature branch (`git checkout -b feature/AmazingFeature`).
|
|
102
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
|
|
103
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`).
|
|
104
|
+
5. Create a Pull Request.
|
|
105
|
+
|
|
106
|
+
### License
|
|
107
|
+
|
|
108
|
+
This project is distributed under the MIT License.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Controller
|
|
113
|
+
|
|
114
|
+
#### [Controller](#controller)
|
|
115
|
+
|
|
116
|
+
- [Character](#character)
|
|
117
|
+
- [Vehicle](#vehicle)
|
|
118
|
+
- [Airplane](#airplane)
|
|
119
|
+
|
|
120
|
+
## Character
|
|
121
|
+
|
|
122
|
+
This is the character control in Gaesup World.
|
|
123
|
+
|
|
124
|
+
- Possible Camera Types
|
|
125
|
+
|
|
126
|
+
| Name | Camera | Control | Info |
|
|
127
|
+
| ------ | ------------------- | ------------- | --------------------------------------------------------------------------------------------- |
|
|
128
|
+
| Normal | Perspective Camera | Orbit Control | Positioned parallel to the Z-axis from the character's location and not affected by rotation. |
|
|
129
|
+
| Orbit | Perspective Camera | Orbit Control | Moves with the character and rotates according to the character's direction. |
|
|
130
|
+
| Map | Orthographic Camera | Map Control | A top-down control view. |
|
|
131
|
+
|
|
132
|
+
- Controller Tools
|
|
133
|
+
|
|
134
|
+
| Name | Info |
|
|
135
|
+
| -------- | ----------------------------------------------------------------------- |
|
|
136
|
+
| Keyboard | A standard keyboard tool. You can see where on the keyboard is clicked. |
|
|
137
|
+
| Joystick | A joystick implementation tool. It works on mobile devices. |
|
|
138
|
+
| Gameboy | A Gameboy implementation tool. It works on mobile devices. |
|
|
139
|
+
|
|
140
|
+
## Vehicle
|
|
141
|
+
|
|
142
|
+
This is the vehicle control in Gaesup World. Characters can board the vehicle.
|
|
143
|
+
|
|
144
|
+
- Possible Camera Types
|
|
145
|
+
|
|
146
|
+
| Name | Camera | Control | Info |
|
|
147
|
+
| ------ | ------------------- | ------------- | --------------------------------------------------------------------------------------------- |
|
|
148
|
+
| Normal | Perspective Camera | Orbit Control | Positioned parallel to the Z-axis from the character's location and not affected by rotation. |
|
|
149
|
+
| Orbit | Perspective Camera | Orbit Control | Moves with the character and rotates according to the character's direction. |
|
|
150
|
+
| Map | Orthographic Camera | Map Control | A top-down control view. |
|
|
151
|
+
|
|
152
|
+
- Controller Tools
|
|
153
|
+
|
|
154
|
+
| Name | Info |
|
|
155
|
+
| -------- | ----------------------------------------------------------------------- |
|
|
156
|
+
| Keyboard | A standard keyboard tool. You can see where on the keyboard is clicked. |
|
|
157
|
+
| Joystick | A joystick implementation tool. It works on mobile devices. |
|
|
158
|
+
| Gameboy | A Gameboy implementation tool. It works on mobile devices. |
|
|
159
|
+
|
|
160
|
+
## Airplane
|
|
161
|
+
|
|
162
|
+
This is the airplane control in Gaesup World. Characters can board the airplane.
|
|
163
|
+
|
|
164
|
+
- Possible Camera Types
|
|
165
|
+
|
|
166
|
+
| Name | Camera | Control | Info |
|
|
167
|
+
| ------ | ------------------- | ------------- | --------------------------------------------------------------------------------------------- |
|
|
168
|
+
| Normal | Perspective Camera | Orbit Control | Positioned parallel to the Z-axis from the character's location and not affected by rotation. |
|
|
169
|
+
| Orbit | Perspective Camera | Orbit Control | Moves with the character and rotates according to the character's direction. |
|
|
170
|
+
| Map | Orthographic Camera | Map Control | A top-down control view. |
|
|
171
|
+
|
|
172
|
+
- Controller Tools
|
|
173
|
+
|
|
174
|
+
| Name | Info |
|
|
175
|
+
| -------- | ----------------------------------------------------------------------- |
|
|
176
|
+
| Keyboard | A standard keyboard tool. You can see where on the keyboard is clicked. |
|
|
177
|
+
| Joystick | A joystick implementation tool. It works on mobile devices. |
|
|
178
|
+
| Gameboy | A Gameboy implementation tool. It works on mobile devices. |
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Tools
|
|
183
|
+
|
|
184
|
+
#### [Tools](#tools)
|
|
185
|
+
|
|
186
|
+
#### [joystick](#joystick)
|
|
187
|
+
|
|
188
|
+
#### [keyboardtooltip](#keyboard tooltip)
|
|
36
189
|
|
|
37
|
-
|
|
190
|
+
#### [minimap](#minimap)
|
|
38
191
|
|
|
39
|
-
|
|
192
|
+
#### [gameboy](#gameboy)
|
|
40
193
|
|
|
41
|
-
|
|
194
|
+
## joystick
|
|
42
195
|
|
|
43
|
-
|
|
44
|
-
2. 새로운 Feature 브랜치를 생성합니다 (`git checkout -b feature/AmazingFeature`).
|
|
45
|
-
3. 변경사항을 Commit합니다 (`git commit -m 'Add some AmazingFeature'`).
|
|
46
|
-
4. 브랜치에 Push합니다 (`git push origin feature/AmazingFeature`).
|
|
47
|
-
5. Pull Request를 생성합니다.
|
|
196
|
+
## keyboard tooltip
|
|
48
197
|
|
|
49
|
-
##
|
|
198
|
+
## minimap
|
|
50
199
|
|
|
51
|
-
|
|
200
|
+
## gameboy
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from "react";
|
|
2
|
+
import { Object3D, Object3DEventMap } from "three";
|
|
3
|
+
import { animationTagType, groundRayType } from "../controller/type";
|
|
4
|
+
export type playActionsType = {
|
|
5
|
+
groundRay: groundRayType;
|
|
6
|
+
};
|
|
7
|
+
export type actionsType = {
|
|
8
|
+
[x: string]: THREE.AnimationAction | null;
|
|
9
|
+
};
|
|
10
|
+
export type playResultType = {
|
|
11
|
+
actions: actionsType;
|
|
12
|
+
ref: Ref<Object3D<Object3DEventMap>>;
|
|
13
|
+
};
|
|
14
|
+
export declare function usePlayActions(): {
|
|
15
|
+
resultRef: {
|
|
16
|
+
character: playResultType;
|
|
17
|
+
vehicle: playResultType;
|
|
18
|
+
airplane: playResultType;
|
|
19
|
+
};
|
|
20
|
+
play: (tag: keyof animationTagType) => void;
|
|
21
|
+
setAnimationName: (actions: actionsType) => void;
|
|
22
|
+
};
|
|
23
|
+
export default function playCharacterActions({ groundRay }: playActionsType): {
|
|
24
|
+
ref: Ref<Object3D<Object3DEventMap>>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
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 { useAnimations, useKeyboardControls } from "@react-three/drei";
|
|
13
|
+
import { useFrame } from "@react-three/fiber";
|
|
14
|
+
import { useContext, useEffect } from "react";
|
|
15
|
+
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../world/context";
|
|
16
|
+
export function usePlayActions() {
|
|
17
|
+
var _a = useContext(GaesupWorldContext), characterGltf = _a.characterGltf, vehicleGltf = _a.vehicleGltf, airplaneGltf = _a.airplaneGltf, animations = _a.animations;
|
|
18
|
+
var characterAnimations = characterGltf.animations;
|
|
19
|
+
var characterResult = useAnimations(characterAnimations);
|
|
20
|
+
var vehicleAnimations = vehicleGltf.animations;
|
|
21
|
+
var vehicleResult = useAnimations(vehicleAnimations);
|
|
22
|
+
var airplaneAnimations = airplaneGltf.animations;
|
|
23
|
+
var airplaneResult = useAnimations(airplaneAnimations);
|
|
24
|
+
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
25
|
+
var play = function (tag) {
|
|
26
|
+
animations.current = tag;
|
|
27
|
+
dispatch({
|
|
28
|
+
type: "update",
|
|
29
|
+
payload: {
|
|
30
|
+
animations: __assign({}, animations),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var setAnimationName = function (actions) {
|
|
35
|
+
animations.animationNames = Object.assign(animations.animationNames, Object.keys(actions).reduce(function (acc, cur) {
|
|
36
|
+
var _a;
|
|
37
|
+
return __assign(__assign({}, acc), (_a = {}, _a[cur] = cur, _a));
|
|
38
|
+
}, {}));
|
|
39
|
+
dispatch({
|
|
40
|
+
type: "update",
|
|
41
|
+
payload: {
|
|
42
|
+
animations: __assign({}, animations),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var resultRef = {
|
|
47
|
+
character: characterResult,
|
|
48
|
+
vehicle: vehicleResult,
|
|
49
|
+
airplane: airplaneResult,
|
|
50
|
+
};
|
|
51
|
+
return { resultRef: resultRef, play: play, setAnimationName: setAnimationName };
|
|
52
|
+
}
|
|
53
|
+
export default function playCharacterActions(_a) {
|
|
54
|
+
var groundRay = _a.groundRay;
|
|
55
|
+
var _b = usePlayActions(), _c = _b.resultRef.character, actions = _c.actions, ref = _c.ref, play = _b.play, setAnimationName = _b.setAnimationName;
|
|
56
|
+
var _d = useContext(GaesupWorldContext), states = _d.states, activeState = _d.activeState, animations = _d.animations, mode = _d.mode;
|
|
57
|
+
var isNotMoving = states.isNotMoving, isMoving = states.isMoving, isJumping = states.isJumping, isRunning = states.isRunning, isAnimationOuter = states.isAnimationOuter, isOnTheGround = states.isOnTheGround;
|
|
58
|
+
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
59
|
+
var control = useKeyboardControls()[1]();
|
|
60
|
+
var resetAni = function () { return play("idle"); };
|
|
61
|
+
var playIdle = function () { return play("idle"); };
|
|
62
|
+
var playWalk = function () { return play("walk"); };
|
|
63
|
+
var playRun = function () { return play("run"); };
|
|
64
|
+
var playJump = function () { return play("jump"); };
|
|
65
|
+
var playFall = function () { return play("fall"); };
|
|
66
|
+
var playRide = function () { return play("ride"); };
|
|
67
|
+
var playLanding = function () { return play("land"); };
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
return function () {
|
|
70
|
+
resetAni();
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
animations.keyControl = control;
|
|
75
|
+
dispatch({
|
|
76
|
+
type: "update",
|
|
77
|
+
payload: {
|
|
78
|
+
animations: __assign({}, animations),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}, [control]);
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
var _a;
|
|
84
|
+
if (mode.type === "character") {
|
|
85
|
+
var action_1 = (_a = actions[animations.current]) === null || _a === void 0 ? void 0 : _a.reset().fadeIn(0.2).play();
|
|
86
|
+
setAnimationName(actions);
|
|
87
|
+
return function () {
|
|
88
|
+
action_1 === null || action_1 === void 0 ? void 0 : action_1.fadeOut(0.2);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}, [animations.current, mode.type]);
|
|
92
|
+
useFrame(function () {
|
|
93
|
+
if (mode.type === "character") {
|
|
94
|
+
if (!isAnimationOuter) {
|
|
95
|
+
if (isJumping) {
|
|
96
|
+
playJump();
|
|
97
|
+
}
|
|
98
|
+
else if (isNotMoving) {
|
|
99
|
+
playIdle();
|
|
100
|
+
}
|
|
101
|
+
else if (isRunning) {
|
|
102
|
+
playRun();
|
|
103
|
+
}
|
|
104
|
+
else if (isMoving) {
|
|
105
|
+
playWalk();
|
|
106
|
+
}
|
|
107
|
+
if (groundRay.hit) {
|
|
108
|
+
if (!isJumping && !isOnTheGround) {
|
|
109
|
+
if (groundRay.hit.toi < 5) {
|
|
110
|
+
playLanding();
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
playFall();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (groundRay.hit === null && activeState.velocity.y < 0) {
|
|
118
|
+
playFall();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
ref: ref,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as playActions from "./actions";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as playActions from "./actions";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnimationClip } from "three";
|
|
3
|
+
export type playPassiveActionsType = {
|
|
4
|
+
current: string;
|
|
5
|
+
animations: AnimationClip[];
|
|
6
|
+
};
|
|
7
|
+
export default function playPassiveActions({ current, animations, }: playPassiveActionsType): {
|
|
8
|
+
animationRef: import("react").MutableRefObject<import("three").Object3D<import("three").Object3DEventMap>>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useAnimations } from "@react-three/drei";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
export default function playPassiveActions(_a) {
|
|
4
|
+
var current = _a.current, animations = _a.animations;
|
|
5
|
+
var _b = useAnimations(animations), actions = _b.actions, animationRef = _b.ref;
|
|
6
|
+
useEffect(function () {
|
|
7
|
+
var _a;
|
|
8
|
+
var action = (_a = actions[current]) === null || _a === void 0 ? void 0 : _a.reset().fadeIn(0.2).play();
|
|
9
|
+
return function () {
|
|
10
|
+
action === null || action === void 0 ? void 0 : action.fadeOut(0.2);
|
|
11
|
+
};
|
|
12
|
+
}, [current]);
|
|
13
|
+
return {
|
|
14
|
+
animationRef: animationRef,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -3,7 +3,7 @@ export default function normal(prop) {
|
|
|
3
3
|
var state = prop.state, perspectiveCamera = prop.controllerContext.perspectiveCamera, activeState = prop.worldContext.activeState;
|
|
4
4
|
var cameraPosition = activeState.position
|
|
5
5
|
.clone()
|
|
6
|
-
.add(V3(
|
|
6
|
+
.add(V3(0, perspectiveCamera.YDistance, perspectiveCamera.XZDistance));
|
|
7
7
|
state.camera.position.lerp(cameraPosition, 1);
|
|
8
8
|
state.camera.lookAt(activeState.position.clone());
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { controllerInnerType, refsType } from "../controller/type";
|
|
2
2
|
export default function Camera({ refs, prop, control, }: {
|
|
3
3
|
refs: refsType;
|
|
4
|
-
prop:
|
|
4
|
+
prop: controllerInnerType;
|
|
5
5
|
control: {
|
|
6
6
|
[key: string]: boolean;
|
|
7
7
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Collider } from "@dimforge/rapier3d-compat";
|
|
3
|
+
import { controllerInnerType } from "../../../controller/type";
|
|
4
|
+
export declare const AirplaneCollider: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
props: controllerInnerType;
|
|
6
|
+
} & import("react").RefAttributes<Collider>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CuboidCollider, useRapier } from "@react-three/rapier";
|
|
3
|
+
import { forwardRef, useContext } from "react";
|
|
4
|
+
import { getRayHit, useForwardRef } from "../../../utils";
|
|
5
|
+
import { GaesupWorldContext } from "../../../world/context";
|
|
6
|
+
export var AirplaneCollider = forwardRef(function (_a, ref) {
|
|
7
|
+
var _b;
|
|
8
|
+
var props = _a.props;
|
|
9
|
+
var collider = useContext(GaesupWorldContext).airplaneCollider;
|
|
10
|
+
var airplaneSizeX = collider.airplaneSizeX, airplaneSizeY = collider.airplaneSizeY, airplaneSizeZ = collider.airplaneSizeZ;
|
|
11
|
+
var colliderRef = useForwardRef(ref);
|
|
12
|
+
var rapier = useRapier().rapier;
|
|
13
|
+
var groundRay = props.groundRay;
|
|
14
|
+
groundRay.length = airplaneSizeY * 5 + 2;
|
|
15
|
+
groundRay.rayCast = new rapier.Ray(groundRay.origin, groundRay.dir);
|
|
16
|
+
groundRay.hit = getRayHit({
|
|
17
|
+
ray: groundRay,
|
|
18
|
+
ref: colliderRef,
|
|
19
|
+
});
|
|
20
|
+
groundRay.parent = (_b = groundRay.hit) === null || _b === void 0 ? void 0 : _b.collider.parent();
|
|
21
|
+
return (_jsx(CuboidCollider, { ref: ref, args: [airplaneSizeX / 2, airplaneSizeY / 2, airplaneSizeZ / 2], position: [0, airplaneSizeY / 2, 0] }));
|
|
22
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { GaesupWorldContext } from "../../../world/context";
|
|
4
|
+
import { InnerGroupRef } from "../common/InnerGroupRef";
|
|
5
|
+
import { WrapperRef } from "../common/WrapperRef";
|
|
6
|
+
import { AirplaneCollider } from "./collider";
|
|
7
|
+
export function AirplaneRef(_a) {
|
|
8
|
+
var props = _a.props, refs = _a.refs;
|
|
9
|
+
var _b = useContext(GaesupWorldContext), characterGltf = _b.characterGltf, airplaneGltf = _b.airplaneGltf;
|
|
10
|
+
return (_jsxs(WrapperRef, { props: props, refs: refs, gltf: airplaneGltf, children: [props.isRider && (_jsx(InnerGroupRef, { props: props, gltf: characterGltf, ref: refs.characterInnerRef })), _jsx(AirplaneCollider, { props: props })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Collider } from "@dimforge/rapier3d-compat";
|
|
3
|
+
import { controllerInnerType } from "../../../controller/type";
|
|
4
|
+
export declare const CharacterCapsuleCollider: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
props: controllerInnerType;
|
|
6
|
+
} & import("react").RefAttributes<Collider>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CapsuleCollider, useRapier } from "@react-three/rapier";
|
|
3
|
+
import { forwardRef, useContext } from "react";
|
|
4
|
+
import { getRayHit, useForwardRef } from "../../../utils";
|
|
5
|
+
import { GaesupWorldContext } from "../../../world/context";
|
|
6
|
+
export var CharacterCapsuleCollider = forwardRef(function (_a, ref) {
|
|
7
|
+
var _b;
|
|
8
|
+
var props = _a.props;
|
|
9
|
+
var collider = useContext(GaesupWorldContext).characterCollider;
|
|
10
|
+
var colliderRef = useForwardRef(ref);
|
|
11
|
+
var rapier = useRapier().rapier;
|
|
12
|
+
var groundRay = props.groundRay, slopeRay = props.slopeRay;
|
|
13
|
+
groundRay.length = collider.radius + 2;
|
|
14
|
+
groundRay.rayCast = new rapier.Ray(groundRay.origin, groundRay.dir);
|
|
15
|
+
groundRay.hit = getRayHit({
|
|
16
|
+
ray: groundRay,
|
|
17
|
+
ref: colliderRef,
|
|
18
|
+
});
|
|
19
|
+
groundRay.parent = (_b = groundRay.hit) === null || _b === void 0 ? void 0 : _b.collider.parent();
|
|
20
|
+
slopeRay.rayCast = new rapier.Ray(slopeRay.origin, slopeRay.dir);
|
|
21
|
+
slopeRay.length = collider.radius + 3;
|
|
22
|
+
slopeRay.rayCast = new rapier.Ray(slopeRay.origin, slopeRay.dir);
|
|
23
|
+
return (_jsx(CapsuleCollider, { ref: ref, args: [collider.height, collider.radius], position: [0, collider.height + collider.radius, 0] }));
|
|
24
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import initCallback from "../../../controller/initialize/callback";
|
|
4
|
+
import { GaesupWorldContext } from "../../../world/context";
|
|
5
|
+
import { CharacterCapsuleCollider } from "./collider";
|
|
6
|
+
import playCharacterActions from "../../../animation/actions";
|
|
7
|
+
import { WrapperRef } from "../common/WrapperRef";
|
|
8
|
+
export function CharacterRef(_a) {
|
|
9
|
+
var props = _a.props, refs = _a.refs;
|
|
10
|
+
initCallback(props);
|
|
11
|
+
var _b = useContext(GaesupWorldContext), characterGltf = _b.characterGltf, characterCollider = _b.characterCollider, vehicleCollider = _b.vehicleCollider;
|
|
12
|
+
var ref = playCharacterActions({
|
|
13
|
+
groundRay: props.groundRay,
|
|
14
|
+
}).ref;
|
|
15
|
+
return (_jsx(WrapperRef, { props: props, refs: refs, gltf: characterGltf, animationRef: ref, children: _jsx(CharacterCapsuleCollider, { props: props, ref: refs.capsuleColliderRef }) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ref } from "react";
|
|
2
|
+
import { controllerInnerType } from "../../../controller/type";
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
import { GLTFResult } from "../../type";
|
|
5
|
+
export type InnerGroupRefType = {
|
|
6
|
+
props: controllerInnerType;
|
|
7
|
+
animationRef?: Ref<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
8
|
+
gltf: GLTFResult;
|
|
9
|
+
};
|
|
10
|
+
export declare const InnerGroupRef: import("react").ForwardRefExoticComponent<InnerGroupRefType & import("react").RefAttributes<THREE.Group<THREE.Object3DEventMap>>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { forwardRef, useMemo } from "react";
|
|
14
|
+
import { useGraph } from "@react-three/fiber";
|
|
15
|
+
import * as THREE from "three";
|
|
16
|
+
import { SkeletonUtils } from "three-stdlib";
|
|
17
|
+
export var InnerGroupRef = forwardRef(function (_a, ref) {
|
|
18
|
+
var props = _a.props, animationRef = _a.animationRef, gltf = _a.gltf;
|
|
19
|
+
var scene = gltf.scene;
|
|
20
|
+
var clone = useMemo(function () { return SkeletonUtils.clone(scene); }, [scene]);
|
|
21
|
+
var nodes = useGraph(clone).nodes;
|
|
22
|
+
var objectNode = Object.values(nodes).find(function (node) { return node.type === "Object3D"; });
|
|
23
|
+
return (_jsxs("group", __assign({ receiveShadow: true, castShadow: true }, props.groupProps, { ref: ref, children: [objectNode && animationRef && (_jsx("primitive", { object: objectNode, visible: false, receiveShadow: true, castShadow: true, ref: animationRef })), Object.keys(nodes).map(function (name, key) {
|
|
24
|
+
var node = nodes[name];
|
|
25
|
+
if (node instanceof THREE.SkinnedMesh) {
|
|
26
|
+
return (_jsx("skinnedMesh", { castShadow: true, receiveShadow: true, material: node.material, geometry: node.geometry, skeleton: node.skeleton }, key));
|
|
27
|
+
}
|
|
28
|
+
else if (node instanceof THREE.Mesh) {
|
|
29
|
+
return (_jsx("mesh", { castShadow: true, receiveShadow: true, material: node.material, geometry: node.geometry }, key));
|
|
30
|
+
}
|
|
31
|
+
})] })));
|
|
32
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { controllerType } from "../../../controller/type";
|
|
3
|
+
export declare const OuterGroupRef: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
props: controllerType;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
} & import("react").RefAttributes<import("three").Group<import("three").Object3DEventMap>>>;
|
package/dist/{src/gaesup/tools/reducer.js → gaesup/component/active/common/OuterGroupRef.js}
RENAMED
|
@@ -9,16 +9,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return __assign(__assign({}, props), action.payload);
|
|
19
|
-
}
|
|
20
|
-
default: {
|
|
21
|
-
throw Error("Unknown action: " + action.type);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
export var OuterGroupRef = forwardRef(function (_a, ref) {
|
|
15
|
+
var props = _a.props, children = _a.children;
|
|
16
|
+
return (_jsx("group", __assign({ ref: ref, userData: { intangible: true } }, props.vehicle, { children: children })));
|
|
17
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RapierRigidBody } from "@react-three/rapier";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { controllerInnerType } from "../../../controller/type";
|
|
4
|
+
export declare const RigidBodyRef: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
props: controllerInnerType;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
} & import("react").RefAttributes<RapierRigidBody>>;
|