gaesup-world 0.1.3 → 0.2.0
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 +220 -228
- package/dist/gaesup/animation/actions.d.ts +29 -13
- package/dist/gaesup/animation/actions.js +33 -60
- package/dist/gaesup/camera/index.js +1 -2
- package/dist/gaesup/component/active/airplane/index.d.ts +9 -3
- package/dist/gaesup/component/active/airplane/index.js +3 -7
- package/dist/gaesup/component/active/character/index.d.ts +3 -1
- package/dist/gaesup/component/active/character/index.js +29 -11
- package/dist/gaesup/component/active/vehicle/index.d.ts +10 -3
- package/dist/gaesup/component/active/vehicle/index.js +29 -9
- package/dist/gaesup/component/index.d.ts +3 -1
- package/dist/gaesup/component/index.js +9 -3
- package/dist/gaesup/component/inner/airplane/index.d.ts +2 -0
- package/dist/gaesup/component/inner/airplane/index.js +16 -0
- package/dist/gaesup/component/inner/character/index.d.ts +25 -0
- package/dist/gaesup/component/inner/character/index.js +28 -0
- package/dist/gaesup/component/{passive → inner}/common/InnerGroupRef.d.ts +2 -0
- package/dist/gaesup/component/{passive → inner}/common/InnerGroupRef.js +12 -10
- package/dist/gaesup/component/{passive → inner}/common/RigidbodyRef.d.ts +4 -0
- package/dist/gaesup/component/inner/common/RigidbodyRef.js +7 -0
- package/dist/gaesup/component/inner/common/setGroundRay.d.ts +9 -0
- package/dist/gaesup/component/inner/common/setGroundRay.js +14 -0
- package/dist/gaesup/component/inner/common/type.d.ts +20 -0
- package/dist/gaesup/component/inner/rider/index.d.ts +11 -0
- package/dist/gaesup/component/inner/rider/index.js +31 -0
- package/dist/gaesup/component/inner/vehicle/collider.d.ts +10 -0
- package/dist/gaesup/component/inner/vehicle/collider.js +19 -0
- package/dist/gaesup/component/inner/vehicle/index.d.ts +2 -0
- package/dist/gaesup/component/inner/vehicle/index.js +17 -0
- package/dist/gaesup/component/inner/vehicle/wheels.d.ts +7 -0
- package/dist/gaesup/component/inner/vehicle/wheels.js +64 -0
- package/dist/gaesup/component/passive/airplane/index.d.ts +12 -1
- package/dist/gaesup/component/passive/airplane/index.js +6 -9
- package/dist/gaesup/component/passive/character/index.d.ts +9 -1
- package/dist/gaesup/component/passive/character/index.js +16 -9
- package/dist/gaesup/component/passive/type.d.ts +1 -11
- package/dist/gaesup/component/passive/vehicle/index.d.ts +12 -1
- package/dist/gaesup/component/passive/vehicle/index.js +6 -25
- package/dist/gaesup/controller/context/index.d.ts +7 -3
- package/dist/gaesup/controller/context/index.js +7 -3
- package/dist/gaesup/controller/context/reducer.d.ts +1 -1
- package/dist/gaesup/controller/index.js +5 -8
- package/dist/gaesup/controller/initialize/callback/index.d.ts +1 -1
- package/dist/gaesup/controller/initialize/callback/index.js +61 -54
- package/dist/gaesup/controller/initialize/index.d.ts +1 -2
- package/dist/gaesup/controller/initialize/index.js +1 -14
- package/dist/gaesup/controller/type.d.ts +3 -6
- package/dist/gaesup/gaesupProps/index.js +1 -1
- package/dist/gaesup/hooks/useGaesupAnimation/index.d.ts +3 -1
- package/dist/gaesup/hooks/useGaesupAnimation/index.js +17 -16
- package/dist/gaesup/hooks/useGaesupController/index.d.ts +2 -5
- package/dist/gaesup/hooks/useGaesupController/index.js +4 -5
- package/dist/gaesup/hooks/useGaesupGltf/index.d.ts +25 -0
- package/dist/gaesup/hooks/useGaesupGltf/index.js +73 -0
- package/dist/gaesup/hooks/useRideable/index.js +36 -35
- package/dist/gaesup/physics/airplane/direction.d.ts +1 -1
- package/dist/gaesup/physics/airplane/direction.js +3 -1
- package/dist/gaesup/physics/airplane/gravity.js +1 -1
- package/dist/gaesup/physics/airplane/landing.js +1 -1
- package/dist/gaesup/physics/check/ground.js +3 -3
- package/dist/gaesup/physics/check/index.js +0 -2
- package/dist/gaesup/physics/check/riding.js +3 -3
- package/dist/gaesup/physics/index.js +8 -6
- package/dist/gaesup/physics/type.d.ts +4 -1
- package/dist/gaesup/physics/vehicle/impulse.d.ts +15 -1
- package/dist/gaesup/physics/vehicle/impulse.js +32 -12
- package/dist/gaesup/physics/vehicle/innerCalc.js +1 -1
- package/dist/gaesup/physics/vehicle/landing.js +1 -1
- package/dist/gaesup/tools/joyStick/index.d.ts +1 -1
- package/dist/gaesup/tools/keyBoardToolTip/index.js +3 -3
- package/dist/gaesup/tools/rideable/index.js +5 -6
- package/dist/gaesup/tools/zoomButton/index.js +5 -3
- package/dist/gaesup/world/context/index.js +27 -62
- package/dist/gaesup/world/context/reducer.d.ts +7 -12
- package/dist/gaesup/world/context/type.d.ts +36 -49
- package/dist/gaesup/world/debug/index.d.ts +6 -2
- package/dist/gaesup/world/initalize/index.d.ts +7 -12
- package/dist/gaesup/world/initalize/index.js +8 -15
- package/dist/gaesup/world/type.d.ts +3 -8
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/dist/gaesup/animation/index.d.ts +0 -1
- package/dist/gaesup/animation/index.js +0 -1
- package/dist/gaesup/animation/passiveActions.d.ts +0 -9
- package/dist/gaesup/animation/passiveActions.js +0 -16
- package/dist/gaesup/component/active/airplane/collider.d.ts +0 -6
- package/dist/gaesup/component/active/airplane/collider.js +0 -22
- package/dist/gaesup/component/active/character/collider.d.ts +0 -6
- package/dist/gaesup/component/active/character/collider.js +0 -24
- package/dist/gaesup/component/active/common/InnerGroupRef.d.ts +0 -10
- package/dist/gaesup/component/active/common/InnerGroupRef.js +0 -35
- package/dist/gaesup/component/active/common/OuterGroupRef.d.ts +0 -6
- package/dist/gaesup/component/active/common/OuterGroupRef.js +0 -17
- package/dist/gaesup/component/active/common/RiderGroupRef.d.ts +0 -7
- package/dist/gaesup/component/active/common/RiderGroupRef.js +0 -32
- package/dist/gaesup/component/active/common/RigidbodyRef.d.ts +0 -11
- package/dist/gaesup/component/active/common/RigidbodyRef.js +0 -22
- package/dist/gaesup/component/active/common/WrapperRef.d.ts +0 -13
- package/dist/gaesup/component/active/common/WrapperRef.js +0 -9
- package/dist/gaesup/component/active/common/slopeRayRef.d.ts +0 -6
- package/dist/gaesup/component/active/common/slopeRayRef.js +0 -10
- package/dist/gaesup/component/active/vehicle/collider.d.ts +0 -3
- package/dist/gaesup/component/active/vehicle/collider.js +0 -9
- package/dist/gaesup/component/active/vehicle/wheel.d.ts +0 -12
- package/dist/gaesup/component/active/vehicle/wheel.js +0 -13
- package/dist/gaesup/component/active/vehicle/wheels.d.ts +0 -7
- package/dist/gaesup/component/active/vehicle/wheels.js +0 -20
- package/dist/gaesup/component/passive/airplane/collider.d.ts +0 -5
- package/dist/gaesup/component/passive/airplane/collider.js +0 -7
- package/dist/gaesup/component/passive/airplane/type.d.ts +0 -12
- package/dist/gaesup/component/passive/character/collider.d.ts +0 -6
- package/dist/gaesup/component/passive/character/collider.js +0 -7
- package/dist/gaesup/component/passive/character/type.d.ts +0 -27
- package/dist/gaesup/component/passive/character/type.js +0 -1
- package/dist/gaesup/component/passive/common/RigidbodyRef.js +0 -10
- package/dist/gaesup/component/passive/vehicle/type.d.ts +0 -21
- package/dist/gaesup/component/passive/vehicle/type.js +0 -1
- package/dist/gaesup/component/passive/vehicle/wheel.d.ts +0 -15
- package/dist/gaesup/component/passive/vehicle/wheel.js +0 -16
- package/dist/gaesup/component/passive/vehicle/wheels.d.ts +0 -11
- package/dist/gaesup/component/passive/vehicle/wheels.js +0 -25
- package/dist/gaesup/physics/check/slope.d.ts +0 -2
- package/dist/gaesup/physics/check/slope.js +0 -30
- package/dist/gaesup/utils/gltf.d.ts +0 -7
- package/dist/gaesup/utils/gltf.js +0 -10
- package/dist/gaesup/world/initalize/collider/airplane.d.ts +0 -2
- package/dist/gaesup/world/initalize/collider/airplane.js +0 -25
- package/dist/gaesup/world/initalize/collider/character.d.ts +0 -2
- package/dist/gaesup/world/initalize/collider/character.js +0 -27
- package/dist/gaesup/world/initalize/collider/gltf.d.ts +0 -14
- package/dist/gaesup/world/initalize/collider/gltf.js +0 -54
- package/dist/gaesup/world/initalize/collider/index.d.ts +0 -2
- package/dist/gaesup/world/initalize/collider/index.js +0 -17
- package/dist/gaesup/world/initalize/collider/vehicle.d.ts +0 -2
- package/dist/gaesup/world/initalize/collider/vehicle.js +0 -55
- package/dist/gaesup/world/initalize/type.d.ts +0 -13
- package/dist/gaesup/world/initalize/type.js +0 -1
- /package/dist/gaesup/component/{passive → inner}/common/OuterGroupRef.d.ts +0 -0
- /package/dist/gaesup/component/{passive → inner}/common/OuterGroupRef.js +0 -0
- /package/dist/gaesup/component/{passive/airplane → inner/common}/type.js +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { useGltfAndSize } from "../../../utils/gltf";
|
|
3
|
-
export default function getGltf(_a) {
|
|
4
|
-
var value = _a.value, dispatch = _a.dispatch;
|
|
5
|
-
var url = value.url;
|
|
6
|
-
var result = {
|
|
7
|
-
characterGltf: null,
|
|
8
|
-
vehicleGltf: null,
|
|
9
|
-
wheelGltf: null,
|
|
10
|
-
airplaneGltf: null,
|
|
11
|
-
characterSize: null,
|
|
12
|
-
vehicleSize: null,
|
|
13
|
-
wheelSize: null,
|
|
14
|
-
airplaneSize: null,
|
|
15
|
-
};
|
|
16
|
-
if (url.characterUrl) {
|
|
17
|
-
var characterGltfAndSize = useGltfAndSize(url.characterUrl);
|
|
18
|
-
result.characterGltf = characterGltfAndSize.gltf;
|
|
19
|
-
result.characterSize = characterGltfAndSize.size;
|
|
20
|
-
}
|
|
21
|
-
if (url.vehicleUrl) {
|
|
22
|
-
var vehicleAndSize = useGltfAndSize(url.vehicleUrl);
|
|
23
|
-
result.vehicleGltf = vehicleAndSize.gltf;
|
|
24
|
-
result.vehicleSize = vehicleAndSize.size;
|
|
25
|
-
if (url.wheelUrl) {
|
|
26
|
-
var wheelAndSize = useGltfAndSize(url.wheelUrl);
|
|
27
|
-
result.wheelGltf = wheelAndSize.gltf;
|
|
28
|
-
result.wheelSize = wheelAndSize.size;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (url.airplaneUrl) {
|
|
32
|
-
var airplaneAndSize = useGltfAndSize(url.airplaneUrl);
|
|
33
|
-
result.airplaneGltf = airplaneAndSize.gltf;
|
|
34
|
-
result.airplaneSize = airplaneAndSize.size;
|
|
35
|
-
}
|
|
36
|
-
useEffect(function () {
|
|
37
|
-
dispatch({
|
|
38
|
-
type: "update",
|
|
39
|
-
payload: {
|
|
40
|
-
characterGltf: result.characterGltf,
|
|
41
|
-
vehicleGltf: result.vehicleGltf,
|
|
42
|
-
wheelGltf: result.wheelGltf,
|
|
43
|
-
airplaneGltf: result.airplaneGltf,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
}, [
|
|
47
|
-
url,
|
|
48
|
-
result.airplaneGltf,
|
|
49
|
-
result.characterGltf,
|
|
50
|
-
result.vehicleGltf,
|
|
51
|
-
result.wheelGltf,
|
|
52
|
-
]);
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { airplane } from "./airplane";
|
|
2
|
-
import { character } from "./character";
|
|
3
|
-
import getGltf from "./gltf";
|
|
4
|
-
import { vehicle } from "./vehicle";
|
|
5
|
-
export default function initColider(_a) {
|
|
6
|
-
var value = _a.value, dispatch = _a.dispatch;
|
|
7
|
-
var colliderProps = {
|
|
8
|
-
gltf: null,
|
|
9
|
-
value: value,
|
|
10
|
-
dispatch: dispatch,
|
|
11
|
-
};
|
|
12
|
-
var gltf = getGltf(colliderProps);
|
|
13
|
-
colliderProps.gltf = gltf;
|
|
14
|
-
character(colliderProps);
|
|
15
|
-
vehicle(colliderProps);
|
|
16
|
-
airplane(colliderProps);
|
|
17
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
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 { useEffect } from "react";
|
|
13
|
-
import { isVectorNonZero } from "../../../utils";
|
|
14
|
-
import { update } from "../../../utils/context";
|
|
15
|
-
export function vehicle(_a) {
|
|
16
|
-
var gltf = _a.gltf, value = _a.value, dispatch = _a.dispatch;
|
|
17
|
-
var url = value.url;
|
|
18
|
-
if (!url || !url.vehicleUrl)
|
|
19
|
-
return;
|
|
20
|
-
var vehicleSize = gltf.vehicleSize, wheelSize = gltf.wheelSize;
|
|
21
|
-
useEffect(function () {
|
|
22
|
-
if (isVectorNonZero(vehicleSize)) {
|
|
23
|
-
var vehicleCollider = {
|
|
24
|
-
vehicleSizeX: vehicleSize.x,
|
|
25
|
-
vehicleSizeZ: vehicleSize.z,
|
|
26
|
-
vehicleX: vehicleSize.x / 2,
|
|
27
|
-
vehicleZ: vehicleSize.z / 2,
|
|
28
|
-
};
|
|
29
|
-
if (url.wheelUrl && isVectorNonZero(wheelSize)) {
|
|
30
|
-
vehicleCollider.vehicleSizeY = wheelSize.y / 2;
|
|
31
|
-
vehicleCollider.vehicleY = wheelSize.y;
|
|
32
|
-
vehicleCollider.wheelSizeX = wheelSize.x;
|
|
33
|
-
vehicleCollider.wheelSizeY = wheelSize.y;
|
|
34
|
-
vehicleCollider.wheelSizeZ = wheelSize.z;
|
|
35
|
-
update({
|
|
36
|
-
vehicleCollider: __assign({}, vehicleCollider),
|
|
37
|
-
}, dispatch);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
vehicleCollider.vehicleSizeY = vehicleSize.y;
|
|
41
|
-
vehicleCollider.vehicleY = vehicleSize.y;
|
|
42
|
-
update({
|
|
43
|
-
vehicleCollider: __assign({}, vehicleCollider),
|
|
44
|
-
}, dispatch);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}, [
|
|
48
|
-
vehicleSize.x,
|
|
49
|
-
vehicleSize.y,
|
|
50
|
-
vehicleSize.z,
|
|
51
|
-
wheelSize === null || wheelSize === void 0 ? void 0 : wheelSize.x,
|
|
52
|
-
wheelSize === null || wheelSize === void 0 ? void 0 : wheelSize.y,
|
|
53
|
-
wheelSize === null || wheelSize === void 0 ? void 0 : wheelSize.z,
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { dispatchType } from "../../utils/type";
|
|
2
|
-
import { gaesupWorldContextType } from "../context/type";
|
|
3
|
-
import { getGltfResultType } from "./collider/gltf";
|
|
4
|
-
export type innerColliderPropType = {
|
|
5
|
-
gltf?: getGltfResultType;
|
|
6
|
-
value: gaesupWorldContextType;
|
|
7
|
-
dispatch: dispatchType<gaesupWorldContextType>;
|
|
8
|
-
};
|
|
9
|
-
export type innerDebugPropType = {
|
|
10
|
-
gltf?: getGltfResultType;
|
|
11
|
-
value: gaesupWorldContextType;
|
|
12
|
-
dispatch: dispatchType<gaesupWorldContextType>;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|